2 Replies Latest reply on Apr 15, 2007 8:20 AM by tony.herstell1

    Form submit using javascript and how to send to a handler?

    tony.herstell1

      Given:

      <h:selectOneRadio id="advertType" required="true"
      value="#{advertisingCampaignController.campaign.advert.type}" onchange="doSubmit()">
       <s:selectItems value="#{advertisingCampaignController.campaign.advert.advertTypes}"
       var="advertType" label="#{messages[advertType.label]}" />
       <s:convertEnum />
      </h:selectOneRadio>
      


      I want to do a form sumbit on the change event to a handler (advertisingCampaignController.handleAdvertChoiceChange) so that I can re-display a page which will contain the updated model...

      This allows me to hide components I don't want displayed

      <s:fragment rendered="#{advertisingCampaignController.campaign.advert.type == advertisingCampaignController.campaign.advert.advertTypes[0]}">
      


      [0] maps to the first choice from the selectOneRadio as it maps to an enum.

      Anyon know who I can do this?



        • 1. Re: Form submit using javascript and how to send to a handle
          tony.herstell1

          As no one could aswer this I totally re-designed the site.
          Not its broken down into lots of steps so that that there are lots of button presses that allow me to configure the next step.
          Seems a real issue that you cant just force a page submit because I want to redisplaythe page.
          I suppose Ajax/IceFaces/etc. isthe answer for this though.

          • 2. Re: Form submit using javascript and how to send to a handle
            tony.herstell1

            I did at one point just add a button called "update" to force a page re-fresh.

            When in immediate=false mode did not pass back the changes I made to the radio buttons (seems sensible)

            When in immedaite=true mode caused problems with <s:convertEnum /> complaining that it could not convert an Enum to a string.

            I THINK this is a bug but I am not expert enough at Seam/JSF to really know..