Hi.
The problem is, that I don't want to validate the form, unless user
clicks 'OK'. The model is updated after validation only. But the
'choose' button should NOT validate the form.
I don't think it's a good thing storing the temporary values in model
(at least in my case), because model is typed. The temporary values
should only be strings (get from Http request).
-Matej
Johan Compagner wrote:
Just one extra remark.
Why can't use just use a model for this?
And that model is an in between model for you real model object?
Ok you have to do youre validation a bit different (it can't be between
Form->Model
but it has to be between TmpModel->RealModel
This looks to me like a much better way to have multiply page forms...
johan
On 11/13/05, *Matej Knopp* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:
Hi.
I know this has been discussed already, but still I'm opening it once
more. I think there should be a way to preserve form state without
validation and model updating.
The use case is following.
I have a (complex) form with some fields, that can not be entered
directly, i.e. they have to be selected on other page. So I need to move
between pages, but I don't want to lose any information entered on the
previous page. If I use Button, the form gets processed, validated, etc
and the action won't execute unless all entered data is valid. If I turn
defaultProcessing off, the action executes, but the data (not written to
model yet) is lost.
What I'm using now is little hacky, but it works. I have my own class
derived from Form, my own SubmitButton, ImmediateButton and
FeedbackPanel. ImmediateButton acts like classic Button with
defaultFormProcessing turned off, but unlike it, ImmediateButton stores
the state in each component (in the string reserved for invalid data).
So there's my own Feedback panel (Although filter would be probably
enough) that detects that ImmediateButton was clicked and hides
validation messages (there's a lot of them, because ImmediateButton
marks every component as invalid).
This approach works pretty well, but doesn't feel quite right. I think
there definitely should be a way to preserve form state (without
validation and updating model) directly supported by wicket.
Not to mention that (if I recall correctly) the string field in
FormComponent used for storing invalid data is transient.
Btw. I've managed to persuade people from my company to use wicket for
one of our projects. Since I do most of the current development, it's
not a big deal, because I've personally been using wicket for some time
now. But I can say they are really impressed with the productivity and
simplicity of certain actions (like moving between complex pages forth
and back ;) - that are sometimes quite difficult and cumbersome in
struts.
Not to mention excellent DataView and DatePicker components, markup
inheritance and compoents in general.
Kudos wicket team, you're doing excelent work!
Sorry for really long mail,
-Matej
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Wicket-user mailing list
[email protected]
<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user