Hi there,
I tried to inject a Seam session bean into panelTabListener, but I always got null value. The code is follows:
@Name("tabListenerImpl") @Stateless public class TabListenerImpl implements TabChangeListener { @In (create=true, required=true) @Out (required=false) private ProjectFinder projectFinder; public void processTabChange(TabChangeEvent e) throws AbortProcessingException { int index = e.getNewTabIndex(); if (index == 0) projectFinder.find(); } }
<ice:panelTabSet selectedIndex="0" styleClass="myTab"> <ice:panelTab id="tab1" label="Project"> <ice:panelGroup id="Panel1"> <f:subview id="re1"> <ui:include src="/projects.xhtml" /> </f:subview> </ice:panelGroup> </ice:panelTab> <ice:panelTab id="tab2" label="Tab 2"> <ice:panelGroup id="Panel2"> <f:subview id="re2"> <h:outputText value="Tab 2" /> </f:subview> </ice:panelGroup> </ice:panelTab> <ice:tabChangeListener type="icefaces.TabListenerImpl"/> </ice:panelTabSet>