Julian, Thanks for the suggestion. I changed the type to reference a backing bean which I had caused to implement TabChangeListener, unfortunately the listener tag's type attribute is expecting a classname:
// snip
if (componentTag.getCreated())
{
//Component was just created, so we add the Listener
UIComponent component = componentTag.getComponentInstance();
if (component instanceof HtmlPanelTabbedPane)
{
String className;
if (UIComponentTag.isValueReference(type))
{
FacesContext facesContext =
FacesContext.getCurrentInstance();
ValueBinding valueBinding =
facesContext.getApplication().createValueBinding(type);
className = (String) valueBinding.getValue(facesContext);
} else
{
className = type;
}
TabChangeListener listener = (TabChangeListener)
ClassUtils.newInstance(className);
((HtmlPanelTabbedPane)
component).addTabChangeListener(listener);
} else
{
throw new JspException("Component " + component.getId() + " is
no HtmlPanelTabbedPane");
}
}
// end snip
accordingly a reference to a backing bean instance will not resolve to a proper
String classname and will cause a class cast exception.
The source code does make it clear that it is correct to place the
tabChangeListener as a child of the HtmlPanelTabbedPane so I think that the
problem is somewhere else.
Does anyone have an input as to why no tab change event is fired in 1.1.1?
Thanks for the suggestion.
James
-----Original Message-----
From: Julian Ray [mailto:[EMAIL PROTECTED]
Sent: Thu 6/8/2006 12:38 PM
To: 'MyFaces Discussion'
Subject: RE: panelTabbedPane question
try using a value binding for the tabChangeListener handler eg.
<x:tabChangeListener type="#{myBackingBean}">
_____
From: James Richards [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 08, 2006 12:30 PM
To: [email protected]
Subject: panelTabbedPane question
I have a tabbed pane with a tabChangeListener attached
<h:form id="dealForm">
<x:panelTabbedPane id="dealTabbedPane"
selectedIndex="#{dealForm.activeTab}"
bgcolor="#eeeeee"
width="980"
activeTabStyleClass="tabActive"
inactiveTabStyleClass="tabActive"
serverSideTabSwitch="true">
<x:tabChangeListener type="com.foo.listener.TabListener"/>
...
</h:form>
but on MyFaces 1.1.1, the TabListener's
public void processTabChange(TabChangeEvent event) {
//...
}
is not being invoked. Is there something additional that need to be done to
enable the tab listener?
Thanks for any help,
James
<<winmail.dat>>

