I'm trying to pass the logical TabView object from the XHTML into the Java method when the button is clicked. However, I haven't figured out how to properly reference it. Passing "constraintTabViewWidget results in a null object. And I haven't figured out how to use the ID's to reference the object either.
The XHTML code:
Code: Select all
<h:form id="MC">
<p:tabView id="AccordionID" widgetVar="constraintTabViewWidget">
<p:tab disabled="false" title="#{label.setupConstraints}">
<ui:include src="ConstraintSetup.xhtml">
<ui:param name="requiredCheck" value="true"/>
</ui:include>
</p:tab>
<p:tab disabled="false" title="#{label.constraintProdWeeks}" id="pw">
<ui:include src="ConstraintProductionWeeksSetup.xhtml">
<ui:param name="requiredCheck" value="true"/>
</ui:include>
</p:tab>
</p:tabView>
<div class="section actionButtons">
<h:panelGroup id="saveMC">
<h:commandLink action="#{constraintController.nextTab(constraintTabViewWidget)}" value="Next" immediate="true"
class="cancelButton actionButtons button"/>
</h:panelGroup>
</div>
</h:form>
Code: Select all
public void nextTab(TabView view)
{
System.out.println("NEXT TAB PLEASE" + view.getActiveIndex());
logger.info("fdsajkfajf;lsajkl" + view.getActiveIndex());
}