-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi, It is possible to load, like example, load a value for background-color of a listcell?
listcell label="@bind(Item.descrizione)" style="'background-color: ' @load(Item.colore_appuntamento) ';'"
Thanks, Luca
Hello lramellavotta,
You could try it by setting a variable to your model class, and assigning to that variable the exact css you wish to apply.
For example:
Zul File:
<label style="@load(item.cssText)">Test CSS!!!</label>
Java Class:
Set the variable with the following css: "background-color: yellow;"
And it will work.
If you wish i can provide a full project sample.
Best Regards,
Darksu
Something like the following should do the trick:
<cell style="@load(bean.backgroundColor)">
where the getter getBackgroundColor() should return something like 'background-color: #fff'
Or better you may use a conditional change of color directly inside the zul. For example if the 'age' of the object is less than 20 then change the background to #FFCCCC else use the default:
<cell style="@load(bean.age lt 20 ? 'background-color: #FFCCCC;' : '')">
Hope that helps
Costas
Asked: 2014-11-16 16:56:09 +0800
Seen: 56 times
Last updated: Nov 17 '14
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