4 Replies Latest reply: Feb 7, 2013 7:32 AM by SNikiforov RSS

    autoSuggestBehavior misbehavior

    SNikiforov
      Hi All,
      This is fragment of jsff page and java bean, which I use in ADF application.
      <af:inputText label="Label 1" id="it1">
      <af:autoSuggestBehavior suggestItems="#{bean.a}"/>
      </af:inputText>

      public List a(FacesContext facesContext,
      AutoSuggestUIHints autoSuggestUIHints) {
      ArrayList<SelectItem> selectItems = new ArrayList<SelectItem>();
      selectItems.add(new SelectItem("aa","aa"));
      selectItems.add(new SelectItem("bbb","bbb"));
      return selectItems;
      }
      When I type any character I get
      aa
      bbb
      Then I populate the control by selecting ‘aa’ from the list. That’s fine. But if I clear up the control and type any character and select ‘aa’ again, I get the character I type instead ‘aa’. Which is not OK!
      Thanks,
      SNikiforov.
      JDeveloper 11.1.1.5
        • 1. Re: autoSuggestBehavior misbehavior
          dvohra21
          But if I clear up the control and type any character and select ‘aa’ again, I get the character I type instead ‘aa’.

          AutoSuggest is based on Ajax and an Ajax request is initiated from some event handler.
          Get the character typed or the result for the character typed? Could the result be the same for 'aa' and the character?
          • 2. Re: autoSuggestBehavior misbehavior
            dvohra21
            Is the List cleared also when the result is cleared?

            Edited by: dvohra16 on Feb 6, 2013 5:07 PM
            • 3. Re: autoSuggestBehavior misbehavior
              SNikiforov
              To see this bug you can implement it in your JDeveloper 11.1.1.5
              • 4. Re: autoSuggestBehavior misbehavior
                SNikiforov
                Here is another autosuggest bug:
                <af:inputText label="A1" id="it2">
                <af:autoSuggestBehavior suggestItems="#{bean.a}"/>
                </af:inputText>
                <af:inputText label="A2" id="inputText1">
                <af:autoSuggestBehavior suggestItems="#{bean.b}"/>
                </af:inputText>
                public List a(FacesContext facesContext,
                AutoSuggestUIHints autoSuggestUIHints) {
                ArrayList<SelectItem> selectItems = new ArrayList<SelectItem>();
                selectItems.add(new SelectItem("aa","aa"));
                selectItems.add(new SelectItem("bbb","bbb"));
                return selectItems;
                }

                public List b(FacesContext facesContext,
                AutoSuggestUIHints autoSuggestUIHints) {
                ArrayList<SelectItem> selectItems = new ArrayList<SelectItem>();
                selectItems.add(new SelectItem("cc","cc"));
                selectItems.add(new SelectItem("ddd","ddd"));
                return selectItems;
                }

                If you type ‘a’ on A1 input text, than select ‘aa’ from the list, and than type ‘a’ in the A2 control, ‘aa’,’bbb’ list will appear instead ‘cc’,’ddd’.
                Thanks,
                SNikiforov