-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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
try
textbox.setRawValue("");// this way the constraint is not activated
Madruga
Asked: 2008-11-23 00:38:45 +0800
Seen: 134 times
Last updated: Nov 23 '08