Revision history [back]

click to hide/show revision 1
initial version

answered 2017-06-26 01:59:38 +0800

cor3000 gravatar image cor3000

ZK Team

you can use one of ZK's core methods (new, new1, new2, new3): https://www.zkoss.org/wiki/ZUML%20Reference/EL%20Expressions/Core%20Methods

using a string class name: http://www.zkoss.org/dsp/web/core" prefix="c"?> <zk> ... <component property="@load(c:new2('my.pkg.CustomObject', parm1, parm2))"/>

using the class directly:

<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<?import my.pkg.CustomObject?>
<zk>
...
    <component property="@load(c:new2(CustomObject, parm1, parm2))" />

or if you have a static factory method (e.g. called newInstance) you can call it directly (since ZK 8):

<?import my.pkg.CustomObject?>
<zk>
...
    <component property="@load(CustomObject.newInstance(parm1, parm2))" />

I hope this helps, if not let me know.

Robert

you can use one of ZK's core methods (new, new1, new2, new3): https://www.zkoss.org/wiki/ZUML%20Reference/EL%20Expressions/Core%20Methods

using a string class name: http://www.zkoss.org/dsp/web/core" name:

<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
 <zk>
 ...
     <component property="@load(c:new2('my.pkg.CustomObject', parm1, parm2))"/>

parm2))" />

using the class directly:

<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<?import my.pkg.CustomObject?>
<zk>
...
    <component property="@load(c:new2(CustomObject, parm1, parm2))" />

or if you have a static factory method (e.g. called newInstance) you can call it directly (since ZK 8):

<?import my.pkg.CustomObject?>
<zk>
...
    <component property="@load(CustomObject.newInstance(parm1, parm2))" />

I hope this helps, if not let me know.

Robert

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