-
FEATURED COMPONENTS
First time here? Check out the FAQ!
when i create a menupop dynamic with id tabMenu
then i set the tabbox context use
tabbox.setContext(tabMenu) in this way ,it does not work
Hi,
I try this Demo
<zk> <menupopup id="editPopup"> <menuitem label="Undo"/> <menuitem label="Redo"/> <menu label="Sort"> <menupopup> <menuitem label="Sort by Name" autocheck="true"/> <menuitem label="Sort by Date" autocheck="true"/> </menupopup> </menu> </menupopup> <label value="Right Click Me!" context="editPopup"/> <tabbox width="250px" context='editPopup'> <tabs> <tab label="Tab 1" closable="true"/> <tab label="Tab 2" closable="true"/> <tab label="Tab 3" closable="true"/> <tab label="Tab 4" closable="true"/> <tab label="Tab 5" closable="true"/> </tabs> <tabpanels > <tabpanel>This is panel 1</tabpanel> <tabpanel>This is panel 2 The second panel</tabpanel> <tabpanel>This is panel 3</tabpanel> <tabpanel>This is panel 4</tabpanel> <tabpanel>This is panel 5</tabpanel> </tabpanels> </tabbox> </zk>
it is works well
yes this way is ok !
1) A way not work
i just create menupopoup in my composer(dynamic)
and then add this menupopup in my tabbox ,in this way ,it does not work
2)B way is ok!
but if i add a menupopup in my zul with no menuitem ,then in my composer ,i get this menupopup then dynamic add mentitem ,this way is also ok .
I have tried to do it in java too and fails with 3.6.3
ok,I found where the problem is,
you must give the menupopup a parent in this zul
because it not exist this zul page if you not set a parent for it
it works like this sample
@Override public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); Menupopup menupopup = new Menupopup(); menupopup.appendChild(new Menuitem("A")); menupopup.appendChild(new Menuitem("B")); menupopup.setParent(comp); tabbox.setContext(menupopup); }
Thanks Jimmy
Asked: 2009-12-13 01:34:12 +0800
Seen: 951 times
Last updated: Dec 15 '09