7 Replies Latest reply on Jul 28, 2008 10:13 AM by dbountsman

    bypassUpdates false vs. true

    dbountsman

      Hi all,

      I have following problem: in my form (I use Seam + richfaces + a4j) there are several selectOneMenus and input fields. These depend on each other; i.e. these selectOneMenus and the inputs have the same bean properties for value binding (always 1 selectOneMenu and 1 input text). The selectOneMenus are "ajaxed" thanks a4j support component. To search via inputs there is a a4j command button (type button with bypassUpdate = "true"). Both, the search with inputs and selections in selectOneMenus work fine. The problems start when I try to mix the calls. I perform a search with inputs + the a4j button and then change the value of the selectOneMenu(s) which was found by the inputs + button search. On the server side (in Java) I see that the value which is bind to the inputs changes and I set the inputs to rerender. On the client (in browser IE and FF) the inputs are rerendered, but with the old value. The Getters are not called. Someone knows what's the problem?

      thanks

        • 1. Re: bypassUpdates false vs. true
          ilya_shaikovsky

          bypassUpdates = true - means that the model values will not be updated (all the activities after validation phase will be skipped). It's designed only for validation purposes.

          • 2. Re: bypassUpdates false vs. true
            dbountsman

            Well, as there are inputs I'd like to valid them. But my problem isn't that model values are not updated. As I wrote, it works fine as long as I perform searches only via the command button. Are there a known problems (and workarounds ) when mixing bypassupdate true (for some components) and bypassupdate false (for the other components)? It looks like the components (inputs in my case) loose the value binding.

            thanks

            • 3. Re: bypassUpdates false vs. true
              ilya_shaikovsky

              ok.. lets start from code snippets with explanation when your page which contains the result of these snippets starts works wrong..

              • 4. Re: bypassUpdates false vs. true
                dbountsman

                input part

                <a4j:region>
                 <span jsfc="h:outputText">
                 <input id="txtDatECode1" name="txtDatECode1" jsfc="h:inputText" maxlength="2" styleClass="input_txt_car_data txtDatECode1" value="#{ModelPage.vehicle.vehicleTypeNumber}"/>
                 <input id="txtDatECode2" name="txtDatECode2" jsfc="h:inputText" maxlength="3" styleClass="input_txt_car_data txtDatECode2" value="#{ModelPage.vehicle.manufacturerNumber}" />
                 <input id="txtDatECode3" name="txtDatECode3" jsfc="h:inputText" maxlength="3" styleClass="input_txt_car_data txtDatECode3" value="#{ModelPage.vehicle.maintypeNumber}" />
                 <input id="txtDatECode4" name="txtDatECode4" jsfc="h:inputText" maxlength="3" styleClass="input_txt_car_data txtDatECode4" value="#{ModelPage.vehicle.subtypeNumber}" />
                 <input id="txtDatECode5" name="txtDatECode5" jsfc="h:inputText" maxlength="4" styleClass="input_txt_car_data txtDatECode5" value="#{ModelPage.vehicle.subtypeVariantNumber}"/>
                 </span>
                 <input jsfc="a4j:commandButton" styleClass="btn_search button_border button_design" id="btnDatECodeSearch" alt="Eingabetaste" bypassUpdates="true"
                 actionListener="#{ModelPage.processECode}" type="button"/>
                </a4j:region>
                
                



                select part

                
                 <select jsfc="h:SelectOneMenu" replaced="false" arrowButtonClass="cbo_btn_dark"
                 id="cboVehicleType"
                 value="#{ModelPage.vehicle.vehicleTypeNumber}"
                 style="width: 435px;" width="429px" listWidth="411px">
                 <s:SelectItems
                 value="#{ModelPage.vehicleTypes}" var="vehicleType"
                 label="#{vehicleType.hhfaBenn}"
                 itemValue="#{vehicleType.id.hhfaFza}"
                 noSelectionLabel="Please Select..." />
                 <a4j:support ajaxSingle="true" event="onchange"
                 bypassUpdates="false" focus="cboManufacturer" actionListener="#{ModelPage.process}"/>
                 </select>
                 <select jsfc="h:SelectOneMenu" replaced="false" arrowButtonClass="cbo_btn_dark" id="cboManufacturer"
                 value="#{ModelPage.vehicle.manufacturerNumber}" style="width: 435px;" width="429px"
                 listWidth="411px">
                 <s:SelectItems
                 value="#{ModelPage.manufacturers}" var="manufacturer"
                 label="#{manufacturer.hhstBenn}"
                 itemValue="#{manufacturer.id.hhstHst}"
                 noSelectionLabel="Please Select..." />
                 <a4j:support ajaxSingle="true" event="onchange"
                 bypassUpdates="false" focus="cboBaseModel" actionListener="#{ModelPage.process}"/>
                 </select>
                 <select jsfc="h:SelectOneMenu" replaced="false" arrowButtonClass="cbo_btn_dark" id="cboBaseModel"
                 enableManualInput="false" value="#{ModelPage.vehicle.maintypeNumber}"
                 style="width: 435px;" width="429px" listWidth="411px">
                 <s:SelectItems
                 value="#{ModelPage.maintypes}" var="maintype"
                 label="#{maintype.hthtBenn}" itemValue="#{maintype.id.hthtHt}"
                 noSelectionLabel="Please Select..." />
                 <a4j:support ajaxSingle="true" event="onchange"
                 bypassUpdates="false" focus="cboSubModel" actionListener="#{ModelPage.process}"/>
                 </select>
                 <select jsfc="h:SelectOneMenu" replaced="false" arrowButtonClass="cbo_btn_dark" id="cboSubModel"
                 value="#{ModelPage.vehicle.subtypeNumber}" enableManualInput="false"
                 style="width: 435px;" width="429px" listWidth="411px">
                 <s:SelectItems
                 value="#{ModelPage.subtypes}" var="subtype"
                 label="#{subtype.htutBenn}" itemValue="#{subtype.id.htutUt}"
                 noSelectionLabel="Please Select..." />
                 <a4j:support ajaxSingle="true" event="onchange"
                 bypassUpdates="false" focus="cboEngine" actionListener="#{ModelPage.process}"/>
                 </select>
                


                • 5. Re: bypassUpdates false vs. true
                  dbountsman

                  The "input part" alone works, i.e. fill the inputs then click the button - the selects are actualized with correct values.

                  The select part alone works, i.e. on change the inputs are actualized with correct values.

                  It stops to work when first the input part is performed and then the select part. i.e. the inputs aren't actualized.

                  • 6. Re: bypassUpdates false vs. true
                    ilya_shaikovsky

                    wrap the selects part with a4j:region also.

                    • 7. Re: bypassUpdates false vs. true
                      dbountsman

                      doesn't help.