1 Reply Latest reply on Jul 10, 2008 6:59 PM by jfrankman

    inputText reRender fails on Partial page update

      I am trying to develop and page where a value is typed into field A, and on the blur event a service is called that updates field B via partial page update. I can get the blur event to trigger the correct method, and when I update a bean value the change is reflected in an outputText component, but if I use an inputText component the value is never updated. Here is my component that triggers the partial page update:


                                    

                     <s:decorate id="zipDecoration" template="layout/editm.xhtml">
                                                        <ui:define name="label"> ajax zip2</ui:define>
                                                        <h:inputText size="9" maxlength="9" id="zip"
                                                             value="#{rptphdmgbinderHome.instance.vehicleVin}"
                                                             valueChangeListener="#{rptphdmgbinderHome.verifyVIN}">
                                                             <a:support id="vinCheck" bypassUpdates="true" event="onblur"
                                                                  reRender="binderRemarksDecoration"
                                                                  ajaxSingle="true" />
                                                        </h:inputText>
                                                   </s:decorate>
      
      


      Here is the method on my bean that gets called on the onblur event:


           public void verifyVIN(ValueChangeEvent e)
           {
                EditableValueHolder binderRemarks =(EditableValueHolder) e.getComponent().findComponent(":rptphdmgbinder:binderRemarksDecoration:binderRemarks");
                binderRemarks.setValue("zzz");
                getInstance().setBinderRemarks("zzz");
           }



      Now, the method above is called, but the binderRemarks field on my form is not updated to 'zzz'. Similar experiements showed that if I used an outputText component instead of an inputText component the outputText component would be updated properly.


      Here is the inputText I am trying to have updated:


                                                   <s:decorate id="binderRemarksDecoration"
                                                        template="layout/edit.xhtml">
                                                        <ui:define name="label">Binder Remarks</ui:define>
                                                        <h:inputText id="binderRemarks" 
                                                             value="#{rptphdmgbinderHome.instance.binderRemarks}" />
                                                   </s:decorate>



      Can someone please give me an explanation as to why an inputText field will not get updated on a partial page update but an outputText component will?

        • 1. Re: inputText reRender fails on Partial page update

          I will answer my own question. By trial and error I was able to make the inputText update by including the 'setSubmittedValue' in my method:


          binderRemarks.setSubmittedValue("zzz");



          I do not know if this is the only setter that needs called or if you need to call the setValue() as well. In any case, that did the trick.