Do any keyboard events propogate?  It looks like the code could block
up/down/left/right/space, but other keys should get through.

Thanks,
John LaBanca
[email protected]


On Wed, Feb 2, 2011 at 6:44 AM, monkeyboy <[email protected]> wrote:

> Here is the test code:
> public class KeyboardSelectionPolicyDISABLEDTest {
>
>     interface Binder extends UiBinder<HTMLPanel,
> KeyboardSelectionPolicyDISABLEDTest> {
>     }
>
>     private static final Binder binder = GWT.create(Binder.class);
>     private static final Logger l =
> Logger.getLogger(KeyboardSelectionPolicyDISABLEDTest.class.getName());
>     private final HTMLPanel rootElement;
>
>     @UiField
>     CellTable<String> table;
>
>     public KeyboardSelectionPolicyDISABLEDTest() {
>         rootElement = binder.createAndBindUi(this);
>         final ArrayList<String> list = new ArrayList<String>();
>         list.add("item 1");
>         list.add("item 2");
>
>         final ListDataProvider<String> items = new
> ListDataProvider<String>();
>         items.setList(list);
>         items.addDataDisplay(table);
>         final TextColumn<String> column = new TextColumn<String>() {
>
>             @Override
>             public String getValue(String object) {
>                 return object;
>             }
>         };
>
>         table.addColumn(column);
>
> table.setKeyboardSelectionPolicy(HasKeyboardSelectionPolicy.KeyboardSelectionPolicy.DISABLED);
>         table.addDomHandler(new KeyPressHandler() {
>             @Override
>             public void onKeyPress(KeyPressEvent event) {
>                 l.info("Key code:" + event.getNativeEvent().getKeyCode() +
> "; Key:" + event.getNativeEvent().getCharCode());
>             }
>         }, KeyPressEvent.getType());
>     }
>
>     public Widget getWidget() {
>         return rootElement;
>     }
> }
>
> When the line:
>
>  
> table.setKeyboardSelectionPolicy(HasKeyboardSelectionPolicy.KeyboardSelectionPolicy.DISABLED);
> is commented than the keyboard events are logged. When the line is not
> commented, no events are logged.
> I think this is a problem because regardless of the selection policy I want
> to receive keyboard events. CellList behaves the same.
>
> --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to