ICEfaces
  1. ICEfaces
  2. ICE-10114

Add "Clear" capability to ACE, MOBI components

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1
    • Labels:
      None
    • Environment:
      ICEfaces 4

      Description

      A useful feature for an application is to provide a "Reset" button on a form to allow the use to reset all form fields to their original states, prior to any user modifications.

      Historically, the HTML input type="reset" was used for this function (e.g. " <input type="reset" value="Reset!">"). However, with the more advanced and complex components provided by ACE and MOBI, the basic form-field reset capability provided by the HTML input technique is no longer sufficient to ensure proper value resetting.

      While, the native reset button not only clears input elements but also resets those elements to the values with which they were loaded initially, in the case of our components the notion of an original value is not straight-forward, since our components' values can be programmatically updated, and also ajax requests can save components' values multiple times in a user session. This makes it unclear to determine what really are the original components' values.

      This JIRA is to investigate and ultimately provide an easy to use mechanism for clearing all components in a form reliably, whether they be ACE, MOBI, or "h:" / standard JSF components.

      Note that this JIRA would likely provide a JavaScript-based mechanism for clearing the components in a form, but ultimately this JS function would be integrated into a new "clear" mode for the existing ace:pushButton component (under a separate JIRA - ICE-10115).

        Issue Links

          Activity

          Ken Fyten created issue -
          Ken Fyten made changes -
          Field Original Value New Value
          Description A useful feature for an application is to provide a "Reset" button on a form to allow the use to reset all form fields to their original states, prior to any user modifications.

          Historically, the HTML input type="reset" was used for this function (e.g. " <input type="reset" value="Reset!">"). However, with the more advanced and complex components provided by ACE and MOBI, the basic form-field reset capability provided by the HTML input technique is no longer sufficient to ensure proper value resetting.

          This JIRA is to investigate and ultimately provide an easy to use mechanism for resetting all components in a form reliably, whether they be ACE, MOBI, or "h:" / standard JSF components.

          Note that this JIRA would likely provide a JavaScript-based mechanism for resetting the components in a form, but ultimately this JS function would be integrated into a new "reset" type for the existing ace:pushButton component (under a separate JIRA).
          A useful feature for an application is to provide a "Reset" button on a form to allow the use to reset all form fields to their original states, prior to any user modifications.

          Historically, the HTML input type="reset" was used for this function (e.g. " <input type="reset" value="Reset!">"). However, with the more advanced and complex components provided by ACE and MOBI, the basic form-field reset capability provided by the HTML input technique is no longer sufficient to ensure proper value resetting.

          This JIRA is to investigate and ultimately provide an easy to use mechanism for resetting all components in a form reliably, whether they be ACE, MOBI, or "h:" / standard JSF components.

          Note that this JIRA would likely provide a JavaScript-based mechanism for resetting the components in a form, but ultimately this JS function would be integrated into a new "reset" type for the existing ace:pushButton component (under a separate JIRA - ICE-10115).
          Ken Fyten made changes -
          Fix Version/s 4.1 [ 11375 ]
          Ken Fyten made changes -
          Link This issue blocks ICE-10115 [ ICE-10115 ]
          Ken Fyten made changes -
          Assignee Mircea Toma [ mircea.toma ]
          Assignee Priority P2 [ 10011 ]
          Ken Fyten made changes -
          Link This issue blocks ICE-9501 [ ICE-9501 ]
          Ken Fyten made changes -
          Assignee Mircea Toma [ mircea.toma ] Ken Fyten [ ken.fyten ]
          Hide
          Ken Fyten added a comment -

          Created a simple test to verify the current behaviour of the ACE input components when "resetted" using a typical HTML form reset:

          <h:commandButton id="reset" value="Reset Form" type="reset" immediate="true" />

          Results show the input field value being cleared successfully on the following components:

          • ace:textEntry
          • ace:autoCompleteEntry
          • ace:comboBox
          • ace:dateTimeEntry

          The following components input field values were unaffected by the HTML reset:

          • ace:textAreaEntry
          • ace:selectMenu
          • ace:simpleSelectOneMenu
          • ace:maskedEntry
          • ace:sliderEntry
          • ace:checkboxButton
          • ace:radioButton
          Show
          Ken Fyten added a comment - Created a simple test to verify the current behaviour of the ACE input components when "resetted" using a typical HTML form reset: <h:commandButton id= "reset" value= "Reset Form" type= "reset" immediate= " true " /> Results show the input field value being cleared successfully on the following components: ace:textEntry ace:autoCompleteEntry ace:comboBox ace:dateTimeEntry The following components input field values were unaffected by the HTML reset: ace:textAreaEntry ace:selectMenu ace:simpleSelectOneMenu ace:maskedEntry ace:sliderEntry ace:checkboxButton ace:radioButton
          Hide
          Ken Fyten added a comment - - edited

          Another test scenario was created using a slightly more sophisticated JS technique to dynamically clear the component values:

          function clearForm(oForm) {
            var elements = oForm.elements;    
            oForm.reset();
            for(i=0; i<elements.length; i++) {
          	field_type = elements[i].type.toLowerCase();
          	switch(field_type) {
          		case "text": 
          		case "password": 
          		case "textarea":
          	        case "hidden":	
          			elements[i].value = ""; 
          			break;
          		case "radio":
          		case "checkbox":
            			if (elements[i].checked) {
             				elements[i].checked = false; 
          			}
          			break;
          		case "select-one":
          		case "select-multi":
                      		elements[i].selectedIndex = -1;
          			break;
          		default: 
          			break;
          	}
              }
          } 

          Results show that this technique clears all same components as the HTML reset, and adds these additional components:

          • ace:textAreaEntry
          • ace:simpleSelectOneMenu
          • ace:maskedEntry

          The following components remain unaffected:

          • ace:selectMenu
          • ace:sliderEntry
          • ace:checkboxButton
          • ace:radioButton
          Show
          Ken Fyten added a comment - - edited Another test scenario was created using a slightly more sophisticated JS technique to dynamically clear the component values: function clearForm(oForm) { var elements = oForm.elements; oForm.reset(); for (i=0; i<elements.length; i++) { field_type = elements[i].type.toLowerCase(); switch (field_type) { case "text" : case "password" : case "textarea" : case "hidden" : elements[i].value = ""; break ; case "radio" : case "checkbox" : if (elements[i].checked) { elements[i].checked = false ; } break ; case "select-one" : case "select-multi" : elements[i].selectedIndex = -1; break ; default : break ; } } } Results show that this technique clears all same components as the HTML reset, and adds these additional components: ace:textAreaEntry ace:simpleSelectOneMenu ace:maskedEntry The following components remain unaffected: ace:selectMenu ace:sliderEntry ace:checkboxButton ace:radioButton
          Hide
          Ken Fyten added a comment -

          As part of ICE-5377 Mircea implemented a new "Validateable" interface on the ACE input components. This interface provides support for the getValidatedElementId() method, which returns the client ID of the component element that contains the component's value. The original intent of this interface was to enable JS-based client-side validators access to the value-holding element for each input component. However, it may be feasible to also leverage this interface to allow an enhanced reset JS function to determine the correct element to clear in order to reset each component.

          Note that this approach may be effective in most cases, but would not provide a way to also reset the state of the components JS model objects.

          Show
          Ken Fyten added a comment - As part of ICE-5377 Mircea implemented a new "Validateable" interface on the ACE input components. This interface provides support for the getValidatedElementId() method, which returns the client ID of the component element that contains the component's value. The original intent of this interface was to enable JS-based client-side validators access to the value-holding element for each input component. However, it may be feasible to also leverage this interface to allow an enhanced reset JS function to determine the correct element to clear in order to reset each component. Note that this approach may be effective in most cases, but would not provide a way to also reset the state of the components JS model objects.
          Ken Fyten made changes -
          Assignee Ken Fyten [ ken.fyten ] Arturo Zambrano [ artzambrano ]
          Hide
          Ken Fyten added a comment -

          For this release at least, I would suggest that only the following comps in the "Not Sure" list support reset:

          • ace:fileEntry (this appears to reset now via the std. form reset function but multiple selection mode might require advanced reset features to clear).
          • mobi:geolocation (the demo already has a "Reset Values" button so the reset function should the same thing as that button).
          • I don't think there is such a thing as ace:geolocation ?
          Show
          Ken Fyten added a comment - For this release at least, I would suggest that only the following comps in the "Not Sure" list support reset: ace:fileEntry (this appears to reset now via the std. form reset function but multiple selection mode might require advanced reset features to clear). mobi:geolocation (the demo already has a "Reset Values" button so the reset function should the same thing as that button). I don't think there is such a thing as ace:geolocation ?
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #46509 Thu Dec 10 12:25:55 MST 2015 art.zambrano ICE-10114 added reset capability to ACE components
          Files Changed
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/radiobutton/RadioButtonRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datetimeentry/DateTimeEntryRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/combobox/combobox.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/checkboxbuttons/CheckboxButtonsRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/selectmenu/selectmenu.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/checkboxbutton/checkboxbutton.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/textareaentry/textareaentry.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/sliderentry/SliderEntryRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/core/core.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/checkboxbutton/CheckboxButtonRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/datetimeentry/datetimeentry.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/textentry/textentry.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/radiobuttons/RadioButtonsRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/selectmenu/SelectMenuRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/autocompleteentry/autocompleteentry.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/richtextentry/RichTextEntryRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/maskedentry/MaskedEntryRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/textareaentry/TextAreaEntryRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/maskedentry/maskedentry.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/sliderentry/slider.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/autocompleteentry/AutoCompleteEntryRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/textentry/TextEntryRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/combobox/ComboBoxRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/richtextentry/richtextentry.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/radiobutton/radiobutton.js
          Hide
          Arturo Zambrano added a comment -

          r46509: added reset capability to ACE components.

          This capability is used by calling the function ice.ace.resetForm(form), where the 'form' argument can be the client id of a form or a form node.

          The approach used for this feature is to render a data-ice-reset attribute on the root node of a component, containing the reset settings for that specific component. The global ice.ace.resetForm(form) function searches for elements containing this attribute and invokes the respective component-specific reset functions passing the settings contained in said attribute, but first the logic in the clearForm() function posted above is executed to reset h:* components and regular input elements. This logic was extended to avoid clearing form-specific hidden input fields like ice.view and ice.window.

          Testing notes: The testing matrix will have to be somewhat complex. We want to test this feature with and without inField labels (if the component supports them). We also want to test with and without ajax (just the default event). And we also need to test when the components are loaded without a programmatically predefined value and when they are loaded with one.

          We want to make sure that the components are reset successfully and we also want to make sure that, after submitting the form right after resetting, components don't submit the value they had (or any value for that matter). Another thing to test is that calling the resetForm function doesn't trigger any request to the server (make sure that the button used to invoke this function doesn't submit the form itself). And, of course, we want to make sure that after resetting a component, it keeps working normally and the user is able to input another value.

          Show
          Arturo Zambrano added a comment - r46509: added reset capability to ACE components. This capability is used by calling the function ice.ace.resetForm(form), where the 'form' argument can be the client id of a form or a form node. The approach used for this feature is to render a data-ice-reset attribute on the root node of a component, containing the reset settings for that specific component. The global ice.ace.resetForm(form) function searches for elements containing this attribute and invokes the respective component-specific reset functions passing the settings contained in said attribute, but first the logic in the clearForm() function posted above is executed to reset h:* components and regular input elements. This logic was extended to avoid clearing form-specific hidden input fields like ice.view and ice.window. Testing notes: The testing matrix will have to be somewhat complex. We want to test this feature with and without inField labels (if the component supports them). We also want to test with and without ajax (just the default event). And we also need to test when the components are loaded without a programmatically predefined value and when they are loaded with one. We want to make sure that the components are reset successfully and we also want to make sure that, after submitting the form right after resetting, components don't submit the value they had (or any value for that matter). Another thing to test is that calling the resetForm function doesn't trigger any request to the server (make sure that the button used to invoke this function doesn't submit the form itself). And, of course, we want to make sure that after resetting a component, it keeps working normally and the user is able to input another value.
          Hide
          Arturo Zambrano added a comment -

          r46513: added reset capability to MOBI components and ace:fileEntry

          Show
          Arturo Zambrano added a comment - r46513: added reset capability to MOBI components and ace:fileEntry
          Arturo Zambrano made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #46513 Thu Dec 10 15:27:08 MST 2015 art.zambrano ICE-10114 added reset capability to MOBI components and ace:fileEntry
          Files Changed
          Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/resources/org.icefaces.component.flipswitch/flipswitch.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/src/org/icefaces/mobi/component/flipswitch/FlipSwitchRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/fileentry/FileEntryRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/fileentry/fileEntry.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/core/core.js
          Hide
          Arturo Zambrano added a comment -

          The components that now support the reset capability are the following:

          Input

          • ace:autoCompleteEntry
          • ace:dateTimeEntry
          • ace:maskedEntry
          • ace:richTextEntry
          • ace:sliderEntry
          • ace:textAreaEntry
          • ace:textEntry
          • ace:fileEntry

          Buttons

          • ace:buttonGroup
          • ace:checkboxButton
          • ace:checkboxButtons
          • ace:radioButton
          • ace:radioButtons

          Selection

          • ace:comboBox
          • ace:selectMenu
          • ace:simpleSelectOneMenu

          MOBI input

          • mobi:dateSpinner
          • mobi:timeSpinner
          • mobi:flipswitch
          • mobi:geolocation
          Show
          Arturo Zambrano added a comment - The components that now support the reset capability are the following: Input ace:autoCompleteEntry ace:dateTimeEntry ace:maskedEntry ace:richTextEntry ace:sliderEntry ace:textAreaEntry ace:textEntry ace:fileEntry Buttons ace:buttonGroup ace:checkboxButton ace:checkboxButtons ace:radioButton ace:radioButtons Selection ace:comboBox ace:selectMenu ace:simpleSelectOneMenu MOBI input mobi:dateSpinner mobi:timeSpinner mobi:flipswitch mobi:geolocation
          Hide
          Arturo Zambrano added a comment -

          As per ICE-10115, now ace:pushButton and ace:linkButton have a 'reset' attribute. When true, the buttons invoke the ice.ace.renderForm(form) function for the form in which they're contained. So, now they can be used for testing this JIRA.

          Show
          Arturo Zambrano added a comment - As per ICE-10115 , now ace:pushButton and ace:linkButton have a 'reset' attribute. When true, the buttons invoke the ice.ace.renderForm(form) function for the form in which they're contained. So, now they can be used for testing this JIRA.
          Hide
          Arturo Zambrano added a comment -

          r46528: removed restriction of only resetting ace:dateTimeEntry in popup mode, since it's also possible to reset it in the calendar mode

          Show
          Arturo Zambrano added a comment - r46528: removed restriction of only resetting ace:dateTimeEntry in popup mode, since it's also possible to reset it in the calendar mode
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #46528 Mon Dec 14 09:54:29 MST 2015 art.zambrano ICE-10114 removed restriction of only resetting ace:dateTimeEntry in popup mode, since it's also possible to reset it in the calendar mode
          Files Changed
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datetimeentry/DateTimeEntryRenderer.java
          Hide
          Liana Munroe added a comment - - edited

          ICEfaces 4 trunk r46527. Initial testing with ace:radioButtons appears to be failing. When the page loads radioButton 1 is selected.
          After selecting radioButton 2, then pressing the Reset button, no radioButtons are selected. Should this reset to radioButton 1 selected?
          When selecting another radioButton the following message is seen:
          form1:radioButtons1: Validation Error: Value is not valid

          This occurs with and without ace:ajax inside the ace:radioButtons.

          Show
          Liana Munroe added a comment - - edited ICEfaces 4 trunk r46527. Initial testing with ace:radioButtons appears to be failing. When the page loads radioButton 1 is selected. After selecting radioButton 2, then pressing the Reset button, no radioButtons are selected. Should this reset to radioButton 1 selected? When selecting another radioButton the following message is seen: form1:radioButtons1: Validation Error: Value is not valid This occurs with and without ace:ajax inside the ace:radioButtons.
          Liana Munroe made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Hide
          Arturo Zambrano added a comment -

          r46547: added a mechanism to persist values in ace:radioButtons, since the component relies on the individual radio buttons holding the same value all the time and only applying the name attribute to the selected radio when submitting

          Show
          Arturo Zambrano added a comment - r46547: added a mechanism to persist values in ace:radioButtons, since the component relies on the individual radio buttons holding the same value all the time and only applying the name attribute to the selected radio when submitting
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #46547 Wed Dec 16 09:58:25 MST 2015 art.zambrano ICE-10114 added a mechanism to persist values in ace:radioButtons, since the component relies on the individual radio buttons holding the same value all the time and only applying the name attribute to the selected radio when submitting
          Files Changed
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/radiobuttons/RadioButtonsRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/radiobutton/radiobutton.js
          Hide
          Arturo Zambrano added a comment -

          r46548: changed name of resetForm() function to clearForm(), in order to implement in the future an actual reset functionality that restores original values

          Show
          Arturo Zambrano added a comment - r46548: changed name of resetForm() function to clearForm(), in order to implement in the future an actual reset functionality that restores original values
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #46548 Wed Dec 16 10:20:19 MST 2015 art.zambrano ICE-10114 changed name of resetForm() function to clearForm(), in order to implement in the future an actual reset functionality that restores original values
          Files Changed
          Commit graph MODIFY /icefaces4/trunk/icefaces/mobi/component/resources/org.icefaces.component.flipswitch/flipswitch.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/combobox/combobox.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/selectmenu/selectmenu.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/checkboxbutton/checkboxbutton.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/textareaentry/textareaentry.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/fileentry/fileEntry.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/core/core.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/textentry/textentry.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/datetimeentry/datetimeentry.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/autocompleteentry/autocompleteentry.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/maskedentry/maskedentry.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/sliderentry/slider.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/richtextentry/richtextentry.js
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/radiobutton/radiobutton.js
          Arturo Zambrano made changes -
          Summary Add "Reset" capability to ACE, MOBI components Add "Clear" capability to ACE, MOBI components
          Arturo Zambrano made changes -
          Description A useful feature for an application is to provide a "Reset" button on a form to allow the use to reset all form fields to their original states, prior to any user modifications.

          Historically, the HTML input type="reset" was used for this function (e.g. " <input type="reset" value="Reset!">"). However, with the more advanced and complex components provided by ACE and MOBI, the basic form-field reset capability provided by the HTML input technique is no longer sufficient to ensure proper value resetting.

          This JIRA is to investigate and ultimately provide an easy to use mechanism for resetting all components in a form reliably, whether they be ACE, MOBI, or "h:" / standard JSF components.

          Note that this JIRA would likely provide a JavaScript-based mechanism for resetting the components in a form, but ultimately this JS function would be integrated into a new "reset" type for the existing ace:pushButton component (under a separate JIRA - ICE-10115).
          A useful feature for an application is to provide a "Reset" button on a form to allow the use to reset all form fields to their original states, prior to any user modifications.

          Historically, the HTML input type="reset" was used for this function (e.g. " <input type="reset" value="Reset!">"). However, with the more advanced and complex components provided by ACE and MOBI, the basic form-field reset capability provided by the HTML input technique is no longer sufficient to ensure proper value resetting.

          While, the native reset button not only clears input elements but also resets those elements to the values with which they were loaded initially, in the case of our components the notion of an original value is not straight-forward, since our components' values can be programmatically updated, and also ajax requests can save components' values multiple times in a user session. This makes it unclear to determine what really are the original components' values.

          This JIRA is to investigate and ultimately provide an easy to use mechanism for clearing all components in a form reliably, whether they be ACE, MOBI, or "h:" / standard JSF components.

          Note that this JIRA would likely provide a JavaScript-based mechanism for clearing the components in a form, but ultimately this JS function would be integrated into a new "clear" mode for the existing ace:pushButton component (under a separate JIRA - ICE-10115).
          Arturo Zambrano made changes -
          Link This issue blocks ICE-10898 [ ICE-10898 ]
          Hide
          Liana Munroe added a comment - - edited

          Verified ICEfaces 4 trunk r46549. ace:radioButtons issue is resolved.
          QA test apps using the new attributes for ace:linkButton and ace:pushButton have been checked in.

          /ICE-10114.jsf and /ICE-10114mobi.jsf
          http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Nightly/linkButton
          http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Nightly/pushButton

          Show
          Liana Munroe added a comment - - edited Verified ICEfaces 4 trunk r46549. ace:radioButtons issue is resolved. QA test apps using the new attributes for ace:linkButton and ace:pushButton have been checked in. / ICE-10114 .jsf and / ICE-10114 mobi.jsf http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Nightly/linkButton http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Nightly/pushButton
          Ken Fyten made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Affects Documentation (User Guide, Ref. Guide, etc.) [ 10003 ]
          Resolution Fixed [ 1 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #46907 Mon Dec 21 11:28:20 MST 2015 art.zambrano ICE-10114 added logic to cover the case when the label is inField and there is an indicator whose position is labelLeft or labelRight, in order to make sure to restore both the label and the indicator in the field
          Files Changed
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/selectmenu/SelectMenuRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datetimeentry/DateTimeEntryRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/maskedentry/MaskedEntryRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/textareaentry/TextAreaEntryRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/autocompleteentry/AutoCompleteEntryRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/textentry/TextEntryRenderer.java
          Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/combobox/ComboBoxRenderer.java
          Hide
          Arturo Zambrano added a comment -

          r46907: added logic to cover the case when the label is inField and there is an indicator whose position is labelLeft or labelRight, in order to make sure to restore both the label and the indicator in the field
          r46908: committed fix to 4.1 tag

          Show
          Arturo Zambrano added a comment - r46907: added logic to cover the case when the label is inField and there is an indicator whose position is labelLeft or labelRight, in order to make sure to restore both the label and the indicator in the field r46908: committed fix to 4.1 tag
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #46908 Mon Dec 21 11:32:23 MST 2015 art.zambrano ICE-10114 added logic to cover the case when the label is inField and there is an indicator whose position is labelLeft or labelRight, in order to make sure to restore both the label and the indicator in the field
          Files Changed
          Commit graph MODIFY /icefaces4/tags/icefaces-4.1.0/icefaces/ace/component/src/org/icefaces/ace/component/textareaentry/TextAreaEntryRenderer.java
          Commit graph MODIFY /icefaces4/tags/icefaces-4.1.0/icefaces/ace/component/src/org/icefaces/ace/component/datetimeentry/DateTimeEntryRenderer.java
          Commit graph MODIFY /icefaces4/tags/icefaces-4.1.0/icefaces/ace/component/src/org/icefaces/ace/component/textentry/TextEntryRenderer.java
          Commit graph MODIFY /icefaces4/tags/icefaces-4.1.0/icefaces/ace/component/src/org/icefaces/ace/component/autocompleteentry/AutoCompleteEntryRenderer.java
          Commit graph MODIFY /icefaces4/tags/icefaces-4.1.0/icefaces/ace/component/src/org/icefaces/ace/component/selectmenu/SelectMenuRenderer.java
          Commit graph MODIFY /icefaces4/tags/icefaces-4.1.0/icefaces/ace/component/src/org/icefaces/ace/component/maskedentry/MaskedEntryRenderer.java
          Commit graph MODIFY /icefaces4/tags/icefaces-4.1.0/icefaces/ace/component/src/org/icefaces/ace/component/combobox/ComboBoxRenderer.java
          Hide
          Liana Munroe added a comment - - edited

          ICEfaces 4.1 TAG r46909
          There are issues in the scenarios ace:maskedEntry and ace:selectMenu with label="inField" and indicator position= labelLeft or labelRight...

          1.) ace:maskedEntry
          When the page is first loaded the optional indicator does not show next to the label when the label is inField.
          In the QA test app the markup is as so:

           <ace:maskedEntry id="maskedEntry1" mask="***********"
                          value="#{pushButtonResetBean.value2}" label="maskedEntry"
                          labelPosition="inField" optionalIndicator="(*)"     indicatorPosition="labelLeft" /> 

          Once you have pressed the Clear button the optionalIndicator is shown at the left of the inField label. as expected.

          2.) ace:selectMenu
          When the page is first loaded the label and optionalIndicator are shown as expected.
          After selecting a value from the menu, then pressing the Clear button, the selectMenu no longer displays the label or optionalIndicator.

          The QA test apps have been modified and checked in.

          Show
          Liana Munroe added a comment - - edited ICEfaces 4.1 TAG r46909 There are issues in the scenarios ace:maskedEntry and ace:selectMenu with label="inField" and indicator position= labelLeft or labelRight... 1.) ace:maskedEntry When the page is first loaded the optional indicator does not show next to the label when the label is inField. In the QA test app the markup is as so: <ace:maskedEntry id= "maskedEntry1" mask= "***********" value= "#{pushButtonResetBean.value2}" label= "maskedEntry" labelPosition= "inField" optionalIndicator= "(*)" indicatorPosition= "labelLeft" /> Once you have pressed the Clear button the optionalIndicator is shown at the left of the inField label. as expected. 2.) ace:selectMenu When the page is first loaded the label and optionalIndicator are shown as expected. After selecting a value from the menu, then pressing the Clear button, the selectMenu no longer displays the label or optionalIndicator. The QA test apps have been modified and checked in.
          Liana Munroe made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Hide
          Arturo Zambrano added a comment -

          The first issue is not caused by this recent commit. It seems to be a general issue that we hadn't tested before. Please test to see if it happens before this commit.

          The issue seems to be that the asterisk and the brackets of the indicator are being interpreted as part of the mask. if you change the mask to only numbers (e.g. 9, 999, or 99/99, etc.), then you will see the asterisk and the brackets as part of the infield label. For now try testing this feature without using brackets or asterisks.

          Show
          Arturo Zambrano added a comment - The first issue is not caused by this recent commit. It seems to be a general issue that we hadn't tested before. Please test to see if it happens before this commit. The issue seems to be that the asterisk and the brackets of the indicator are being interpreted as part of the mask. if you change the mask to only numbers (e.g. 9, 999, or 99/99, etc.), then you will see the asterisk and the brackets as part of the infield label. For now try testing this feature without using brackets or asterisks.
          Hide
          Liana Munroe added a comment -

          Confirmed that the first issue also happened in the past.
          Confirmed that changing the mask type to 9999999 allows the optionalIndicator to be shown inField on page load.
          Test apps were updated to reflect that change.

          Show
          Liana Munroe added a comment - Confirmed that the first issue also happened in the past. Confirmed that changing the mask type to 9999999 allows the optionalIndicator to be shown inField on page load. Test apps were updated to reflect that change.
          Hide
          Arturo Zambrano added a comment -

          Ok, the second started with an earlier commit, but was discovered with these new tests. If an ace:selectMenu component has an f:selectItem with the empty string as the value, it will show that value (i.e. blank) instead of the inField label.

          Show
          Arturo Zambrano added a comment - Ok, the second started with an earlier commit, but was discovered with these new tests. If an ace:selectMenu component has an f:selectItem with the empty string as the value, it will show that value (i.e. blank) instead of the inField label.
          Hide
          Arturo Zambrano added a comment -

          Actually, it wasn't caused by a recent commit. It's just the way it has been working all the time. I suggested to add an empty string value in ICE-10900 to avoid validation errors. This is just the way it logically works.

          We would have to introduce a special value to represent a state where the user hasn't interacted yet with the component, in order to show the inField label after clearing the form when there exists an empty string value, but perhaps it would be risky to do so at this moment.

          Show
          Arturo Zambrano added a comment - Actually, it wasn't caused by a recent commit. It's just the way it has been working all the time. I suggested to add an empty string value in ICE-10900 to avoid validation errors. This is just the way it logically works. We would have to introduce a special value to represent a state where the user hasn't interacted yet with the component, in order to show the inField label after clearing the form when there exists an empty string value, but perhaps it would be risky to do so at this moment.
          Ken Fyten made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Arturo Zambrano made changes -
          Link This issue blocks ICE-10912 [ ICE-10912 ]
          Liana Munroe made changes -
          Comment [ Tested with ICEfaces 4 trunk r 47630.
          Issue found when using the Clear button in a form that has an ace:textEntry with a preloaded value and an inField label. If the Clear button is pressed before entering input into the ace:textEntry, newly entered input becomes part of the inField label. This issue seems to be exclusive to ace:textEntry. It is not an issue with ace:textAreaEntry, ace:maskedEntry, ace:dateTimeEntry etc.
          To reproduce:
          1.) Use the QA test application /ClearResetSubmit.jsf found at:
          http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Nightly/pushButton.
          2.) Scroll down to Form 2. Notice the preloaded values in each input.
          3.) Press the Clear button at the bottom of the form. Notice all inputs display the inField label.
          4.) Insert the cursor into the ace:textEntry. The inField label is not removed as it should be.
          5.) Type into the ace:textEntry. The new input becomes part of the inField label.
          6.) Press the submit button. The newly typed input is removed and the inField label is redisplayed.
          ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Arturo Zambrano
              Reporter:
              Ken Fyten
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: