1

Zk how use a ternary operator setting width using composer

asked 2016-04-27 15:44:07 +0800

javiut gravatar image javiut flag of Venezuela, Bolivarian Republic of
90 1 5

i am using composer with my view in the composer i have a method which returns a simple boolean by a condition i want to set the width of a component by that condition how can i do it?

i am trying with something like this with no success

<listheader width='${composer.works}?15%:13%'>

But treats it as a string literal is this possible? i know there is much options of setting width but this one really intrigue me. thanks a lot sorry by my poor english.

delete flag offensive retag edit

Comments

Width="${composer.works?'15%':'13%'}"

chillworld ( 2016-04-27 22:18:29 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-04-27 21:08:44 +0800

Darksu gravatar image Darksu
1991 1 4

Hello javiut,

You can check out the following:

https://www.zkoss.org/wiki/ZKDeveloper'sReference/UIComposing/ZUML/ELExpressions

But i would rather create a string variable and set it's value in the controller based on the boolean value as shown below:

http://www.cafeaulait.org/course/week2/43.html

Best Regards,

Darksu

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
1 follower

RSS

Stats

Asked: 2016-04-27 15:44:07 +0800

Seen: 27 times

Last updated: Apr 27 '16

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