Changing second menu

4 messages - 903 views

I replace come internal widget on the sceen and I would like to change secondMenu depengin on what witget is loaded.

then doing

Widget w  = Test.getDefault().getCanvas().getDesktop().getWidget("secondMenu");

w.cleanUp();
w.removeAll();
Kuix.loadXml(w,Kuix.getXmlResourceInputStream("/xml/f_m.xml"), null);

doesn't remove or change menu, it only add new items.

would it be deter to set new dataprovider and use one menu?

is it possible to add same dataprovider to several not dependent widgets?

or how to change dataprovider?

I have tryed with setDataProvider(), the data doesn't change.

does any specific method need to be called?

 

1. You can retrieve the secondMenu instance directly like this : myScreen.getSecondMenu();

2. If your menu is flat (no submenu), you could use dataProvider as you can use it in list with the <_items> attribute. Then you don't change the dataProvider, but it's content.

oh, that was nice work arround,

Hi,

how to changing second menu? I also need to do it. Can BigNude detailed instructions?