-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi, I have my macro component with some children:
<window id="win" apply="com.class.Composer"> <myCustomComponent> <button forward="onClick=onDoSomethingInComposer" /> </myCustomComponent> </window>
How to push event up to the window component?
I've tried setting parent window composer for myCustomComponent in afterComposer() method
getDefinition().setApply("${self}");
Javadoc for setApply method is not very helpful anyway :-[
Sets the apply attribute that is is a list of Composer class or EL expressions returning classes, class names or composer instances. Parameters: apply the attribute this is a list of Composer class or EL expressions El expressions are allowed, but self means the parent, if available; or page, if no parent at all. (Note: the component is not created yet when the apply attribute is evaluated).
It seems that you did, what I couldn't do: Macros with inner-HTML or rather a wrapper-macro.
I think you can't do this. I tried a simple macro and it didn't work.
If you use a normal macro in this way:
<window id="win" apply="com.class.Composer"> <myCustomComponent> <button forward="onClick=onDoSomethingInComposer" /> </myCustomComponent> </window>
then anything in the myCustomComponent.zul will be ignored.
If you use inline="true" instead, ONLY the content of the myCustomComponent.zul will be created and anything between your opneing-macro tag and the closing-macro-text is ignored.
To your question - propagate events from macro component:
It depends on how your macro looks like. If you use inline="true", no macro-component will be created, but instead the CONTENT is "written". Therefore you can use an inline-macro as a child component of portalchildren f.e..
And if you don't create any additional ID space owners within your macro, you don't have to apply an additional composer.
A regular macro component is an ID space owner, so you have to cross this border to propagate the event.
My question is exactly how to cross this border and propagate event up the idspace tree!
My custom components are in separate jar as one taglib with definitions in lang-addon.xml and you cannot specify inline attribute in lang-addon.xml :(
Asked: 2009-10-01 07:58:27 +0800
Seen: 359 times
Last updated: Oct 05 '09