Logic in zkoss

asked 2021-08-01 00:12:26 +0800

brilianrn gravatar image brilianrn
5 1

Hi, everyone. Can I set logic in file .zul? Like I have any value and I set if a value is 0, then I just show empty textbox, but if a value is more than 0, I show that value in textbox. Can I set that logic in the file of .zul? Thank you..

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted

answered 2021-08-01 10:35:24 +0800

cor3000 gravatar image cor3000
6094 2 7
ZK Team

yes there are several ways to express logic you can:

use a ternary operator (?:) in EL expressions:

${someVariable eq 0 ? '' : someVariable}

use the special zuml attributes (if/unless) to render components conditionally:

<textbox if={someExpression}/>

with ZK EE and zuti.jar use shadow elements <if>/<switch> (since ZK 8)

<if test="${someExpression}">
link publish delete flag offensive edit

answered 2021-08-01 18:30:28 +0800

brilianrn gravatar image brilianrn
5 1

Thank you very much. Mine have been solved with this.

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

1 follower



Asked: 2021-08-01 00:12:26 +0800

Seen: 4 times

Last updated: Aug 01

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