-
FEATURED COMPONENTS
First time here? Check out the FAQ!
i am using this code. Which is working very good.
<window id="win" xmlns:w="http://www.zkoss.org/2005/zk/client" apply='MyComposer'>
<textbox value="@{$composer.student.name}"/>
But i want to use something like this
<cell width='$composer.fullWidth?"70%":"50%"'>
in my composer i have a boolean fullWidth with the proper getter but i cannot reference it with the composer i have try a lot but nothing seems to work please help me out...
I have try
<cell width='@{$composer.fullWidth}?"70%":"50%"'>
<cell width='{$composer.fullWidth}?"70%":"50%"'>
<cell width='@{composer.fullWidth}?"70%":"50%"'>
Please help me.
Another question if i have a code like this
<textbox id='test' if='expression'/>
How can i the or use the if using Java code?? Is not possible??
Something like
test.setIf(boolean???????)
Sorry if the question is simple thanks a lot and best regards from Venezuela.....
the '?:' operator should be part of the expression: please try this:
<cell width="${$composer.fullWidth ? '70%' : '50%'}">
or
<cell width="@{$composer.fullWidth ? '70%' : '50%'}">
The special if-attribute controls whether a component is created or not. If the condition is false the component is never created at all.
The equivalent in java would be:
//remove a component
test.detach();
//re-attach the component
test.setParent(parent);
//create a new component
Textbox test = new Textbox();
test.setId(test);
test.setParent(parent);
Asked: 2017-11-16 06:36:55 +0800
Seen: 6 times
Last updated: Nov 22 '17
wrong valueException come in front of modal popup [closed]
Use parameters in a conditional @command
Problems with multiple press and onCtrlKey
MVVM @save on the fly [closed]
Unable to activate destroyed desktop
org.zkoss.zk.ui.UiException: java.lang.ClassNotFoundException
How to put a image or Letter over image on a specific XY Coordinate