2 Replies Latest reply on May 17, 2010 4:28 PM by Artur Friesen

    Form Not submitting correctly(?)

    Drew Arrigoni Newbie

      Okay, I have been struggling with this little bit of code for a while and I finally cracked the code. I have the following form:


                <h:form>
                     <p>Enter contact information below:</p>
                     <wyre:richInput id="firstName" value="#{contact.firstName}"
                          label="First Name" required="true" />
                     <wyre:richInput id="lastName" value="#{contact.lastName}"
                          label="Last Name" required="true" />
                     <s:button value="ADD"
                          action="#{mediaContactController.addNewContact}" />
                </h:form>
      



      Which doesn't work. It refreshes the page, invokes the action but does not actually update the values of the

      contact

      object.


      On the other hand,


                <h:form>
                     <p>Enter contact information below:</p>
                     <wyre:richInput id="firstName" value="#{contact.firstName}"
                          label="First Name" required="true" />
                     <wyre:richInput id="lastName" value="#{contact.lastName}"
                          label="Last Name" required="true" />
                     <h:commandButton value="ADD"
                          action="#{mediaContactController.addNewContact}" />
                </h:form>



      This works just fine.


      Why would h:commandButton work and s:button would not?