3 Replies Latest reply on Nov 19, 2008 3:55 AM by ilya_shaikovsky

    Updating Bean without Submit

      I have a couple different controls, an h:selectOneMenu and an h:selectOneRadio, that I would like to update the values in the bean they're bound to, without submitting (and forcing a refresh of) the whole form. Using the valueChangeListener attribute, even with immediate set to "true" doesn't accomplish this (like I would have thought it should). How should I go about this? I'm using Seam and RichFaces on JBoss AS.

        • 1. Re: Updating Bean without Submit
          ilya_shaikovsky

          I suggest you using supports nested to your inputs? then just use ajaxSingle=true on them in order to process just concrete inputs. And in this case immediate not need to be used.

          • 2. Re: Updating Bean without Submit

            Thanks for your quick response. That worked great for the selectOneMenu, but I'm still having problems with the selectOneRadio, however, since it's in a rich:dataTable. I have the onclick event handler hooked up to the following javascript:

            function radioButton( radio )
             {
             var id = radio.name.substring(radio.name.lastIndexOf(':'));
             var el = radio.form.elements;
             for( var i = 0; i < el.length; i++ )
             {
             if( el.name.substring(el.name.lastIndexOf(':')) == id )
             {
             el.checked = false;
             }
             }
             radio.checked = true;
             }


            I tried the following in my xhtml file: what should be different?

             <h:selectOneRadio onclick="radioButton(this);"
             valueChangeListener="#{manager.setSelected}"
             styleClass="radioButton">
             <f:selectItem itemValue="#{obj.id}"/>
             <a4j:support event="onchange" ajaxSingle="true" reRender="table"/>
             </h:selectOneRadio>
            


            • 3. Re: Updating Bean without Submit
              ilya_shaikovsky

              could you please send me simple sample directly? I'll try to correct it on my side and then post you my results..