5 Replies Latest reply on Jul 13, 2007 11:09 AM by Thomas Wellen

    commandLink/commandButtton do not invoke action listener

    Thomas Wellen Newbie

      I would like to update the values of the following check boxes in the database by using a form as shown below.

      <h:form id="category_form">
       <h:dataTable value="#{categoryFinder.categories}"
       border="1" var="category"
       rendered="#{not empty categoryFinder.categories}">
       <f:facet name="header">Category</f:facet>#{category[0]}
       <f:facet name="header">Assigned</f:facet>
       <h:selectBooleanCheckbox id="categoryList" disabled="false"
       value="#{category[1] > 0}" />
       <f:facet name="header">Preferred</f:facet>
       <h:selectBooleanCheckbox id="PreferredList" disabled="false"
       value="#{category[2] == 1}" />
       <h:commandButton id="savecategory" value="Save"
       action="#{categoryFinder.updateCategory}" />

      When I click the submit button, the page is rerendered and and the altered check boxes are saved. But the action listener categoryFinder.updateCategory is not invoked - which means no database update has been taken place.

      public class categoryFinderBean implements Serializable, CategoryFinderInterface
       private EntityManager entityManager;
       private List categories;
       private String id;
       public void initCategories()
       //This is a native query which uses a JOIN on several tables
       String nativeQuery = "SELECT name, assigned, preferred FROM [...]";
       this.categories = entityManager.createNativeQuery(nativeQuery).getResultList();
       } catch (NoResultException e)
       // ignore
       public void updateCategory()
       public void destroy()

      I tried to stick to the examples in the Seam documentation. Is there any suitable reason why this happens? I've been looking for a solution the wohle day now :(