0

about set the tabbox context dynamic

asked 2009-12-13 01:34:12 +0800

dellsoft gravatar image dellsoft
114 2

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

delete flag offensive retag edit

6 Replies

Sort by ยป oldest newest

answered 2009-12-13 19:46:27 +0800

jimmyshiau gravatar image jimmyshiau
4921 5
http://www.zkoss.org/ ZK Team

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

link publish delete flag offensive edit

answered 2009-12-13 21:01:43 +0800

dellsoft gravatar image dellsoft
114 2

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 .

link publish delete flag offensive edit

answered 2009-12-14 07:54:56 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

I have tried to do it in java too and fails with 3.6.3

link publish delete flag offensive edit

answered 2009-12-14 19:47:19 +0800

jimmyshiau gravatar image jimmyshiau
4921 5
http://www.zkoss.org/ ZK Team

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);		
}

link publish delete flag offensive edit

answered 2009-12-14 19:55:05 +0800

dellsoft gravatar image dellsoft
114 2

thanks . now it is ok !

link publish delete flag offensive edit

answered 2009-12-15 04:33:36 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

Thanks Jimmy

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-12-13 01:34:12 +0800

Seen: 951 times

Last updated: Dec 15 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More