Lets rock:
// first menu simple:
class BaseInputDelegate extends Ui.BehaviorDelegate {
function onMenu() {
var menu = new Ui.Menu();
menu.setTitle("Step one");
menu.addItem( "select 1", :p1 );
menu.addItem( "select 2", :p2 );
Ui.pushView( menu, new MenuInput(), SLIDE_LEFT );
}
}
//second delegate store previous select and play another:
class MenuInput extends Ui.MenuInputDelegate {
function onMenuItem(item) {
if (item.... bla bla // store select one to global variable
var mm = new Ui.Menu();
mm.setTitle("Step two");
mm.addItem( "select 1", :p1 );
mm.addItem( "select 2", :p2 );
Ui.popView(SLIDE_LEFT); // [2]
Ui.pushView( mm, new m1MenuInput(), SLIDE_LEFT );
return true; //we take HANDLE -> I need pernamently close menu 'Step one' before any option or back <- but this not work, menu always back!
// I try set in [2] " Ui.popView(SLIDE_LEFT); " <- this helpfull
}
}
class m1MenuInput extends Ui.MenuInputDelegate {
function onMenuItem(item) {
if (item.... bla bla // store select one to global variable
var mm = new Ui.Menu();
mm.setTitle("Step three");
mm.addItem( "select 1", :p1 );
mm.addItem( "select 2", :p2 );
Ui.popView(SLIDE_LEFT);
Ui.pushView( mm, new m2MenuInput(), SLIDE_LEFT );
return true;
}
}
class m2MenuInput extends Ui.MenuInputDelegate {
function onMenuItem(item) {
if (item.... bla bla // store select one to global variable
var mm = new Ui.Menu();
mm.setTitle("Step four");
mm.addItem( "select 1", :p1 );
mm.addItem( "select 2", :p2 );
Ui.popView(SLIDE_LEFT);
Ui.pushView( mm, new m3MenuInput(), SLIDE_LEFT );
return true;
}
}
.... other pages od wizard
Put this code to widget and try play menu 10-15 times to crash but not IQ! exception but whole system.