Yeah, it could be named better :)
Well... do you guys have any concrete proposals of what would work for
your use case?
I need to go shortly, so I won't be able to join this discussion for
much longer.
Eelco
On 10/11/05, Phil Kulak <[EMAIL PROTECTED]> wrote:
> But the problem is that even components without error are redisplayed,
> so you have to call invalid() on every component in the form, which
> sounds like an abuse given its current name. If it were called
> storeValue() or something, it would seem much more elegant. ;D
>
> On 10/11/05, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > Nope, not if an error is registered. You can set a form component to
> > the 'error state' by calling public method FormComponent.invalid. That
> > will cause the component to temporarily display the user input instead
> > of the model value. That should work. If it doesn't, it's a bug.
> >
> > Eelco
> >
> >
> > On 10/11/05, Phil Kulak <[EMAIL PROTECTED]> wrote:
> > > Oh yea, that doesn't bother me. The problem I have is that Wicket
> > > reads from the model on every request to populate the field again, so
> > > when you have getters that return user types, you end up with that
> > > type's toString() in the text field, not what the user actually typed.
> > > I could buffer that in the model, I suppose, and kind of turn it into
> > > a write-only model.
> > >
> > > On 10/11/05, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > > > If you know for sure your business objects will throw such exceptions,
> > > > that'll work. It isn't very explicit though, but it might be the
> > > > quickest way to implement it.
> > > >
> > > > Eelco
> > > >
> > > > On 10/11/05, Phil Kulak <[EMAIL PROTECTED]> wrote:
> > > > > That part's easy enough:
> > > > >
> > > > > protected void onSetObject(Component component, Object object) {
> > > > > try {
> > > > > super.onSetObject(component, object);
> > > > > } catch (FormValidationException e) {
> > > > > component.error(e.getMessage());
> > > > > }
> > > > > }
> > > > >
> > > > > On 10/11/05, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > > > > > Setting the messages works great. That's not the problem though,
> > > > > > the problem
> > > > > > is how to map the messages from middle layer validation to wicket
> > > > > > components. Ie, if my middle layer returns an error with key
> > > > > > entity.field1.field2 how do I easily map that on to the appropriate
> > > > > > textbox
> > > > > > in the wicket form so I can call the message func on it.
> > > > > >
> > > > > > -Igor
> > > > > >
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: [EMAIL PROTECTED]
> > > > > > > [mailto:[EMAIL PROTECTED] On Behalf
> > > > > > > Of Eelco Hillenius
> > > > > > > Sent: Tuesday, October 11, 2005 12:42 PM
> > > > > > > To: [email protected]
> > > > > > > Subject: Re: [Wicket-develop] Just a thought...
> > > > > > >
> > > > > > > You can set the messages for Wicket as-is. So if you have
> > > > > > > translated/ localized messages you want to expose, just do.
> > > > > > > No need to make things harder than that.
> > > > > > >
> > > > > > > Eelco
> > > > > > >
> > > > > > >
> > > > > > > On 10/11/05, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > > > > > > > I think it solves the usecase of validation done in the
> > > > > > > middle layer
> > > > > > > > instead of using wicket's validators. The problems are: how do
> > > > > > > > you
> > > > > > > > aggregate validation messages from your validation, and how
> > > > > > > do you map
> > > > > > > > those messsages back onto wicket components.
> > > > > > > >
> > > > > > > > -Igor
> > > > > > > >
> > > > > > > >
> > > > > > > > > -----Original Message-----
> > > > > > > > > From: [EMAIL PROTECTED]
> > > > > > > > > [mailto:[EMAIL PROTECTED] On Behalf Of
> > > > > > > > > Eelco Hillenius
> > > > > > > > > Sent: Tuesday, October 11, 2005 11:56 AM
> > > > > > > > > To: [email protected]
> > > > > > > > > Subject: Re: [Wicket-develop] Just a thought...
> > > > > > > > >
> > > > > > > > > It would be interesting to see what you did, when you
> > > > > > > solved it, and
> > > > > > > > > look at what kind of use cases it can solve. Keep up
> > > > > > > > > informed! :)
> > > > > > > > >
> > > > > > > > > Eelco
> > > > > > > > >
> > > > > > > > > On 10/11/05, Phil Kulak <[EMAIL PROTECTED]> wrote:
> > > > > > > > > > It's definitely a syntactic sugar kind of thing. I've got a
> > > > > > > > > form right
> > > > > > > > > > now with many text boxes that represent complex user
> > > > > > > types and it
> > > > > > > > > > seems tedious to do all that validation and conversion
> > > > > > > after the
> > > > > > > > > > submit, or to override updateModel() on every component.
> > > > > > > > > >
> > > > > > > > > > I never thought about doing it as a model though. I
> > > > > > > think I'm just
> > > > > > > > > > going to do that so there's no need to petition for it to
> > > > > > > > > be part of
> > > > > > > > > > the core.
> > > > > > > > > >
> > > > > > > > > > On 10/11/05, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > > > > > > > > > > What actual use cases are you thinking of that can't be
> > > > > > > > > done by forms?
> > > > > > > > > > > Your idea could be implemented as a special model. I'm
> > > > > > > > > not sure what
> > > > > > > > > > > the advantage over the normal form processing is though.
> > > > > > > > > > >
> > > > > > > > > > > Eelco
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > On 10/11/05, Phil Kulak <[EMAIL PROTECTED]> wrote:
> > > > > > > > > > > > What do you guys think about something like this: you
> > > > > > > > > have a model
> > > > > > > > > > > > object with a bunch of setters that take Strings and
> > > > > > > > > ints and so
> > > > > > > > > > > > forth, and getters that return complex user types. In
> > > > > > > > > the setters
> > > > > > > > > > > > validation and conversion takes place, with a special
> > > > > > > > > > > > exception thrown on failure, the message of which
> > > > > > > is picked up
> > > > > > > > > > > > by
> > > > > > > > > Wicket and
> > > > > > > > > > > > set on the component. Comments, questions?
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > -------------------------------------------------------
> > > > > > > > > > > > This SF.Net email is sponsored by:
> > > > > > > > > > > > Power Architecture Resource Center: Free content,
> > > > > > > downloads,
> > > > > > > > > > > > discussions, and more.
> > > > > > > > > http://solutions.newsforge.com/ibmarch.tmpl
> > > > > > > > > > > > _______________________________________________
> > > > > > > > > > > > Wicket-develop mailing list
> > > > > > > > > > > > [email protected]
> > > > > > > > > > > > https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > -------------------------------------------------------
> > > > > > > > > > > This SF.Net email is sponsored by:
> > > > > > > > > > > Power Architecture Resource Center: Free content,
> > > > > > > > > > > downloads,
> > > > > > > > > > > discussions, and more.
> > > > > > > > > > > http://solutions.newsforge.com/ibmarch.tmpl
> > > > > > > > > > > _______________________________________________
> > > > > > > > > > > Wicket-develop mailing list
> > > > > > > > > > > [email protected]
> > > > > > > > > > > https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > -------------------------------------------------------
> > > > > > > > > > This SF.Net email is sponsored by:
> > > > > > > > > > Power Architecture Resource Center: Free content, downloads,
> > > > > > > > > > discussions, and more.
> > > > > > > http://solutions.newsforge.com/ibmarch.tmpl
> > > > > > > > > > _______________________________________________
> > > > > > > > > > Wicket-develop mailing list
> > > > > > > > > > [email protected]
> > > > > > > > > > https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > -------------------------------------------------------
> > > > > > > > > This SF.Net email is sponsored by:
> > > > > > > > > Power Architecture Resource Center: Free content, downloads,
> > > > > > > > > discussions, and more.
> > > > > > > > > http://solutions.newsforge.com/ibmarch.tmpl
> > > > > > > > > _______________________________________________
> > > > > > > > > Wicket-develop mailing list
> > > > > > > > > [email protected]
> > > > > > > > > https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > -------------------------------------------------------
> > > > > > > > This SF.Net email is sponsored by:
> > > > > > > > Power Architecture Resource Center: Free content, downloads,
> > > > > > > > discussions, and more.
> > > > > > > > http://solutions.newsforge.com/ibmarch.tmpl
> > > > > > > > _______________________________________________
> > > > > > > > Wicket-develop mailing list
> > > > > > > > [email protected]
> > > > > > > > https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > -------------------------------------------------------
> > > > > > > This SF.Net email is sponsored by:
> > > > > > > Power Architecture Resource Center: Free content, downloads,
> > > > > > > discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl
> > > > > > > _______________________________________________
> > > > > > > Wicket-develop mailing list
> > > > > > > [email protected]
> > > > > > > https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > -------------------------------------------------------
> > > > > > This SF.Net email is sponsored by:
> > > > > > Power Architecture Resource Center: Free content, downloads,
> > > > > > discussions,
> > > > > > and more. http://solutions.newsforge.com/ibmarch.tmpl
> > > > > > _______________________________________________
> > > > > > Wicket-develop mailing list
> > > > > > [email protected]
> > > > > > https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > > > >
> > > > >
> > > > >
> > > > > -------------------------------------------------------
> > > > > This SF.Net email is sponsored by:
> > > > > Power Architecture Resource Center: Free content, downloads,
> > > > > discussions,
> > > > > and more. http://solutions.newsforge.com/ibmarch.tmpl
> > > > > _______________________________________________
> > > > > Wicket-develop mailing list
> > > > > [email protected]
> > > > > https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > > >
> > > >
> > > >
> > > > -------------------------------------------------------
> > > > This SF.Net email is sponsored by:
> > > > Power Architecture Resource Center: Free content, downloads,
> > > > discussions,
> > > > and more. http://solutions.newsforge.com/ibmarch.tmpl
> > > > _______________________________________________
> > > > Wicket-develop mailing list
> > > > [email protected]
> > > > https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > >
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by:
> > > Power Architecture Resource Center: Free content, downloads, discussions,
> > > and more. http://solutions.newsforge.com/ibmarch.tmpl
> > > _______________________________________________
> > > Wicket-develop mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by:
> > Power Architecture Resource Center: Free content, downloads, discussions,
> > and more. http://solutions.newsforge.com/ibmarch.tmpl
> > _______________________________________________
> > Wicket-develop mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/wicket-develop
> >
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> Wicket-develop mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
>
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop