1 Reply Latest reply on Dec 18, 2006 12:59 PM by Gavin King

    problem with s:button, s:link and action

    Vitaly Masterov Newbie

      I try to use s:button with action attribute and i use EntityHome class: xml-declarations kinds in components.xml:

      <factory name="myEntity" value="#{myEntityHome.instance}"/>
       <fwk:entity-home name="myEntityHome"
       entity-class="com.mycompany.MyEntity"
       entity-manager="#{entityManager}"/>
      

      With s:button action-attribute i assign following:
      <s:button action="#{myEntityHome.persist}" view="/myPage.xhtml" value="Create" />
      Also I have following form:
       <s:validateAll>
       <div>
       <table>
       <tr>
       <td><h:outputLabel value="#{messages['common.name']}"/></td>
       <td><s:decorate><h:inputText value="#{myEntity.name}"/></s:decorate></td>
       </tr>
       <tr>
       <td><h:outputLabel value="#{messages['common.description']}"/></td>
       <td><h:inputText value="#{myEntity.description}"/></td>
       </tr>
       </table>
       </div>
       </s:validateAll>
      

      But I get entity with empty fields in my database, when I click on the button.
      All works well, if I use <h:commandButton ... />