[confuse] How to detect panelTabChange event?
[Logo]
ICEsoft.org Forums: ICEfaces, ICEmobile, ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icesoft.org  [Login] Login 
[confuse] How to detect panelTabChange event?  XML
Forum Index -> Components
Author Message
jameskhoo

Joined: 30/06/2006 00:00:00
Messages: 39
Offline


Hi all

It's me again...so sorry to trouble you guys..
Assuming I have one ice:form with many panelTabSets, and I would like to detect panelTabChange events for two particular PanelTabSet only, say panelTabSet A, and B, is that possible?

Looking at the component-showcase example , I can't see a way on "binding" a TabChangeListner to each individual PanelTabSet in my JSP page..any one like to elighthen me?

A example will be appreciated, thanks

Cheers
James Khoo
philip.breau


Joined: 08/05/2006 00:00:00
Messages: 2701
Offline


Hi James,

Don't worry, the more questions the better:) Yes, you just have to implement a TabChangeListener like so...

public class PanelTabSetAListener implements TabChangeListener{

private PanelTabSet tabSet;
private int currentTabIndex;

public PanelTabSet getTabSet(){ return tabSet; }
public void setTabSet(PanelTabSet tabs){ tabSet = tabs; }

public void processTabChange(TabChangeEvent tabChangeEvent){
this.currentTabIndex = tabChangeEvent.getNewTabIndex();
}

}

then, you can bind your tab listener like so...assuming you've set up PanelTabAListener as a managed bean with the name "panelTabSetA"...

<ice:panelTabSet binding="#{panelTabSetA}"...
<ice:panelTab id="tab1" label="Tab 1">
<ice:panelGroup ...
</ice:panelTab>
</ice:panelTabSet>

Hope that helps.
Thanks,
Philip

.
dinobhai

Joined: 29/11/2006 00:00:00
Messages: 117
Offline


Thanks got it working
 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team