isValid and getFeedbackMessage
Hi, Can i change TextField's (FormComponent) valid status and set a custom error message from outside ? Like : TextFieldString txtname = new TextFieldString(..) // setting valid false and custom error message if (!txtname.isValid) { // get custom error message now String error = txtname.getFeedbackMessage().getMessage().toString() } Thanks. -- *Altuğ* ** http://www.kodcu.com
RE: isValid and getFeedbackMessage
Can i change TextField's (FormComponent) valid status and set a custom error message from outside ? Like : Normally you write a validator that calls component.error() to set the error message, and add that validator to the FormComponent. As long as it has that error it will count as invalid. - Tor Iver
Re: isValid and getFeedbackMessage
I try to print business exception below the related form components so here is solution i found : final TextFieldString txtName = new TextFieldString(txtName , new PropertyModelString(name, name)) { @Override protected void onRender(MarkupStream markupStream) { super.onRender(markupStream); this.getResponse().write( div class=\errorView\ + error.getObject() + /div); } }; Thanks. 2011/2/3 Wilhelmsen Tor Iver toriv...@arrive.no Can i change TextField's (FormComponent) valid status and set a custom error message from outside ? Like : Normally you write a validator that calls component.error() to set the error message, and add that validator to the FormComponent. As long as it has that error it will count as invalid. - Tor Iver -- *Altuğ* *www.kodcu.com* http://www.kodcu.com**