ICEfaces
  1. ICEfaces
  2. ICE-9773

ace:autoCompleteEntry textChangeListener is not called on deletion of the last char

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 4.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      Glassfish 3.1.2.2
    • Assignee Priority:
      P2

      Description

      In the sample code below the textChangeListener is executed whenever the user types in oder deletes a char. If the deleted char was the last char, the field will be blanc, but in this case the textChangeListener is not executed.
      If the user types in "E", "i","n" and then presses delete key 3 times, the output is:
      INFO: textChanged(TextChangeEvent):E
      INFO: textChanged(TextChangeEvent):Ei
      INFO: textChanged(TextChangeEvent):Ein
      INFO: textChanged(TextChangeEvent):Ei
      INFO: textChanged(TextChangeEvent):E

      <html xmlns="http://www.w3.org/1999/xhtml"
            xmlns:f="http://java.sun.com/jsf/core"
            xmlns:ace="http://www.icefaces.org/icefaces/components"
            xmlns:h="http://java.sun.com/jsf/html">
          <h:head></h:head>
          <h:body>
              <h:form>
                  <ace:autoCompleteEntry value="#{bean.value}"
                                         textChangeListener="#{bean.textChanged}"
                                         minChars="1">
                      <f:selectItems value="#{bean.items}"/>
                  </ace:autoCompleteEntry>
                  <h:inputText />
              </h:form>
          </h:body>
      </html>


      import java.util.List;

      import javax.faces.bean.ManagedBean;
      import javax.faces.bean.SessionScoped;
      import javax.faces.model.SelectItem;

      import org.icefaces.ace.event.TextChangeEvent;

      @ManagedBean
      @SessionScoped
      public class Bean {

          private String value;
          private List<SelectItem> items = java.util.Arrays.asList(new SelectItem("Eins"), new SelectItem("Zwei"));

          public void textChanged(TextChangeEvent e) {
              System.out.println("textChanged(TextChangeEvent):" + e.getNewValue());
          }

          public String getValue() {
              return value;
          }

          public void setValue(String value) {
              this.value = value;
          }

          public List<SelectItem> getItems() {
              return items;
          }

          public void setItems(List<SelectItem> items) {
              this.items = items;
          }
      }

      This bug does not occur, if, for example, "minChars="1"" is omitted or is replaced by minChars="0".

      In Addition: A Listener should not be called when no action occured. I think, this interferes with the implicit autocomplete ajax-request. What if the developer does not want this textChangeListener be called on every key event?

        Activity

        F Lupke created issue -
        Ken Fyten made changes -
        Field Original Value New Value
        Fix Version/s 4.0 [ 11382 ]
        Ken Fyten made changes -
        Assignee Arturo Zambrano [ artzambrano ]
        Ken Fyten made changes -
        Assignee Priority P2 [ 10011 ]
        Arturo Zambrano made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            F Lupke
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: