Thank you. I tried to define a prompt like this
importPackage(org.apache.pivot.wtk.SheetStateListener);
function sheetClosed(s){
//do something
}
This is not working because the Prompt doesn't have a
setSheetCloseListener() method. It has an open method take the owner window
and sheetCloseListener as parameters.
I want to avoid using the java class extends Windows and leave things in the
bxml. So I tried to do somewhere along the lines like this
importPackage(org.apache.pivot.wtk);
importClass(java.lang.System);
function buttonPressed(button) {
prompt1.open(button.getWindow(), new
SheetStateListener.Adapter(){
function sheetClosed(s){
}
});
}
Here the prompt already delcared in a include bxml tag prior to this point.
I got java script EvaluationException: invalid property id (#9).............
Alternatively, I tried to create a the listener in the define tag like
importPackage(org.apache.pivot.wtk.SheetStateListener);
importClass(java.lang.System);
function sheetClosed(s){
System.out.println("Sheet Closed");
}
and later in the java script call open like
prompt1.open(button.getWindow(), closeListener);
There was no error message when the prompt was open or closed. However, the
sheetClosed didn't get executed. At least the Sheet Closed wasn't printed on
the console screen at all. Is there any solution for setting the window
close listener ? All I needed actually just to capture yes or no of the
response and process based on the response from the end user. Prompt
listener's selectedOptionChanged method did work but even when the pivot was
first initiated, the value was set to ok by default will trigger the method
too.
Sam
--
View this message in context:
http://apache-pivot-users.399431.n3.nabble.com/Alert-opened-and-the-rest-of-code-keep-going-tp2841188p2843213.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.