-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi All!
I'm creating a custom component that creates grid dynamically, but the row components should be defined in the zul (not exatly the way below, but similar)
Something like that...
<tableview id="tableView" paging="true" insertable="true" removable="true" var="xx"> <label value="@{xx.username}"/> <label value="@{xx.email}"/> </tableview>
It does not extend the grid, so I cannot (and don't want to) use the rows and the row element as child of the tableview...
I create the rows and row component dynamically for a grid in the background, but how to set the <row self="@{each=xx}"> equivalent from my code? Or is it imposibble what I imagine?
Thnx
George
Not impossible, I have done something similar for a listbox.
First you need a binder (AnnotateDataBinder) in the macro class (I supose you are using macros for this), and when binding use binder.addBinding(listitem, "_var", "xx") insted of binder.addBinding(listitem, "self", "each=xx"), it worked for me.
The rest of the binding expressions are similar to the ZUL expressions.
Thnx for the reply..
I tried it out, but it didn't work for grid... But I think there are lot of problems with grid (i.e, if I set the model from composer, the databinding doesn't work for the rows), so I'm thinking of using listbox instead of grid...
George
Asked: 2010-03-26 10:50:57 +0800
Seen: 353 times
Last updated: Mar 30 '10