-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have a window like:
<window id="camp" border="0" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('com.app.viewModel.cpp.MainCpp')"
>
<grid>
<rows>
<row>
<include src="/com.app.web.menu/north.zul" />
</row>
</rows>
</grid>
.
.
.
</window>
And i need spicify a width to the Window, but i need the width depending of a number in my model.
public class MainCpp {
int num = mmDAO.getnum();
//Getter and Setter
//Some Methods
.
.
.
}
Then i need the width = "num px"
of my window camp;
When my view is open,
How can i do it?
String getNumPx(int num){
String snum = num + "px";
return snum;
}
Try: width="@load(vm.numPx)"
here an example showing how to load the width from a view model, and (optionally) receive onAfterSize events to update the value in the view model after a user or the browser resized the window.
http://zkfiddle.org/sample/2fupcmv/1-load-window-width
feel free to update the example in order to demonstrate what you really need.
What you have tried so far ? Use @Bind
with width
attribute
Asked: 2013-11-25 21:40:17 +0800
Seen: 44 times
Last updated: Mar 27 '17
Editable interface to add users
Problem binding values to a composite component
How can i load a constant in .zul
[Ugent please] connect Web service .net view in grid group ZK
Dirty state for forms with collection properties
ZK drang and drop and databinding [closed]