Skip to end of metadata
Go to start of metadata

Sends a message from JavaScript to ADVPL. This message is received by the bJsToAdvpl code block of component TWebChanne associated with TWebEngine that shows the HTML page/component.

Syntax 

dialog.jsToAdvpl( < codeType >, < codeContent > )

Parameters

Name

Type

Description

Mandatory

Reference

codeType

character

Code of message received

X


codeContent

character

Text sent from JavaScript for ADVPL treatment

X


Note

  • Feature available in builds above 7.00.131227A.

Examples

// The ADVPL segment below creates the component TWebChannel and
// associated with the bJsToADVPL code block
oWebChannel := TWebChannel():New()
oWebChannel:bJsToAdvpl := {|self,codeType,codeContent| jsToAdvpl(self,codeType,codeContent) }

// Associates the port of compoent TWebChannel with component
// TWebEngine allowing the exchange of messages
oWebEngine := TWebEngine():New(oDlg,0,0,800, 600,,oWebChannel:nPort)

// JavaScript segment below send a signal notifying
// the end of HTML page/component
dialog.jsToAdvpl("page_started", "Page started");

// ADVPL segment below is the function activated
// by the bJsToAdvpl block code upon receiving the JavaScript message
static function jsToAdvpl(self,codeType,codeContent)
  if codeType == "page_started"
    msgAlert(codeContent)
  endif
return
  • No labels