ICEfaces
  1. ICEfaces
  2. ICE-5632

ValueChangeListener gets called twice when clicking on label for selectOneRadio

    Details

      Description

      The ValueChangeListener is called twice when clicking on the selectOneRadio components label and standardRequestScope=true.

      It is called only once when clicking on the actual button. Also if using the ICEfaces extending request scope or session scope the listener is always called once.
      1. screenshot-01.png
        173 kB
      2. screenshot-02.png
        180 kB

        Issue Links

          Activity

          Arran Mccullough created issue -
          Arran Mccullough made changes -
          Field Original Value New Value
          Salesforce Case [5007000000As6qc]
          Arran Mccullough made changes -
          Attachment Case9082Example.war [ 12300 ]
          Arran Mccullough made changes -
          Attachment Case9082Example.zip [ 12301 ]
          Ken Fyten made changes -
          Fix Version/s 1.8.2-EE-GA_P02 [ 10226 ]
          Ken Fyten made changes -
          Assignee Priority P1
          Assignee Mark Collette [ mark.collette ]
          Ken Fyten made changes -
          Link This issue is duplicated by ICE-6108 [ ICE-6108 ]
          Ken Fyten made changes -
          Assignee Mark Collette [ mark.collette ] Ted Goddard [ ted.goddard ]
          Hide
          Ted Goddard added a comment -

          This does not appear to be a framework issue. The following HTML example also displays two "click" alerts:
          <html>
          <body>
          <fieldset onclick="alert('click');">

          <input type="radio" id="coke" value="Coke" />
          <label for="coke">coke</label>

          <input id="sprite" type="radio" value="Sprite" />
          <label for="sprite">sprite</label>

          </fieldset>
          </body>
          </html>

          If the onclick handler is applied to each label, however a single alert is displayed, so it may be desirable to modify the component renderer to apply the onclick attribute in this way.

          Show
          Ted Goddard added a comment - This does not appear to be a framework issue. The following HTML example also displays two "click" alerts: <html> <body> <fieldset onclick="alert('click');"> <input type="radio" id="coke" value="Coke" /> <label for="coke">coke</label> <input id="sprite" type="radio" value="Sprite" /> <label for="sprite">sprite</label> </fieldset> </body> </html> If the onclick handler is applied to each label, however a single alert is displayed, so it may be desirable to modify the component renderer to apply the onclick attribute in this way.
          Hide
          Ted Goddard added a comment -

          onmouseup seems to behave as expected. onchange does not appear to be fired for the fieldset.

          The recommendation is to change partialSubmit behavior for selectOneRadio to be triggered by onmouseup.

          There is a comment above that the behavior is affected by the scope of the bean; this is likely a result of how two very rapid events affect the application – the root cause is that essentially duplicate events are generated by the browser for fieldset onclick.

          Show
          Ted Goddard added a comment - onmouseup seems to behave as expected. onchange does not appear to be fired for the fieldset. The recommendation is to change partialSubmit behavior for selectOneRadio to be triggered by onmouseup. There is a comment above that the behavior is affected by the scope of the bean; this is likely a result of how two very rapid events affect the application – the root cause is that essentially duplicate events are generated by the browser for fieldset onclick.
          Hide
          Ted Goddard added a comment -

          Assigning to Ken to assign to component team if the partialSubmit trigger for selectOneRadio is to be changed.

          Show
          Ted Goddard added a comment - Assigning to Ken to assign to component team if the partialSubmit trigger for selectOneRadio is to be changed.
          Ted Goddard made changes -
          Assignee Ted Goddard [ ted.goddard ] Ken Fyten [ ken.fyten ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #23029 Thu Nov 04 10:20:33 MDT 2010 yip.ng ICE-5632: ValueChangeListener gets called twice when clicking on label for selectOneRadio.
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/HtmlSelectOneRadio.java
          Ken Fyten made changes -
          Fix Version/s 2.0.0 [ 10230 ]
          Fix Version/s 1.8.3 [ 10211 ]
          Assignee Ken Fyten [ ken.fyten ] Yip Ng [ yip.ng ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #23031 Thu Nov 04 10:31:06 MDT 2010 yip.ng ICE-5632: ValueChangeListener gets called twice when clicking on label for selectOneRadio.
          Files Changed
          Commit graph MODIFY /icefaces2/trunk/icefaces/compat/components/src/main/java/com/icesoft/faces/component/ext/HtmlSelectOneRadio.java
          yip.ng made changes -
          Attachment screenshot-01.png [ 12651 ]
          Attachment screenshot-02.png [ 12652 ]
          Hide
          yip.ng added a comment -

          Changed onclick to onmouseup as suggested. See screenshots 1 and 2 for before and after change.

          Revision: 23029


          Modified : /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/HtmlSelectOneRadio.java

          Revision: 23031


          Modified : /icefaces2/trunk/icefaces/compat/components/src/main/java/com/icesoft/faces/component/ext/HtmlSelectOneRadio.java

          Show
          yip.ng added a comment - Changed onclick to onmouseup as suggested. See screenshots 1 and 2 for before and after change. Revision: 23029 Modified : /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/HtmlSelectOneRadio.java Revision: 23031 Modified : /icefaces2/trunk/icefaces/compat/components/src/main/java/com/icesoft/faces/component/ext/HtmlSelectOneRadio.java
          yip.ng made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Ken Fyten added a comment - - edited

          This change seems related to a new regression failure:

          New Failures:
          ICE-751 load the application (problem reproducible on component-showcase selection page, selection is Menubar, selection in Media, selection in datapaginator, selection in splitpanel, selection in stackingPanel etc )
          select a fruit- apple (selection is not displayed)
          Now select another fruit -orange (apple is displayed instead of orange)

          Show
          Ken Fyten added a comment - - edited This change seems related to a new regression failure: New Failures: ICE-751 load the application (problem reproducible on component-showcase selection page, selection is Menubar, selection in Media, selection in datapaginator, selection in splitpanel, selection in stackingPanel etc ) select a fruit- apple (selection is not displayed) Now select another fruit -orange (apple is displayed instead of orange)
          Ken Fyten made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Hide
          Mark Collette added a comment -

          With the component-showcase / Table / Row selection example, when you click between modes, it takes two clicks to register. The first click does a submit, but the ice.event.target is not always set, although ice.event.captured is properly set. And the value for the radio is the previous value.

          From the MSDN reference for mouse events, it says the onmouseup happens before onclick, so perhaps onclick has the actual value change.

          Show
          Mark Collette added a comment - With the component-showcase / Table / Row selection example, when you click between modes, it takes two clicks to register. The first click does a submit, but the ice.event.target is not always set, although ice.event.captured is properly set. And the value for the radio is the previous value. From the MSDN reference for mouse events, it says the onmouseup happens before onclick, so perhaps onclick has the actual value change.
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #23052 Mon Nov 08 13:56:41 MST 2010 yip.ng ICE-5632: ValueChangeListener gets called twice when clicking on label for selectOneRadio.
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/renderkit/dom_html_basic/SelectManyCheckboxListRenderer.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/renderkit/dom_html_basic/RadioRenderer.java
          Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/HtmlSelectOneRadio.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #23053 Mon Nov 08 13:58:20 MST 2010 yip.ng ICE-5632: ValueChangeListener gets called twice when clicking on label for selectOneRadio.
          Files Changed
          Commit graph MODIFY /icefaces2/trunk/icefaces/compat/core/src/main/java/com/icesoft/faces/renderkit/dom_html_basic/RadioRenderer.java
          Commit graph MODIFY /icefaces2/trunk/icefaces/compat/components/src/main/java/com/icesoft/faces/component/ext/HtmlSelectOneRadio.java
          Commit graph MODIFY /icefaces2/trunk/icefaces/compat/core/src/main/java/com/icesoft/faces/renderkit/dom_html_basic/SelectManyCheckboxListRenderer.java
          Hide
          yip.ng added a comment - - edited

          Fixed by moving onclick handler from fieldset to radio buttons. No need to handle label element. Tested on IE 6, 7, 8 and FF.

          From http://www.w3schools.com/tags/tag_label.asp :

          The label element does not render as anything special for the user. However, it provides a usability improvement for mouse users, because if the user clicks on the text within the label element, it toggles the control.

          Revision: 23052


          Modified : /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/HtmlSelectOneRadio.java
          Modified : /icefaces/trunk/icefaces/core/src/com/icesoft/faces/renderkit/dom_html_basic/RadioRenderer.java
          Modified : /icefaces/trunk/icefaces/core/src/com/icesoft/faces/renderkit/dom_html_basic/SelectManyCheckboxListRenderer.java

          Revision: 23053


          Modified : /icefaces2/trunk/icefaces/compat/components/src/main/java/com/icesoft/faces/component/ext/HtmlSelectOneRadio.java
          Modified : /icefaces2/trunk/icefaces/compat/core/src/main/java/com/icesoft/faces/renderkit/dom_html_basic/RadioRenderer.java
          Modified : /icefaces2/trunk/icefaces/compat/core/src/main/java/com/icesoft/faces/renderkit/dom_html_basic/SelectManyCheckboxListRenderer.java

          Show
          yip.ng added a comment - - edited Fixed by moving onclick handler from fieldset to radio buttons. No need to handle label element. Tested on IE 6, 7, 8 and FF. From http://www.w3schools.com/tags/tag_label.asp : The label element does not render as anything special for the user. However, it provides a usability improvement for mouse users, because if the user clicks on the text within the label element, it toggles the control. Revision: 23052 Modified : /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/HtmlSelectOneRadio.java Modified : /icefaces/trunk/icefaces/core/src/com/icesoft/faces/renderkit/dom_html_basic/RadioRenderer.java Modified : /icefaces/trunk/icefaces/core/src/com/icesoft/faces/renderkit/dom_html_basic/SelectManyCheckboxListRenderer.java Revision: 23053 Modified : /icefaces2/trunk/icefaces/compat/components/src/main/java/com/icesoft/faces/component/ext/HtmlSelectOneRadio.java Modified : /icefaces2/trunk/icefaces/compat/core/src/main/java/com/icesoft/faces/renderkit/dom_html_basic/RadioRenderer.java Modified : /icefaces2/trunk/icefaces/compat/core/src/main/java/com/icesoft/faces/renderkit/dom_html_basic/SelectManyCheckboxListRenderer.java
          yip.ng made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Assignee Priority P1
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #28206 Wed Mar 07 09:48:24 MST 2012 arran.mccullough ICE-5632: ValueChangeListener gets called twice when clicking on label for selectOneRadio.
          Files Changed
          Commit graph MODIFY /icefaces/scratchpads/patches/sf-10973/icefaces/component/src/com/icesoft/faces/component/ext/HtmlSelectOneRadio.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #28207 Wed Mar 07 09:53:16 MST 2012 arran.mccullough ICE-5632: ValueChangeListener gets called twice when clicking on label for selectOneRadio.
          Files Changed
          Commit graph MODIFY /icefaces/scratchpads/patches/sf-10973/icefaces/core/src/com/icesoft/faces/renderkit/dom_html_basic/RadioRenderer.java
          Commit graph MODIFY /icefaces/scratchpads/patches/sf-10973/icefaces/component/src/com/icesoft/faces/component/ext/HtmlSelectOneRadio.java
          Commit graph MODIFY /icefaces/scratchpads/patches/sf-10973/icefaces/core/src/com/icesoft/faces/renderkit/dom_html_basic/SelectManyCheckboxListRenderer.java

            People

            • Assignee:
              yip.ng
              Reporter:
              Arran Mccullough
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: