0

Textbox.setText is not working for me - Help!

asked 2008-11-23 00:38:45 +0800

judacoor gravatar image judacoor
280 1 3 8

Here's my problem...
I've got a combobox and two textboxes, that get the info to put on a database, everything is working smoothly, but I just realized that it's better if I clean the text boxes after the insertion is made in the DB. So I did the following with no success:

if(DAOFactory.getDBSugeDAO().insert(suge)){

Messagebox.show("OK", "Success!", Messagebox.OK, Messagebox.INFORMATION);
combo.setSelectedIndex(0);
as.setValue(null);
as.setText(null);
com.setValue(null);
com.setText("");
}

But after line "combo.setSelectedIndex(0);" the thing throws and exception, for the textboxes have a constraint ("no emtpy") so I cannot set the text to "".

The thing is that when the page loads they appear with no text in them, and there's not a problem, but after they've been edited it seems I can't put them back to their initial state.

I've also thought about making the as = new Textbox(); but that would imply setting all of their attributes again, such as value, help, onBlur, etc.....


What can I do?

thanks in advance,

judacoor

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2008-11-23 06:10:22 +0800

madruga0315 gravatar image madruga0315 flag of Brazil
937 2 12

try

textbox.setRawValue("");// this way the constraint is not activated

Madruga

link publish delete flag offensive edit

answered 2008-11-23 07:24:22 +0800

judacoor gravatar image judacoor
280 1 3 8

thank you so much madruga!!

it worked perfectly!!

You rock!!!!


Thanks1!!!!!

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2008-11-23 00:38:45 +0800

Seen: 134 times

Last updated: Nov 23 '08

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More