I have a flextable full of listboxes set to listBox.setVisibleItemCount(1), so they act as droplists. When clicked on with the left mouse button they expand and let the user select an item. Is it possible to mimic the mouse click with a key开发者_StackOverflow社区board key?
I've already tried to add keypress handler to the listbox that will fire a mousedown native event, but that did nothing.
Anyone have any idead?
Thanks in advance
I haven't found a solution yet for my problem but I have this workaround that works for now:
listBox.addBlurHandler(new BlurHandler() {
public void onBlur(BlurEvent event) {
ListBox listBox = ((ListBox)event.getSource());
SelectElement.as(listBox.getElement()).setSize(1);
}
});
listBox.addKeyPressHandler(new KeyPressHandler() {
public void onKeyPress(KeyPressEvent event ) {
if (event.getCharCode() == 32) {
ListBox listBox = ((ListBox)event.getSource());
SelectElement.as(listBox.getElement()).setSize(listBox.getItemCount());
}
}
});
精彩评论