1 2 Previous Next 21 Replies Latest reply on Oct 16, 2009 6:55 AM by vidda Go to original post
      • 15. Re: inplaceSelect does not display the bean property value

         

        "ilya_shaikovsky" wrote:
        you could use onviewactivated currently instead of onchange.


        But it have two problems. One with unnecessary ajax request when view is activated but value hasn't changed.

        And another one with ajax request when no value is selected (for example, with defaultLabel 'Please click to select') and view is activated. In this situation the ajax request contains 'no value' for this element, and when jsf cycle goes to set this 'no value' on data.indicator1, it throws an IllegalArgumentException for data.indicator1.

        The last problem it's the worst for me :(. I will wait until feature on RF-7079 be finished.

        • 16. Re: inplaceSelect does not display the bean property value
          ilya_shaikovsky

          we could try to build workaround using onsubmit :)

          and thanks for the report.
          https://jira.jboss.org/jira/browse/RF-7986

          • 17. Re: inplaceSelect does not display the bean property value

            Workaround to avoid the second problem? :) But, how will be it? I am not sure how to do it. I tried to do:

            <a4j:support event="onviewactivation"
             onsubmit="if ( #{data.indicator1 == ' '} ) return false;"
            


            but condition is wrong (I don't know how to catch the situation when no item is selected and view is activated). And I also tried to always return false on onsubmit (onsubmit="return false;"), but ajax request will be sent anyway :(.


            And too I don't know to workaround the first problem (only send request if value has changed).



            My code complete:

             <rich:inplaceSelect id="som_f_i1"
             value="#{data.indicator1}"
             showValueInView="true">
             <a4j:support id="rsp_som_f_1" event="onchange"
             ajaxSingle="true"
             reRender="rop_er_d, dfe_i1">
             <a4j:actionparam id="rap_som_f_i1" name="justaparam"
             value="#{rowNumber}"
             assignTo="#{recordDetailRowAdaptor.fieldRecordDetailRowNumber}" />
             </a4j:support>
             <s:selectItems
             value="#{fieldInformation[data.tag].getInfoForChild('I1').possibleValues}"
             var="option"
             label="#{option.value} - #{option.description}"
             itemValue="#{option.value}"
             />
             </h:inplaceSelect>
            


            You can see that I don't need to call an action, only need to reRender other components.



            Thanks :)

            • 18. Re: inplaceSelect does not display the bean property value
              ilya_shaikovsky

               

               <h:form>
               <a4j:jsFunction name="callSubmit"></a4j:jsFunction>
               <rich:inplaceSelect value="#{inplaceComponentsBean.inputValue}" onviewactivated="if (event.memo.oldValue!=event.memo.value) callSubmit();"
               defaultLabel="Click here to edit" id="inplacesel">
               <f:selectItem itemValue="0" itemLabel="Option 1" />
               <f:selectItem itemValue="1" itemLabel="Option 2" />
               <f:selectItem itemValue="2" itemLabel="Option 3" />
               <f:selectItem itemValue="3" itemLabel="Option 4" />
               <f:selectItem itemValue="4" itemLabel="Option 5" />
              
               </rich:inplaceSelect>
               </h:form>
              


              calls submit only if selection changed.

              • 19. Re: inplaceSelect does not display the bean property value

                Thanks ilya_shaikovsky :).

                But 'event.memo.oldValue' and 'event.memo.value' are Richfaces javascript variables that are updating itself on every event?

                I suppose not and 'event.memo.oldValue' and 'event.memo.value' are javascript variables that I have to manage in code.

                • 20. Re: inplaceSelect does not display the bean property value
                  ilya_shaikovsky

                  no, them are managed by the component. It stores values there and passes to handlers.

                  • 21. Re: inplaceSelect does not display the bean property value

                    Ok, so fine :). Thanks again :D.

                    1 2 Previous Next