Hello All,
  I've been trying to wrap my mind around this.
  I have a ValueBoject model that has a date properties and number
properties (one of many) that are bound to a TextInput fields on a form.
  What's the best way to handle two-way data validating that the text
input has a valid date in it.  More importantly, how do you bind a
specifically formatted date from the Model.
  Say my model has a valid Date on it, and I want to have it displayed
in a textBox as 12/10/2007.  The user changes the text box, and then I
want the model to have a valid Date object from the input text.  The
key here is that the format input by a user and the format displayed
in the TextInput is different than the raw data that is bound to the
model.
  What to do if I bind a new date that hasn't been set in the model
yet and I want something like a "-" (Hyphen) to appear in the form.
  It seems like the default databinding functionality breaks down
pretty quickly.  What are some of the techniques people use to convert
items on a VO object for display purposes in a form, take form input
and format it for specific model data?
  Or, do I just need to not use default databinding of my model to
form inputs and instead have a method, that takes the VO, and manually
binds the data, doing the appropriate conversions as necessary.  And
then to go the other way, after the form has been filled in and is
validated, covert to the model? 

Thanks for any suggestions.

Reply via email to