-
21 Sep 2010 5:45 PM #1
Pressing 'Enter' key that triggers a button causes issue on TextArea
Pressing 'Enter' key that triggers a button causes issue on TextArea
Hi,
I'm using the code below to trigger buttons when the enter key is clicked in a Dialog. The problem arises when I have a TextArea in the Dialog. This implementation will not allow new lines in the TextArea because it will always trigger the buttons. Can anyone suggest how to fix this issue? Thanks
new KeyNav(this) {
@Override
public void onEnter(ComponentEvent ce) {if (okButton.isVisible() && okButton.isEnabled()) {};okButton.focus();} else if (applyButton.isVisible() && applyButton.isEnabled()) {
okButton.fireEvent(Events.Select);
applyButton.focus();} else if (closeButton.isVisible())
applyButton.fireEvent(Events.Select);
closeButton.fireEvent(Events.Select);}
-zet
-
22 Sep 2010 1:25 AM #2
You can check the target element and if the targetelement is the TextArea, dont do your actions.
-
22 Sep 2010 5:45 PM #3
Similar Threads
-
Allow Pressing Enter key in the TextArea in EditorGrid
By MickeyMiner in forum Ext GWT: DiscussionReplies: 3Last Post: 8 Jul 2010, 6:46 AM -
Simulate tab key by pressing enter key
By hpet in forum Ext 2.x: Help & DiscussionReplies: 4Last Post: 29 Jun 2009, 1:38 AM -
Issue when enter key pressed within textarea
By vijaypr.chak in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 26 Aug 2008, 11:32 AM


Reply With Quote