Integrating external pages

eXBuilder6 supports a way to embed an external web page into a page using the embedded page control.

Embedded page

Load an external web page (html, jsp, php, asp, etc...). You actually load the page using an iframe, and you can call scripts from the loaded page.

How to communicate content inside/outside the embedded page

Using the cpr.adapters.PlatformAdapter class, it is possible to specify communication and focus movement between external web page files and eXBuilder6 pages.

To use this class, you must have the eXBuilder6 project > runtime > cpr-adapters.js file.

In the description below, the eXBuilder6 application, which contains an embedded page that displays an external web page, will be referred to as a 'host app'.

PlatformAdapter class functions

function name Description
registerChannelFunction Registers functions that can be called by the host app.
unregisterChannelFunction Remove a function registered in an external web page.
callHostFunction call a function in the host app from an external web page.
setFocusHandler Specifies a handler to give focus to the internal content when an embedded control displaying an external web page within the host app gains focus.
focusHost returns focus to the host app.

Examples

Example of moving the focus of an eXBuilder6 application and an external embedded page

This is an explanation of how to set the focus order for eXBuilder6 applications and external embedded pages.

Use the setFocusHandler function to specify the focus handler of external web pages and host apps.

// Specifies a handler when an embedded page displaying an external page gains focus.
cpr.adapters.PlatformAdapter.setFocusHandler(function(forward) {
	if(forward) {
		// Element to receive focus first
	} else {
		// The last element to receive focus
	}
});