ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

Tablelayout - How I can create it programattcally

abimael
20 Dec 2008 22:01:46 GMT
20 Dec 2008 22:01:46 GMT

Hi ..
I want to create a TableLayout in java code , but I could not find the API for it. And I do not know how can I do it , I mean, use the table layout programmatically.
Please, can someone give me a clue here ?
Thanks

mjablonskiTop Contributor
20 Dec 2008 22:35:53 GMT
20 Dec 2008 22:35:53 GMT

Translating ZUL to Java is straightforward and follows always the same pattern: Create component => attach it to a parent etc.pp.

Panelchildren panelChildren = new Panelchildren();
panelChildren.appendChild(new Label("Test"));

Panel panel = new Panel();
panel.setTitle("Test");
panel.setBorder("normal");
panel.appendChild(panelChildren);

Tablechildren tableChildren = new Tablechildren();
tableChildren.appendChild(panel);

Tablelayout tableLayout = new Tablelayout();
tableLayout.appendChild(tableChildren);

Cheers, Maik

abimael
21 Dec 2008 11:17:56 GMT
21 Dec 2008 11:17:56 GMT

Thanks Maik..
I agree with you : it is straightforward.
However, in this case, I have 2 problems :
1) where is the Tablelayout? I mean, which is the package should I need to import ?
import org.zkoss.zul.??? In the example that you provided and I had tried to use, I could not find the package to import and I got "non-compiled" code for the TableChildren and Tablelayout. As I wrote in my first message, I tried to find in the Api, but I could not .
2) I want to use the tablelayout in a window. Usually, I set the parent to the panel , but in the example you provided, I do not see (or I did not figure) if I should the window as parent to the Tablelayout object too .
Thanks by your comments

abimael
21 Dec 2008 11:18:29 GMT
21 Dec 2008 11:18:29 GMT

Thanks Maik..
I agree with you : it is straightforward.
However, in this case, I have 2 problems :
1) where is the Tablelayout? I mean, which is the package should I need to import ?
import org.zkoss.zul.??? In the example that you provided and I had tried to use, I could not find the package to import and I got "non-compiled" code for the TableChildren and Tablelayout. As I wrote in my first message, I tried to find in the Api, but I could not .
2) I want to use the tablelayout in a window. Usually, I set the parent to the panel , but in the example you provided, I do not see (or I did not figure) if I should the window as parent to the Tablelayout object too .
Thanks by your comments