No announcement yet.
  • Filter
  • Time
Clear All
new posts

    Enabling setCompleteOnTab in a ComboBoxItem when only one option is left in the filtered out dropdown list.

    In our application we are using ComboxItem for dropdown in a listgrid. In the comboboxItem CompleteOnEnter property has been set to true and setCompleteOnTab to false.

    Now when user is typing something in the ComboBox and only one option is left in the filtered out dropdown, in that scenario we want that the only dropdown option that is left should get selected on tab key.
    How can we implement that.

    Before starting on this, consider that in an accessibility review, this might be considered a violation, because a non-sighted user would not immediately know that there was only one option the way a sighted user would.

    If you still want to go ahead with this, you would add keyboard event handling that looks at the pickList to see that only on option remains, and then calls setValue().


      How to get the picklist for a ComboBoxItem in runtime so that I can check the length. I tried with filterClientPickListData(), getClientPickListData() in both the cases it is returning null. We are using SmartGWT version 12.1-p20210819.


        There is literally a getPickList() API. The pickList is a subclass of ListGrid, so APIs list getTotalRows() are available.


          I saw getPickList() is available from smartgwt version 13. We are using 12.1-p20210819, it seems that getPickList is not available in this version. Could you please confirm. In that case is there any other method that we can use to get the picklist.


            In older versions, getCanvasAutoChild("pickList") is equivalent.



              I am again getting null while using getCanvasAutoChild("pickList") .

              Code snippet:
              comboBoxItem.addKeyUpHandler(handler -> {
              Canvas pl = item.getCanvasAutoChild("pickList");
              GWT.log("In face type keyup handler" + handler.getKeyName());



                We did some testing and we couldn't reproduce the issue.

                Take into account that you need to open or start typing into the ComboBoxItem in order to get the pickList via getCanvasAutoChild(). Otherwise, the pickList will be null.

                Isomorphic Software