Announcement

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

    SelectItem Behavior on tabbing

    I have one SelectItem in my ListGrid. If i go by tabbing into the listgrid cells, the cell having SelectItem takes two tabs to get to next cell. In one tab, it closes the picklist and focus on cell, in next tab it goes to next cell. Same behavior is on Showcase example. Can we do this in single tab like done in combobox?

    Second issue with Select Item is if i am working on my grid through tabbing, then combobox had this feature (setCompleteOnTab(true)) to enable selection on tab out but in SelectItem there is no support of this function. Can we do selection from SelectItem picklist on tabout?

    #2
    What you're proposing would be non-standard behavior for a select, but you could implement it via installing a bodyKeyPress handler in pickListProperties if you like.

    Comment


      #3
      How can i get highlighted element from SELECTITEM picklist in bodyKeyPress handler?

      Comment


        #4
        getFocusRow() would do it.

        Comment


          #5
          Hi,

          As per suggestion, i tried following:

          Code:
          ListGrid list = new ListGrid();
           list.addBodyKeyPressHandler(handler -> {
                      String key = EventHandler.getKey();
                      GWT.log(String.valueOf(((ListGrid)handler.getSource()).getFocusRow()));
                  });
                  item.setPickListProperties(list);
          I also tried :

          Code:
          ListGrid list = new ListGrid();
           list.addBodyKeyPressHandler(handler -> {
                      String key = EventHandler.getKey();
                      GWT.log(String.valueOf(list.getFocusRow()));
                  });
                  item.setPickListProperties(list);

          But i am getting following issue in both of above:
          Click image for larger version

Name:	Error.jpg
Views:	114
Size:	370.3 KB
ID:	258914

          Comment


            #6
            It’s inportant to actually read the error message rather than just copy and paste it - it’s telling you exactly what you’re doing wrong. You cannot use the “list” reference as it’s just a properties object, and not the acrually created pickList. You can get a valid reference through the event.

            Comment


              #7
              Hi,

              In above code example, i am trying to get through event only :

              Code:
               ListGrid list = new ListGrid();  list.addBodyKeyPressHandler(handler ->
              {          
                String key = EventHandler.getKey();          
                GWT.log(String.valueOf(((ListGrid)handler.getSource()).getFocusRow()));      
                });  
                    item.setPickListProperties(list);
              Please share if above approach is not correct? I am getting the same issue as last post of mine with as well

              Comment


                #8
                No, you are not getting the same issue. Please stop making false statements to support.

                Your code is now crashing because you are typecasting the ListGrid body as a ListGrid. If you want the ListGrid, it’s the parent of the body.

                Comment


                  #9
                  I am sorry to say but i am not making any false statements here. Thanks for your support. Though i am still struggling with the solution suggested.

                  Comment


                    #10
                    With the changed code, you are not getting the same error as before, which is what you reported.

                    We’ve already explained how to get past the ClassCastException which your revised code would cause.

                    Comment

                    Working...
                    X