Trouble using commandLink in dataTable
slammajamma Jun 18, 2013 6:42 PMI am having some trouble getting a method of a bean to fire with in a dataTable that is nested within a popupPanel. The dataTable populates as is should, includeing the commandLinks. The problem comes up when I click on one of the command links. It act as if it is submitting the wrong form. The popup dissapears and the method never happens.
At this point the method the link is pointing at is very simple, because I am jsut trying to get someting to work. Once I solve the issue, I would like to pass that method "i" so that it can be processed.
I am very new to all of this, so if I am doing something backwards I am very open to chaning implementation.
Thanks in advance!
<ui:define name="content">
<h:form id="outterForm">
<h:commandButton value="Select Customer">
<rich:componentControl target="popup" operation="show" />
</h:commandButton>
</h:form>
<rich:popupPanel id="popup" modal="false" autosized="false" resizeable="true" width="700" height="700">
<f:facet name="header">
<h:outputText value="Select your customer" />
</f:facet>
<f:facet name="controls">
<h:outputLink value="#" onclick="#{rich:component('popup')}.hide();
return false;">
X
</h:outputLink>
</f:facet>
<h:panelGrid columns="3">
<h:form>
<h:outputText value="Company Name:" />
<h:inputText value="#{temp.tempString}" />
<a4j:commandButton value="Search" render="out" execute="@form" />
</h:form>
</h:panelGrid>
<br />
<a4j:outputPanel id="out">
<h:dataTable value="#{dbController.findCustomer(temp.tempString)}" var="i" rendered="#{not empty temp.tempString}" styleClass="order-table"
headerClass="order-table-header"
rowClasses="order-table-odd-row,order-table-even-row">
<h:column >
<f:facet name="header">ShopWorks Customer Number</f:facet>
#{i.idCustomer}
</h:column>
<h:column>
<f:facet name="header">Company</f:facet>
#{i.company}
</h:column>
<h:column>
<f:facet name="header">Select</f:facet>
<h:form>
<h:commandLink value="Select" action="#{dbController.test()}" />
</h:form>
</h:column>
</h:dataTable>
</a4j:outputPanel>
</rich:popupPanel>
Bean code :
public String test(){
System.out.println("test");
return "#";
}