0

Java programming way to pass value to zul?

asked 2019-10-01 09:58:53 +0800

cor3000 gravatar image cor3000
6280 2 7

daquan198163 asked:

Beside the zul bind mode, is there a java programing way to pass value to the customized component?

<state-box state="@init(each)"
  icon="@init(each.type)
        @converter('org.zkoss.admin.converter.TypeIconConverter')"
  color="@init(each.type)
         @converter('org.zkoss.admin.converter.TypeColorConverter')"/>
delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-10-01 09:59:28 +0800

cor3000 gravatar image cor3000
6280 2 7

state-box isn't a full component, it's more a shortcut to the shadow element <apply> usage:

<apply templateURI="/WEB-INF/template/stateBox.zul" state="@init(...)" ...>

What it does is inserting a specific zul file, handing over parameters. The same can be done from Java code (which ZK does in many cases even without shadow elements), by calling one of the Executions.createComponents(...)-methods.

An alternative of working with templates in MVC are ShadowTemplate and CollectionTemplate.

link publish delete flag offensive edit
Your answer
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
3 followers

RSS

Stats

Asked: 2019-10-01 09:58:53 +0800

Seen: 14 times

Last updated: Oct 01 '19

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