Then allow me to call default process() method from my onSubmit()
method, or to call finer-grained validate(), update(), etc. instead of
process(). This is it. If I want default event handling (which I
do you mean Button.onSubmit or Form.onSubmit?
i don't think we could change the meaning of Form.onSubmit() this late
in the game.
we could perhaps provide a subclass of Form where the meaning of
Form.onSubmit
is different... but there are just too many wicket users with Forms out
there already
to be changing this.
btw, i argued for a long time (feel free to go back through the
archives) against calling
this method onSubmit() because that's not what it is. it's more like
onValidSubmit()...
and i think that's the name i was arguing at the time... but people
overruled me and
said it should be called onSubmit() "because that's what people are used
to"... it appears
now that i was right. if we had called it onValidSubmit(), we could now
implement
onSubmit() for manual control of the submit process exactly the way you
are suggesting...
oops!
we could fix this by implementing a subclass like ManualForm where
onValidSubmit()
is what Form.onSubmit() is and where you can provide your own logic for
onSubmit(),
calling process() or validate() etc. as you please.
Michael Jouravlev wrote:
Well, how Wicket is going to be better than Struts or JSF if you are
doing the same thing? A lot of built-in call sequences that are hard
to override. Same as with Struts reset/populate/validate. Everyone can
turn off validation by setting parameter in xml file, but it is
impossible to turn reset or population off.
Same happens in Wicket, and a lot. Why do you want to do everything
automatically? I want to have an option: to do it either myself or to
delegate it to the framework. Consider above fragment:
// when processing was triggered by a Wicket button and
// that button indicates it wants to be called immediately
// (without validating), call onSubmit right away.
if (submittingButton != null && (submittingButton.isImmediate()))
{
submittingButton.onSubmit();
}
else
{
// validation, error handling, model updating,
// delegating submit (to button and form)
...
}
Throw out this "immediate" flag and just leave it like this:
// when processing was triggered by a Wicket button and
// that button indicates it wants to be called immediately
// (without validating), call onSubmit right away.
if (submittingButton != null)
{
submittingButton.onSubmit();
}
else
{
// validation, error handling, model updating,
// delegating submit (to button and form)
...
}
Then allow me to call default process() method from my onSubmit()
method, or to call finer-grained validate(), update(), etc. instead of
process(). This is it. If I want default event handling (which I
usually will want to), I will call process(). It is so much simpler to
write one line of code and to see what is actually happening, than to
figure out who and when will can your handler.
Michael.
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user