0

problem with filfull on Tabpanel

asked 2008-11-17 15:59:14 +0800

speko gravatar image speko
15 1

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);
   }

}

delete flag offensive retag edit

6 Replies

Sort by ยป oldest newest

answered 2008-11-18 06:26:10 +0800

iantsai gravatar image iantsai
2755 1

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).

link publish delete flag offensive edit

answered 2008-11-18 08:26:37 +0800

speko gravatar image speko
15 1

YES :) now it's working, thanks

link publish delete flag offensive edit

answered 2008-11-18 08:50:41 +0800

speko gravatar image speko
15 1

updated 2008-11-18 10:20:43 +0800

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 ???

link publish delete flag offensive edit

answered 2008-11-20 01:12:47 +0800

iantsai gravatar image iantsai
2755 1

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.

link publish delete flag offensive edit

answered 2008-11-20 16:05:18 +0800

ibsolution gravatar image ibsolution
468 1 1 6

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

link publish delete flag offensive edit

answered 2008-11-20 16:54:13 +0800

speko gravatar image speko
15 1

to a little complicated but really works thanks again :)

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2008-11-17 15:59:14 +0800

Seen: 1,346 times

Last updated: Nov 20 '08

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More