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

          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.
          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.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: