-
FEATURED COMPONENTS
First time here? Check out the FAQ!
i am trying to show a modal window.
i have created a window programmaticaly
Window win = new Window("Details", "1", true); win.setId("BECY"); Grid grid = new Grid(); Columns columns = new Columns(); Rows rows = new Rows(); for (MonthlyCurrencyResult<ServiceTypes> monthlyCurrencyResult : data) { Column column = new Column(monthlyCurrencyResult.getMonth()); columns.appendChild(column); Row row = new Row(); row.appendChild(new Label(monthlyCurrencyResult.getValue().toString())); rows.appendChild(row); } grid.appendChild(columns); grid.appendChild(rows); win.appendChild(grid); return win;
and sending this window via a parameter to a zul file where i want to do something like:
<zk xmlns="http://www.zkoss.org/2005/zul" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:w="http://www.zkoss.org/2005/zk/client"> <window border="none"> <caption style="padding-right: 5px;"> <image src="/images/icons/information_16x16.png" width="18px" height="18px" style="cursor:pointer;"> <attribute name="onClick"><![CDATA[ import org.zkoss.zul.Window; Window win = arg.get("paramDetailsWindow"); win.doModal(); ]]></attribute> </image> </caption> </window>
But i kep getting Null Pointer in Method Invocation.
And i know about Window wing = (Window) Executions.createComponents("",null,""). but i cant create new zul file becose i would have more then 50 files.
Please help.
@mihael, you do realize your grid is going to have an every increasing number of columns in it because of the first 2 lines in your for loop, don't you? I don't think this is what you want. I don't know if you're wanting to put the values for every month on 1 row or the value for each month on a separate row. If it's the former, you need to quit creating a new Row in the loop. If it's the latter you need to quit creating columns inside the loop and just add a couple before the loop.
HI Arsen
The uper code shows a method that returns the window that has to be show when i click on a details button. But to answer you question :
Map params = new HashMap(); params.put("paramData", monthlyExpensesResult); params.put("paramDetailsWindow", genereteBECYDetailsWindow(monthlyExpensesResult)); Window win = (Window) Executions.createComponents("/window/bookkeeping/multi_series_column_3d_chart.zul", null, params); win.setTitle(title); win.setStyle("color: white;"); return win;
win.doModal();
Asked: 2011-05-12 07:49:47 +0800
Seen: 442 times
Last updated: May 13 '11