Announcement

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

    Handling Double Click on SelectItem.

    It takes about 4 clicks before smartGWT recognizes a double click on a SelectItem, is this by design or can smartGWT SelectItem truly honor double click ?

    Vestion: SmartGWT v5.1

    Code Snippet:

    Code:
    SelectItem testSelectItem = new SelectItem( "TestSelectITem", "Select One" );
            final LinkedHashMap< String, String > valueMap = new LinkedHashMap< String, String >();
            valueMap.put( "Option1", "Option1 Display" );
            valueMap.put( "Option2", "Option2 Display" );
            valueMap.put( "Option3", "Option3 Display" );
            valueMap.put( "Option4", "Option4 Display" );
            valueMap.put( "Option5", "Option5 Display" );
            testSelectItem.setDefaultValue( "Option1" );
            testSelectItem.setValueMap( valueMap );
            testSelectItem.addDoubleClickHandler( new DoubleClickHandler() {
    
                @Override
                public void onDoubleClick( DoubleClickEvent event ) {
    
                    SC.say( "Double Click Action Receieved" );
                }
            } );



    #2
    The selectItem has an action for click which is to open the picklist, then the next click outside the picklist closes it and is discarded (which is typical for this kind of control).

    Since listening for double-click clashes with the normal behavior, we'd suggest re-thinking triggering your custom behavior from a double-click - you could use a FormItemIcon instead, for example.

    Comment

    Working...
    X