So, I have a dataTable that looks like this:
<h:form>
<h:dataTable value="#{backingBean.employeeLineItems}" var="emp">
<h:column>
<f:facet name="header">First</f:facet>
#{emp.lastname}
</h:column>
<h:column>
<f:facet name="header">Last</f:facet>
#{emp.firstname}
</h:column>
<h:column>
<f:facet name="header">Actions</f:facet>
<h:commandButton value="View Details">
<f:ajax execute="#{setCurrentEmployeeId(emp.id)}" render="employeeDetails"/>
</h:commandButton>
</h:column>
</h:dataTable>
<h:outputText value="#{backingBean.employeeDetails}" id="employeeDetails"/>
</h:form>
For each row of the datatable, there is a button that I want to, when clicked, ajax the employeeLineItem id value over to a method that sets that id in the backing bean, and then renders the outputText tag with id "employeeDetails" (The getEmployeeDetails method would use the employeeLineItem id to get the right employee details object from the database, of course)
My solution doesn't seem to be working, does anyone know what I'm doing wrong?