I have problems with invoking commandLink action in dataTable.
<h:body>
<h:dataTable value="#{manageStaffAccountBean.accounts}" var="staff">
<h:column>
#{staff.surname}
</h:column>
<h:column>
<h:form>
<h:commandButton value="Change status"
action="#{manageStaffAccountBean.changeActivity(staff)}" />
</h:form>
</h:column>
</h:dataTable>
</h:body>
By click on "Change status" i need to invoke changeActivity()
method in bean
Managed Bean code:
@Named
@Scope("request")
public class ManageStaffAccountBean implements Serializable {
private List<Staff> accounts = null;
public String changeActivity(Staff staff){
System.out.println(staff.getId());
return "manageStaffAccounts";
}
public void updateAccountsList(){
accounts = staffService.findAll();
}
// ...
}
However, it is not invoked. Can you help me to find the problem?