Hi all,
I'm facing a problem with focusInItem(). In my page I have a TextAreaItem TA and below that 5 TextItems T1,T2,T3,T4 and T5.
In the KeyPressHandler of TA I want to set focus on T1 that means I want set the cursor in T1. I used the code like :
TA.addKeyPressHandler(new KeyPressHandler() {
@Override
public void onKeyPress(KeyPressEvent event) {
if (event.getKeyName().equals(KeyNames.TAB)) {
T1.focusInItem();
}
}
});
But the focus is not set in T1 instead it is setting on T2. If I use T2.focusInItem() in the KeyPressHandler , the focus is not set in T2 and it is setting on T3. I can't remove TextAreaItem and of course I want to set the KeyPressHandler in TextAreaItem. I need help.
I'm facing a problem with focusInItem(). In my page I have a TextAreaItem TA and below that 5 TextItems T1,T2,T3,T4 and T5.
In the KeyPressHandler of TA I want to set focus on T1 that means I want set the cursor in T1. I used the code like :
TA.addKeyPressHandler(new KeyPressHandler() {
@Override
public void onKeyPress(KeyPressEvent event) {
if (event.getKeyName().equals(KeyNames.TAB)) {
T1.focusInItem();
}
}
});
But the focus is not set in T1 instead it is setting on T2. If I use T2.focusInItem() in the KeyPressHandler , the focus is not set in T2 and it is setting on T3. I can't remove TextAreaItem and of course I want to set the KeyPressHandler in TextAreaItem. I need help.
Comment