2 Replies Latest reply on Oct 4, 2007 10:22 AM by terryb

    Form reset button in Seam

    terryb

      I can't seem to get form Reset button working, to empty out text typed in search fields. It does nothing when clicked. I use default Seam mechanism to perform search, ie EntityList...EntityHome...

      Do I must have a backing bean action method to somehow make it work?

      <div class="actionButtons">
      <h:commandButton id="search" value="Search" action="/OrganisationUserList.xhtml"/>
      <h:commandButton value="Reset" type="reset"/>
      <s:button view="/OrganisationUserEdit.xhtml" id="create" value="Create User">
      <f:param name="organisationUserId"/>
      </s:button>
      </div>
      


        • 1. Re: Form reset button in Seam

          No you don't need a backing bean since no server round-trip is made when using a reset button. Are the search field and the reset button under the same form tag?

          • 2. Re: Form reset button in Seam
            terryb

            Yes they are under the same form, the only form on the page. Please see code below.

            <h:form id="organisationUser">
             <div>
             <h:panelGrid columns="2" rowClasses="prop" columnClasses="name,value" border="0" >
             <h:outputLabel for="username">Username</h:outputLabel>
             <h:inputText id="username"
             value="#{organisationUserList.organisationUser.username}"/>
             ...
             </h:panelGrid>
            
             <table>
             <tr class="prop">
             <td class="name"> </td>^
             <td class="value">
             <div class="actionButtons">
             <h:commandButton id="search" value="Search" action="/OrganisationUserList.xhtml"/>
             <h:commandButton value="Reset" type="reset"/>
             <s:button view="/OrganisationUserEdit.xhtml" id="create" value="Create User">
             <f:param name="organisationUserId"/>
             </s:button>
             </div>
             </td>
             </tr>
             </table>
             </div>
            </h:form>