1 Reply Latest reply on Feb 10, 2009 1:56 PM by waltc

    Single text field form requires enter in text field prior to action

    waltc
      I have the following form in an xhtml:

      |    <h:form id="upddocumentFind" styleClass="edit">

              <rich:simpleTogglePanel label="Upddocument Find Action" switchType="ajax">

                  <s:decorate template="layout/display.xhtml">
                      <ui:define name="label">doc id</ui:define>
                      <h:inputText id="upddocumentDocumentDocId" value="#{resubmitter.docid}"/>
                  </s:decorate>


              </rich:simpleTogglePanel>

              <div class="actionButtons">
                  <s:button id="find" value="Find" action="#{resubmitter.find()}"/>
                  <s:button id="reset" value="Reset" includePageParams="false"/>
              </div>

          </h:form>
      |

      In the resubmitter object I have a setter and getter for the docid object which is defined as a String.

      If I enter a value in the text field and tab to the action button or simply click on find the setter gets driven with a "" string and the action method fails because the field value never gets set. If, however, I click enter before leaving the field and then select find the field get populated and the find method works.

      I have been working on this for days and can not determine why that value is not being picked up. This is actually the same problem as I was attempting to get advice on previous but didn't realize if I hit enter while still in the text field it populated the attribute.

      Thanks,

      Walt Corey
        • 1. Re: Single text field form requires enter in text field prior to action
          waltc

          For those that might stumble over this the answer is because s:button does not do a submit of the form. For that you need to use h:commandButton which, according to page 109 of Dan great book, Seam in Action, is an s:button, except it doesn'
          t submit form data. DOH!


          I guess this is the problem with coming into Seam without a really strong background in Struts or JSF, a little subtleties tacked onto the end of a sentence like that went right over my head. But now I know. And, if you didn't already know it, now you do too.


          Walt