-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi all.
I've the following code:
<?component name="allDocsList" macroURI="/wf_pages/docList/docListGrid.zul"?> <zk> <zscript> Composer comp = new MyComposer(); </zscript> <window> <allDocList apply="${comp}"/> </window> </zk>
What do I do wrong? The composer is not called at all. Instead of ${comp} you could write everything and get no error. Try with ${duffyduck}.
Only a hint.
Hope i'm not wrong.
As i heard today the: <?component name .... ?> tag is only reading/parsing if it's in a zul file under the <?page ... ?> tag, because it's belonged to a Page definition.
I did some investigation. I tried to install the zul editor eclipse plugin, and I noticed that the code autocompletion feature do not completes my code if the apply is inside a macro tag component. On the other side, it works if I try to assign my composer to non macro components. For example:
<?component name="allDocsList" macroURI="/wf_pages/docList/docListGrid.zul"?> <zk> <zscript> Composer comp = new MyComposer(); </zscript> <window apply="${comp}"> <!-- THIS WORKS --> <allDocList apply="${comp}"/> <!-- THIS IS TOTALLY IGNORED --> </window> </zk>
Is this a bug, or this is the (in my opinion wrong) behaviour by design?
Is there a way I can workaround the issue? (I need to choose dinamically the composer).
Thanks,
Massimiliano
Ok, since it seems the problem is with the macro component, I tried to following approach.
File 1:
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c" ?> <?page title="Document List" contentType="text/html;charset=UTF-8"?> <?component name="myMacro" macroURI="/wf_pages/docList/docListGrid.zul"?> <zk> <window border="normal" > <myMacro /> </window>
File 2 (MACRO DEFINITION):
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c" ?> <?page title="Document List" contentType="text/html;charset=UTF-8"?> <zk > <zscript > <![CDATA[ Composer comp = new MyComposer(); ]]> </zscript> <window apply="${ comp }"> <textbox /> </window>
As you can notice, I moved the zscript code inside the macro definition, so that the apply is 'applied' to a ZK native widget (window).
With this approach, the ZUL Editor autocomplete feature works (it lists the comp variable). However, at runtime it do not works (the composer do not gets called).
Could someone there tell me if this is a bug, it is like that by design or something else?
@ziccardi
zul editor tried best to mimic the behavior of zk, but sometimes the spec of zk changes,
and zul editor may not modify as fast.
the composer do not gets called, should be another bug of zk of implementation of macro component.
Please post to bug in sourceforge.
Asked: 2010-03-12 10:54:23 +0800
Seen: 334 times
Last updated: Mar 18 '10