I already tried using a SubmitLink. The problem with that is user have to complete the whole form (or at least the required fields) before they can disable the field with the link. This is because validate() is called when the form is submitted, and users receive a message they have to fill in the required fields.I want users to be able to disable the field even though they did not fill in all the (required) fields.

Secondly, when the form is submitted, the model is send to the database. I only want to send the model to the database when the user is completely finished with the form, and not when they want to disabled the second field of the form. But this can be solved by calling findSubmittingButton() in the onSubmit().


martinf wrote:
Maybe SubmitLink is your solution,

usage as an anonymous class could look like this:

                add(new SubmitLink("lkjsdf", form) {
                        public void onSubmit() {
                               //Do what you need to do here.
                        }
                });

that way the browser will submit the form and send al the date in the input
fields.


Martin


Mattijs Hoitink wrote:
hi,

i'm just starting to use wicket and i have a question regarding updating
a model when a link is pressed. I will explain my situation.

I have a normal form, with a model attached to it and a button to submit
it. There is also a link in the form who's only purpose is to enable or
disable a field.
The problem is, when i  press the link to disable the field, all my data
from the other fields is lost. It seems like wicket is loading a new
form when i presse the link, because all the old data from the model is
presented.

My question is: is it normal wicket loads the page again when a link is
pressed? and if so, is there a way to update my model first?

--
Mattijs Hoitink
Func. Internet Integration
W http://www.func.nl
T +31 20 4230000
F +31 20 4223500


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Mattijs Hoitink
Func. Internet Integration
W http://www.func.nl
T +31 20 4230000
F +31 20 4223500


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to