ICEfaces
  1. ICEfaces
  2. ICE-8876

ace:autoCompleteEntry, add textChange event, only fire valueChange event on definite inputs

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3
    • Component/s: None
    • Labels:
      None
    • Environment:
      Any
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.), Compatibility/Configuration

      Description

      At the moment, the valueChangeListener method is being fired every time a character is added or deleted from the text field. It even fires when pressing the up/down arrow keys. Instead, the valueChange event should only be triggered when the user gives a more definite input, which can be by either clicking on an option from the list, selecting an option from the list with the keyboard, or pressing the enter key on the text field. Additionally, a textChange event should be added, which will be triggered whenever the contents of the text field change before the user makes a clear decision about what the value of this component should be.

        Activity

        Arturo Zambrano created issue -
        Arturo Zambrano made changes -
        Field Original Value New Value
        Assignee Arturo Zambrano [ artzambrano ]
        Ken Fyten made changes -
        Fix Version/s 3.3 [ 10370 ]
        Ken Fyten made changes -
        Issue Type Bug [ 1 ] Improvement [ 4 ]
        Arturo Zambrano made changes -
        Description At the moment, the valueChangeListener method is being fired every time a character is added or deleted from the text field. It even fires when pressing the up/down arrow keys. Instead, the valueChange event should only be triggered when the user gives a more definite input, which can be by either clicking on an option from the list, selecting an option from the list with the keyboard, or pressing the enter key on the text field. Additionaly, a textChange event should be added, which will be triggered whenever the contents of the text field change before the user makes a clear decision about what the value of this component should be. At the moment, the valueChangeListener method is being fired every time a character is added or deleted from the text field. It even fires when pressing the up/down arrow keys. Instead, the valueChange event should only be triggered when the user gives a more definite input, which can be by either clicking on an option from the list, selecting an option from the list with the keyboard, or pressing the enter key on the text field. Additionally, a textChange event should be added, which will be triggered whenever the contents of the text field change before the user makes a clear decision about what the value of this component should be.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #33192 Wed Jan 23 19:05:40 MST 2013 art.zambrano ICE-8876 modified behaviour of valueChangeListener to fire only when the user gives a definite input
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/autocompleteentry/AutoCompleteEntryMeta.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/autocompleteentry/AutoCompleteEntryRenderer.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #33214 Thu Jan 24 14:38:25 MST 2013 art.zambrano ICE-8876 added textChangeListener attribute and TextChangeEvent; modified behaviour so a 'tab' keypress doesn't submit a request, matching h:inputText behaviour (unless there's an ajax blur event); fixed behaviour to prevent the bridge from submitting an additional request when pressing 'enter' when there is a submit ajax event; fixed issue with not displaying the list when pressing the arrow keys when there is a submit ajax event
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/autocompleteentry/AutoCompleteEntryMeta.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/autocompleteentry/AutoCompleteEntryRenderer.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/autocompleteentry/AutoCompleteEntry.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/resources/icefaces.ace/autocompleteentry/autocompleteentry.js
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #33216 Thu Jan 24 14:46:13 MST 2013 art.zambrano ICE-8876 updated laxy load demo to use the new text change event instead of the value change event; re-added ajax blur event to demos that use 'required'
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/webapp/resources/examples/ace/autocompleteentry/autoCompleteEntryIndicator.xhtml
        Commit graph MODIFY /icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/java/org/icefaces/samples/showcase/example/ace/autocompleteentry/AutoCompleteEntryLazyBean.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/webapp/resources/examples/ace/autocompleteentry/autoCompleteEntryReqStyle.xhtml
        Commit graph MODIFY /icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/webapp/resources/examples/ace/autocompleteentry/autoCompleteEntryLazy.xhtml
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #33217 Thu Jan 24 14:51:36 MST 2013 art.zambrano ICE-8876 adding new TextChangeEvent, missing from previous commit
        Files Changed
        Commit graph ADD /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/event/TextChangeEvent.java
        Hide
        Arturo Zambrano added a comment - - edited

        Committed improvement and other changes to the trunk at revision 33217.

        This is a list of changes and additions:

        • The value change event now only fires on hard submits (if there's a change). That is when the user gives a definite input, which occurs either when the user selects a value from the list by using the mouse or the keyboard, or when the user presses enter on the text field, or when the full form is submitted by other means.
        • As a corollary, the value property will only be set in such hard submit cases.
        • Added a new attribute textChangeListener. It will fire whenever the contents of the input field change (or other keys are pressed) before the user gives a more definite input (i.e. hard submit). Added a TextChangeEvent event to be used with this listener.
        • Fixed some minor issues when using the 'submit' ajax event: letting the bridge send an additional request when pressing 'enter' on the input field, and not displaying the list of possible results when pressing the arrow keys.
        • Prevented submission when pressing the tab key (unless a blur ajax event is registered).
        Show
        Arturo Zambrano added a comment - - edited Committed improvement and other changes to the trunk at revision 33217. This is a list of changes and additions: The value change event now only fires on hard submits (if there's a change). That is when the user gives a definite input, which occurs either when the user selects a value from the list by using the mouse or the keyboard, or when the user presses enter on the text field, or when the full form is submitted by other means. As a corollary, the value property will only be set in such hard submit cases. Added a new attribute textChangeListener. It will fire whenever the contents of the input field change (or other keys are pressed) before the user gives a more definite input (i.e. hard submit). Added a TextChangeEvent event to be used with this listener. Fixed some minor issues when using the 'submit' ajax event: letting the bridge send an additional request when pressing 'enter' on the input field, and not displaying the list of possible results when pressing the arrow keys. Prevented submission when pressing the tab key (unless a blur ajax event is registered).
        Arturo Zambrano made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #33243 Fri Jan 25 18:01:31 MST 2013 art.zambrano ICE-8876 added 'valueChange' and 'textChange' ajax events; changed definition of these events; prevented submission when pressing function keys;
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/autocompleteentry/AutoCompleteEntryMeta.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/autocompleteentry/AutoCompleteEntryRenderer.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/resources/icefaces.ace/autocompleteentry/autocompleteentry.js
        Hide
        Arturo Zambrano added a comment -

        Committed more changes at revision 33243.

        • Re-defined the 'textChange' event. It will only fire whenever the user adds or removes a character from the text field, but it won't fire when the user selects an option from the list or if the text changes by other means.
        • Added 'valueChange' and 'textChange' ajax events.
        • In order to avoid overlapping of ajax events. The 'submit' event will only fire if there are no 'valueChange' and/or 'textChange' events registered. In other words, the 'submit' event will fire in all cases where the 'valueChange' and 'textChange' events fire, but if there's a 'valueChange' registered as well, it won't fire in those cases. Likewise, if there's also a 'textChange' event registered, it won't fire in the cases of the 'textChange' event.
        • Prevented submission on keys that do not add or remove a character.
        Show
        Arturo Zambrano added a comment - Committed more changes at revision 33243. Re-defined the 'textChange' event. It will only fire whenever the user adds or removes a character from the text field, but it won't fire when the user selects an option from the list or if the text changes by other means. Added 'valueChange' and 'textChange' ajax events. In order to avoid overlapping of ajax events. The 'submit' event will only fire if there are no 'valueChange' and/or 'textChange' events registered. In other words, the 'submit' event will fire in all cases where the 'valueChange' and 'textChange' events fire, but if there's a 'valueChange' registered as well, it won't fire in those cases. Likewise, if there's also a 'textChange' event registered, it won't fire in the cases of the 'textChange' event. Prevented submission on keys that do not add or remove a character.
        Hide
        Arturo Zambrano added a comment -

        This is a table that compares the old behaviour and the new behaviour of the component.

        Action Old behaviour New behaviour
        Type a character Submit, fire valueChangeListener Submit, fire textChangeListener
        Remove a character (backspace or del) Submit, fire valueChangeListener Submit, fire textChangeListener
        Select a value from the list Submit, fire valueChangeListener Submit, fire valueChangeListener
        Press 'enter' on text field Submit, fire valueChangeListener Submit, fire valueChangeListener
        Press 'tab' key on text field Submit Do not submit
        Press any other key that doesn't add or remove a character Submit Do not submit
        Show
        Arturo Zambrano added a comment - This is a table that compares the old behaviour and the new behaviour of the component. Action Old behaviour New behaviour Type a character Submit, fire valueChangeListener Submit, fire textChangeListener Remove a character (backspace or del) Submit, fire valueChangeListener Submit, fire textChangeListener Select a value from the list Submit, fire valueChangeListener Submit, fire valueChangeListener Press 'enter' on text field Submit, fire valueChangeListener Submit, fire valueChangeListener Press 'tab' key on text field Submit Do not submit Press any other key that doesn't add or remove a character Submit Do not submit
        Hide
        Ken Fyten added a comment -

        Art, to clarify what is listed in the table above:

        "Type a character -> New behaviour -> Submit, fire textChangeListener" - the submit should only occur if an <ace:ajax event="textChange" /> exists in the component, correct? That is to say, there would be no submit unless the textChangeListener client event is registered?

        Show
        Ken Fyten added a comment - Art, to clarify what is listed in the table above: "Type a character -> New behaviour -> Submit, fire textChangeListener" - the submit should only occur if an <ace:ajax event="textChange" /> exists in the component, correct? That is to say, there would be no submit unless the textChangeListener client event is registered?
        Hide
        Arturo Zambrano added a comment -

        No, there has to be a submit anyway. The component needs to know which characters are in the text field in order to produce the list of possible results. The only scenario where this doesn't happen is when using the client side only mode.

        Show
        Arturo Zambrano added a comment - No, there has to be a submit anyway. The component needs to know which characters are in the text field in order to produce the list of possible results. The only scenario where this doesn't happen is when using the client side only mode.
        Ken Fyten made changes -
        Affects Documentation (User Guide, Ref. Guide, etc.),Compatibility/Configuration [ 10003, 10002 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Arturo Zambrano
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: