Class Index | File Index

Classes


Namespace handle

The handle namespace provides an handler that encapsulates the basic functionality of a popup. This handle is an EventEmitter. So it is possible to register event listener on the popup. to listen to it's property value changes. A user can create custom property and emit events for it's value changes. This popup handle is basically created in the field editor and accessed in the popup with handle namespace.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
The 'handle' namespace
Field Summary
Field Attributes Field Name and Description
<static>  
handle.data
The initial value of the popup, which is null if the initial value is not set.
Method Summary
Method Attributes Method Name and Description
<static>  
handle.hide()
Hides the popup.
<static>  
handle.show()
Shows the popup created by the field editor.
Event Summary
Event Attributes Event Name and Description
<static>  
handle.popup-value-changed(pValue)
The popup-value-changed event is fired whenever the value of the popup is changed.
Namespace Detail
handle
The 'handle' namespace
The popup handle is created in the field editor like below:

var editor = Require['field-editor'];
var popupHandle = editor.createPopup("http://www.example.com", "initial-value"); // created the popup handle.
popupHandle.on("popup-value-changed", function(pValue){
  //Do something with the value when the value is changed.
});
popupHandle.show();// This will make the popup visible.

The handle is obtained in the popup like below:

window.onload = function (){
 popupHandle = require("handle");
};
initialValue=popupHandle.data //returns the initial value.
popupHandle.emit("popup-value-changed", pValue);
popupHandle.hide();
Field Detail
<static> handle.data
The initial value of the popup, which is null if the initial value is not set.
The data can be access by
var data = popupHandle.data;
Method Detail
<static> handle.hide()
Hides the popup.
The popup can be made hidden by simply calling:
popupHandle.hide();

<static> handle.show()
Shows the popup created by the field editor.
By following we can show the popup:
popupHandle.show();
Event Detail
<static> handle.popup-value-changed(pValue)
The popup-value-changed event is fired whenever the value of the popup is changed. The event name can be specified by the user.

The event is passed with an object of String type, Which is the value passed from the popup.

popupHandle.on("popup-value-changed", function (pValue) {
  // do something
});
Parameters:
{String} pValue
the string representation of the value of emitted from popup.

Documentation generated by JsDoc Toolkit 2.3.2 on Thu Apr 11 2019 16:00:43 GMT+0200 (CEST)