-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I'm usign ZK 5.0 and i want to build a grid with dynamic columns and dynamic data. I have a pojo called Page, this has a List<PageRow> fmember and every PageRow has a List<PageField> fields member. I have a zul page with a grid and in his controller class i set the model in this way:
Page page = mycode...return...
ListModelList model = new ListModelList(page.getPageRows());
mygrid.setModel(model);
in zul page i have:
<grid id="mygrid">
<rows>
<row self="@{each=item}" value="@{item}">
<custom-attributes campi="@{item.fields}" composite="list"/>
<label value="@{each}" forEach="@{campi}" ></label>
</row>
</rows>
But i have a resulting grid with all the rows but only a column with no value inside. Where i'm wrong?
It's possible draw this grid with zul page mixin with java code in controller, or i must create the grid programmatically only in java code??
Hi as1225, could you give me some advice on this grid question: I need to create a grid to display objects that have the following attributes (String typeOfExpense, Date payDate, Integer amount, String Details).
The grid should have a first column TypeOfExpense (string) and then as many columns (dates) as the user defines in two variables (startDate and endDate). Then each row would have a first element typeOfExpense combobox and then the following row elements would be the objects specified above. So, the object's amount attribute should displayed in the intersection of typeOfExpense and date. Additionally, the user should be able to add new rows to the grid to create new expense objects. That is, pressing an add button the user should be able to create a new row and select the typeOfExpense from the combo in the first element of the row and then select a cell from certain column (which have a date between start and end). This cell should be auto-wired to some textbox, datebox, intbox and textbox so that the user can input values and then have the amount displayed on the grid after pressing a save button.
Too messy? Hope I have been clear enough, but the idea is having a grid that dynamically creates the number of columns needed according to the date values start and end, and then presenting the expense objects where the type of expense and date match the object's values. The additional difficulty is that the user must be able to add new rows and have the cells wired to some components to input the new values of the expense object.
I'll leave a small sketch:
TypeOfExpense: Gas
PayDate: Apr/24/11
Amount: 250
Details: Some detail of the expense
Many thanks,
eduk79
Hi eduk79, please post your question as a NEW thread.
Hi everyone,
I had a problem to load tree nodes dynamically. Following is my requirement,
[-] continents
Asia
Africa
North & South America
Europe
Australia
While i click the "Asia", their Countries will be added to Asia as a child node. While click the child country node, their Cities will be added to Country as a child node.
Please help,
Thanks in advance
Hi Prabakaran,
You can use TreeModel.
Hello, I tried the example with the code that jimmyshiau suggested
MyComposer.java
index.zul
items.zul
columns.zul,
but that example just complete the first column with data (ITEM1, ITEM.....) , I am trying to complete all the table with data but I got problems.
My objective is complete the table with a query each time that a press a button, I could with appendChild but without I have the problem that " jimmyshiau " mention:
"because the grid will redraw again when the row call appendChild
we use Executions.createComponents("items.zul", row, params) and forEach
it will prepare a zul page and just need to attach one time"
Asked: 2010-02-09 08:33:38 +0800
Seen: 10,702 times
Last updated: Nov 15 '12