-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi, i was try to use fulfill options on tabpanel, i get the response with info for panel, but he rendered empty. Can you say where is my error please :(
<p:tabbox> <p:tabs> <p:tab id="tab1" label="Tab 1"/> <p:tab id="tab2" label="Tab 2"/> </p:tabs> <p:tabpanels> <p:tabpanel>test 1 2 3</p:tabpanel> <p:tabpanel fulfill="tab2.onSelect" use="TabpanelDetail"/> </p:tabpanels> </p:tabbox> ----- TabpanelDetail.java ------ public class TabpanelDetail extends Tabpanel implements EventListener { public TabpanelDetail() { this.addEventListener("onFulfill", this); } public void onEvent(Event event) throws Exception { Tabpanels tpanels = (Tabpanels) event.getTarget().getParent(); Tabpanel tpanel = new Tabpanel(); tpanel.setParent(tpanels); Label label = new Label(); label.setValue("Test for second panel"); label.setParent(tpanel); } }
Create a Div(with fufill attribute) inside the Tabpanel instead of directly set fufill attribute to the Tabpanel.
Because tabs and tabpanels must keep in same amount, or there could be some trouble(out of spec behavior).
hm, but change of tab make request only first time, how can i pass proxing request and execute TabpanelDetail class on every select of tab2, how to invalidate fulfill operation ???
In that Div(you know who I mentioned), write some java code to add an onClick(or onSelect, I'm not very sure) listening method to your tabs in onCreate.
The Example code may like this:
<p:tabbox> <p:tabs> <p:tab id="tab1" label="Tab 1"/> <p:tab id="tab2" label="Tab 2"/> </p:tabs> <p:tabpanels> <p:tabpanel>test 1 2 3</p:tabpanel> <p:tabpanel> <p:div fufill="tab2.onSelect"> <p:attribute name="onCreate"> tab2.addEventListener("onSelect", new EventListener(){ public void onEvent(Event e) { Messagebox.show("hi! Here do your request!"); } }); </p:attribute> </p:div> </p:tabpanel> </p:tabpanels> </p:tabbox>
I doesn't test it, so it may not works, but the concept is correct.
hai,
try to use a component that zk already provide like use <tabbox>
<tabs>
<tab id="example" label="" />
<tab label="" />
</tabs>
<tabpanels>
<tabpanel fulfill="example.onSelect"></tabpanel>
<tabpanel></tabpanel>
</tabpanels>
</tabbox>
why you create with pain. zk framework try to help you to create RIA
Regards,
Andy Susanto
Asked: 2008-11-17 15:59:14 +0800
Seen: 1,346 times
Last updated: Nov 20 '08