Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Editable combobox events

 
thejaswini ramesh
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
This particular problem has been bothering me for some time now.I have a simple application which consists of an editable combobox,a "send" button,a checkbox("echo") and a non editable textarea where information is logged.
It works like this...a command is entered in the combo(which is also stored for later use in the combo),if echo is ticked then cmd and response are displayed in the textarea,else only response is displayed.To send the command,user can either click "send" button or press enter.
I have used actionListener for the combo(not for the send button) since it fires a comboboxEdited and comboboxChanged whenever a change is done.This is doing the required task.But the problem occurs when there is no change in the combo(like if you just choose a previous command) and the user decides to click "send".Because there is no listener for send,nothing happens.But if i add a listener for send,then clicking of send results in data being logged twice(one for comboboxEdited and the other for send).I have also tried to use a keylistener for the combo,but tht also does not work.can someone throw some light on ths problem(sorry its been lengthy!)...

Thanks in advance,
Thejaswini.
[ April 12, 2006: Message edited by: thejaswini ramesh ]
 
todd runstein
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't get this:

> if i add a listener for send,then clicking of send results in data being logged twice

Why? Why don't you have this listener do something different? Have it not log.

Perhaps I don't understand what you're trying to do, but I hope this helps.
 
thejaswini ramesh
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Todd,
The basic requirement is whether the user clicks the send button or hits enter key,the command typed in the editable combobox(or prev cmd chosen from the combo) should be displayed in the textarea.Can you tell me how to do this?
Thanks,
Thejaswini.
 
thejaswini ramesh
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Todd,
The basic requirement is whether the user cicks the send button or hets enter key,the command typed in the editable combobox(or prev cmd chosen from the combo)should be displayed in the textarea.Can you please tell me how to do this?

Thanks,
Thejaswini.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!