eon_cordova_base object

The eon_cordova_base object defines the basic and common functions/events that will be called by the other objects.

Functions

of_getlasterror

Description

Gets the error information of the last function call.

Syntax

of_getlasterror ( )

Return value

String. The error information of the last call.

of_getlastreturn

Description

Gets the return value of the last function call if that call returns any value.

Syntax

of_getlastreturn ( )

Return value

String. The return value of the last call.

of_getvaluefromkey

Description

Gets the value from a JSON-format string for the specified key name.

Syntax

of_getvaluefromkey ( string as_json, string as_key )

Parameter

as_json - A JSON-format string.

as_key - Key name. It is case sensitive.

Return value

String. Key value of the specified key.

of_init

Description

Connects with the Cordova plugin, detects if the plugin is available to call, and binds the current PowerBuilder object with the JavaScript object defined by the plugin. After that, the PowerBuilder object has all of the methods and properties that the JavaScript object has.

Syntax

of_init ( )

of_init ( string as_pluginname )

Parameter

as_pluginname - Name of the JavaScript object defined by the plugin.

Return value

Integer.

1 - Success.

-1 - It is called in PowerBuilder or Appeon Web, or there is an error.

of_isios

Description

Detects if the current platform is iOS or Android.

Syntax

of_isios ( )

Return value

Boolean.

True - iOS

False - Android

Null - It is called in PowerBuilder or Appeon Web, or there is an error.

of_register

Description

Registers the object and the event to be bound with the oe_success event and the oe_error event.

Syntax

of_register ( powerobject apb_bind, string as_successevent, string as_errorevent )

Parameter

apb_bind - The object to be bound with the oe_error and oe_success event.

as_successevent - The event to be bound with the oe_success event.

as_errorevent - The event to be bound with the oe_error event.

Return value

Integer.

1 - Success.

-1 - It is called in PowerBuilder or Appeon Web, or there is an error.

of_settimeout

Description

Sets the timeout value for the function call.

Syntax

of_settimeout ( long al_timeout )

Parameter

al_timeout - Milliseconds for the timeout value.

Return value

None

Events

oe_error

Description

Occurs when an error occurs during the function call. If the JavaScript function in the Cordova plugin returns any error, that error will be passed to the as_error parameter.

Syntax

oe_error ( string as_error )

Parameter

as_error - A JSON-format string which contains error information returned by the function.

Return value

None

oe_execjserror

Description

Occurs when there is a syntax error during the function call. However, this event cannot capture all of the errors.

Syntax

oe_execjserror ( string as_error )

Parameter

as_error - The error information of the last function call. It can also be obtained via of_getlasterror function.

Return value

None

oe_success

Description

Occurs when the function is successfully executed. If the JavaScript function in the Cordova plugin returns any value, that value will be passed to the as_message parameter.

Syntax

oe_success ( string as_message )

Parameter

as_message - A JSON-format string which contains values returned by the function.

Return value

None

Properties

oleobject ieon_ole

PowerBuilder OLEObject object to be connected with the Cordova plugin.

powerobject ipo_bindevent

PowerBuilder object to be bound with the JavaScript object.

string is_errorText

Stores the error information returned by the JavaScript function when execution failed.

string is_successText

Stores the value returned by the JavaScript function when execution is successful.

string is_jserrorText

Stores the JavaScript error information when the JavaScript function fails.

string is_successevent

Stores the success event name of the PowerBuilder object.

string is_errorevent

Stores the error event name of the PowerBuilder object.