-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello Again!!
the title provided might confuse you a little bit, but let me clarify that.
let's say i have 4 files for which there is a need of the very same menu context(at least in the view point of it ).
So me trying to be smart thought that i would save time by putting the actual menu
in a separate file and include the file in each of the 4 files.
<zk xmlns="http://www.zkoss.org/2005/zul"> <menupopup id="accountContextMenu"> <menuitem id="sendMail" label="Send Mail" /> <menuitem id="sendSms" label="Send Sms" /> <menuitem id-"show" label="show" /> </menupopup> </zk>
that works well but very soon i realized that i lack the knowledge to control each of the menuitems
in every of the 4 GenericForwardComposers of the files which have the context menu included.
is there a way to make that possible? where in the have
onClick$sendMail(){}
in every GenericForwardComposer and depending on which composer, do specific operation in the method?
thank you reading this. and thank you very much in advance for the anwser.
no one? :(
I am not sure what you mean,
maybe you can refer here
Hey! thanks for responding.
I think that's what it it.will try and give feedbacks.
thanks again
Hello again,
here is what i've tried. i've changed the
GenericForwardComposer
GenericAutowireComposer
i've added an id to the include making it :
<include id="mn" src="accountmenu.zul" />
<menupopup id="accountContextMenu">
now case 1 where i tried this:
public void onClick$mn$accountContextMenu$sendMail{ ..
public void onClick$mn$sendMail() { ....
none of this worked.
case 2
i've added an onClick to the menuItem :
<menuitem id="sendMail" label="Send Mail" onClick="onSendMail()" />
onSendMail(){...}
What am i missing here? thanks
hey, the GenericForwardComposer inherits all methods from GenericAutowireComposer. i'm doing this like follows:
container.zul
<window id="container" use="myWindow"> <borderlayout> <north id="north"/> <east id="east"/> <west id="west"/> </borderlayout> </window>
in myWindow i'm controlling the loaded views like this:
LayoutRegian north; north.clearChilds(); Window win = Executions.createComponents("/accountmenu.zul" north, null )
public Window getNorth(){ return win; }
i have had the same problem, i've first done all with includes but that sucks.
its the same if u define an onClick-Event or did it like onChange$id(){}
in accountmenu.zul you have to apply your composer where the onChange$id is implemented
Asked: 2011-05-29 15:12:50 +0800
Seen: 385 times
Last updated: Jun 02 '11