ICEfaces
  1. ICEfaces
  2. ICE-10745

valueChangeListener firing by another ice component partialSubmit

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: EE-3.3.0.GA_P03
    • Fix Version/s: EE-3.3.0.GA_P04
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      jsf 2 icefaces 3.3 compat

      Description

      see the attached sample application. When compat components are on the same form and both have partialSubmit="true", the valueChangeListener is firing when it is not the capturing component.
      In the example:
                <ice:selectOneMenu id="menu1" value="#{testBean.menuValue}"
                       valueChangeListener="#{testBean.valueChangeMethod}"
                       partialSubmit="true">
                      <f:selectItem itemLabel="Value 1" itemValue="1"/>
                      <f:selectItem itemLabel="Value 2" itemValue="2"/>
                      <f:selectItem itemLabel="Value 3" itemValue="3"/>
                  </ice:selectOneMenu>

                  <ice:selectBooleanCheckbox id="chk1" value="#{testBean.radioBool}" partialSubmit="true">
                      
                  </ice:selectBooleanCheckbox>
      ...
      are in the same form. On initial page load, the submit of the checkbox will fire the valueChangeListener of the selectOneMenu (and it should not).
      The customer is stating that this is happening quite often for them (the test case, it only happens on page load), but hopefully fixing this test case will also fix the customer's issue.

        Activity

        Hide
        Mircea Toma added a comment - - edited

        The valueChangeListener is invoked because the selected value on the server is null which is not equal to the value of "1" sent by the partial submit. When ice:selectOneMenu's validator runs it detect the difference and queues a value change event.

        To fix this the TestBean constructor should initialise the selected value to match the one selected by default in the browser:

            public TestBean(){
            	list.add(new Item("name1", true, "1"));
            	list.add(new Item("name2", false, "2"));
            	list.add(new Item("name3", true, "3"));
                //initialise selection
                menuValue = "1";
            	PushRenderer.addCurrentView("GROUP1");
            }
        
        Show
        Mircea Toma added a comment - - edited The valueChangeListener is invoked because the selected value on the server is null which is not equal to the value of "1" sent by the partial submit. When ice:selectOneMenu 's validator runs it detect the difference and queues a value change event. To fix this the TestBean constructor should initialise the selected value to match the one selected by default in the browser: public TestBean(){ list.add( new Item( "name1" , true , "1" )); list.add( new Item( "name2" , false , "2" )); list.add( new Item( "name3" , true , "3" )); //initialise selection menuValue = "1" ; PushRenderer.addCurrentView( "GROUP1" ); }

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Judy Guglielmin
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: