Popup has the following events associated with it:
An event callback invoked by the platform when show method of popup is called for first time after its construction. This is called only once in a lifetime of the popup between creation and destruction. This method is also called when destroyed popup is shown again. Popups can be destroyed using destroy method.
Syntax
addWidgets()
Read/Write
Write only
Example
//Defining properties for a Popup with addWidgets:addWidgetsCallBck var popBasic ={id:"popUp", title:"PopUP",skin:"popSkin", headers:[box1,box2], footers:[box3,box4], isModal:true, transparencyBehindThePopup:100, addWidgets:addWidgetsCallBck}; var popLayout ={containerWeight:100, padding:[5,5,5,5]}; var popPSP ={};
//Creating the Popup. var popUp=new kony.ui.Popup(popBasic, popLayout, popPSP);
Platform Availability
Available on all platforms
This event gets called only once in popup life cycle that is when the popup is ready with its widget hierarchy. This will get called after addwidgets method allowing user for any one-time initializations.
When popup is destroyed and reused again, init gets called as a part of popup lifecycle.
Syntax
init()
Read/Write
Read + Write
Example
//The below function is the callback function for init event. function initCallBck(popup) { //Write your logic here } //Defining properties for a Popup with init:initCallBck. var popBasic ={id:"popUp", title:"PopUP", skin:"popSkin", headers:[box1,box2], footers:[box3,box4], isModal:true, transparencyBehindThePopup:100, init:initCallBck}; var popLayout ={containerWeight:100, padding:[5,5,5,5]}; var popPSP ={};
//Creating the Popup. var popUp=new kony.ui.Popup(popBasic, popLayout, popPSP);
Platform Availability
Available on all platforms
Specifies an Event which is triggered when a popup goes out of view.
Syntax
onHide()
Read/Write
Read + Write
Remarks
This event is triggered in the following scenarios:
This event is not triggered in the following scenarios:
Example
function onHideCallBck(popup) { //Write your logic here } //Defining properties for a Popup with onHide:onHideCallBck. var popBasic ={id:"popUp", title:"PopUP", skin:"popSkin", headers:[box1,box2], footers:[box3,box4], isModal:true, transparencyBehindThePopup:100, onHide:onHideCallBck}; var popLayout ={containerWeight:100,padding:[5,5,5,5]}; var popPSP ={}; //Creating the Popup. var popUp=new kony.ui.Popup(popBasic, popLayout, popPSP);
Platform Availability
Available on all platforms.
Specifies an event which is triggered when the user uses the back button on the device.
For more information see Event Editor in the Kony Visualizer User Guide.
Synax
onDeviceBack(popupref)
Read/Write
Read + Write
Example
//The below function is the callback function for onDeviceBack event. function onDeviceBackCallBck(popup) { //Write your logic here } //Defining properties for a Popup with onDeviceBack:onDeviceBackCallBck var popBasic ={id:"popUp", title:"PopUP", skin:"popSkin", headers:[box1,box2], footers:[box3,box4], isModal:true, transparencyBehindThePopup:100, onHide:onHideCallBck}; var popLayout ={containerWeight:100,padding:[5,5,5,5]}; var popPSP ={onDeviceBack:onDeviceBackCallBck}; //Creating the Popup. var popUp=new kony.ui.Popup(popBasic, popLayout, popPSP);
Platform Availability
Specifies an event which is triggered when the popup is destroyed.
For more information see Event Editor in the Visualizer User Guide.
Signature
JavaScript: onDestroy
Lua: ondestroy
Read / Write
Yes - (Read and Write)
Example
//The below function is the callback function for onDestroy event. function onDestroyCallBck(popup) { //Write your logic here } //Defining properties for a Popup with onDestroy:onDestroyCallBck var popBasic ={id:"popUp", title:"PopUP", skin:"popSkin", headers:[box1,box2], footers:[box3,box4], isModal:true, transparencyBehindThePopup:100, onHide:onHideCallBck}; var popLayout ={containerWeight:100,padding:[5,5,5,5]}; var popPSP ={onDestroy:onDestroyCallBck}; //Creating the Popup. var popUp=new kony.ui.Popup(popBasic, popLayout, popPSP);
Platform Availability
This property is available on iPhone/iPad only.
Specifies the name of function to be executed when a popup is loaded. The function must exist in a JavaScript file under project>module>js folder.
Syntax
onLoadJS
Read/Write
Read + Write
Example
//The below function is the callback function for onLoadJS event function onLoadJSCallBck(popup) { //Write your logic here } //Defining properties for a Popup with onLoadJS:onLoadJSCallBck var popBasic ={id:"popUp", title:"PopUP", skin:"popSkin", headers:[box1,box2], footers:[box3,box4], isModal:true, transparencyBehindThePopup:100, onHide:onHideCallBck}; var popLayout ={containerWeight:100, padding:[5,5,5,5]}; var popPSP ={onLoadJS:onLoadJSCallBck}; //Creating the Popup. var popUp=new kony.ui.Popup(popBasic, popLayout, popPSP); //Reading the onLoadJS of the popUp alert("popUp onLoadJS::"+popUp.onLoadJS);
Availability
Available in the IDE
Available on Server side Mobile Web (BJS and Advanced) platform
Specifies the name of function to be executed when a popup is unloaded. The function must exist in a JavaScript file under project>module>js folder.
Syntax
unLoadJS
Read/Write
Read + Write
Example
//The below function is the callback function for unLoadJS event function unLoadJSCallBck(popup) { //Write your logic here } //Defining properties for a Popup with unLoadJS:unLoadJSCallBck var popBasic ={id:"popUp", title:"PopUP", skin:"popSkin", headers:[box1,box2], footers:[box3,box4], isModal:true, transparencyBehindThePopup:100, onHide:onHideCallBck}; var popLayout ={containerWeight:100,padding:[5,5,5,5]}; var popPSP ={unLoadJS:unLoadJSCallBck};
//Creating the Popup. var popUp=new kony.ui.Popup(popBasic, popLayout, popPSP); //Reading the unLoadJS of the popUp alert("popUp unLoadJS::"+popUp.unLoadJS);
Availability
Available in the IDE
Available on Server side Mobile Web (Advanced) platform
prem | Copyright © 2012 Kony, Inc. All rights reserved. |
prem | Copyright © 2012 Kony, Inc. All rights reserved. |