Well, I just let the server chunk the bad values and return to the good
(old) values while telling the user about what was wrong. That's the
behavior I was looking for. In my case I wire the UI element right into
values on the EO. The EO itself is rejecting this state. If I wanted the
app to remember the bogus values I would wire them to page ivars and
then have an action mehtod set these values on my EOs. That way whent he
EO barfed back the bad tasting state, the values would still be there in
the page ivars.
d
Patrick Robinson wrote:
>
> Do you also re-insert the invalid value back into the UI element, so
> that the user has the "bad" value in front of him to work with, as
> Holger suggested?
>
> If so: do you provide a way for the user to either get out of the page
> without making any changes, or a way to reload the saved values (since
> an HTML Reset button won't do the trick at this point)?
>
> If not: I suppose the user could cut/paste the bad value from the error
> message back into the appropriate form field(s), and then edit them...?
>
> I'm just wondering how people usually handle this.
>
> David Neumann wrote:
> > I use it to stuff the info from each exception into an array of
> > dictionaries. Then I have a reusable component that displays the dicts
> > on the page listing all the bogus things that user tried to do on that
> > request... this was null and shouldn't be, your age is negative, you
> > can't have your sister be your mother, etc...
> >
> > Patrick Robinson wrote:
> > >
> > > WOComponent has a new method in WO4,
> > >
> > > -validationFailedWithException:value:keyPath:
> > >
> > > It gets called during the takeValues phase. Looks like it gets called
> > > once for each property that fails validation. I'm wondering how this
> > > was intended to be used? I can imagine having it set some variables
> > > that would control the behavior of an action method (e.g. set some
> > > "validation failed" messages and maybe redisplay the page vs. calling
> > > tryToSaveChanges and returning to another page), but I'm wondering
> > > whether there's a more elegant usage that I'm just not thinking of...?