I think what David is saying is that your misdiagnosing the problem. Validation is not resetting the value; it's just failing to save, and the next page load is fetching whatever's in the database, which is the old value.Could you post the could the generates the form, and the code that retrieves the mapper instance?
On Tue, Aug 25, 2009 at 3:52 PM, harryh <[email protected]> wrote: > > > I'm not sure I understand what you're suggesting. Can you be a little > more > > explicit about your suggestion? > > OK, so I'm editing an existing Thing with name currently = > "Harry" (which is valid as it has >= 5 chars) > > I do a GET /editThing?id=12 > > in return I get a form which contains (among other things): > > <input type="text" name="AGUID" value="Harry" /> > > I change the value of the field to "Bob" and press submit which does a > POST /editThing and down in the HTTP body is > > AGUID=Bob > > Up on the server this doesn't validate, so it doesn't save the Thing > with this new value, so it sends back the form again. While rending > the form, inside one of my snippets I call someThing.name.toForm. The > implementation of this function, when it is creating the <input> > element and setting it's value. Rather than blindly setting the value > to to theThing.name ("Harry") could check S.attr("AGUID") and, if it > exists, set the value of the field to that instead. > > So a POST that resulted in errors would, by default, render the form > with the user entered values (some of which could be invalid) still > there making it easy for the user to make corrections and resubmit. > > -harryh > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---
