Currently, dataform stores intermediate form values as an associated
list of fields and values, and this list is passed to render-view-
field.  render-view-field then prints this as the value of the field
if the field is present in the list, and otherwise, just prints the
value of the field using obtain-view-field-value .  In cleaning up my
changes to formview for javascript events on the field (like
onChange), I wanted to have the callback that the javascript event
calls automatically set the intermediate form values of the form.
This seems like the common use case - onChange might want to do
something like check the value of the field and print some error
message when redrawing the widget, but you would want to retain the
value that was entered.  The problem with this became that since these
intermediate values are set at the widget level (in dataform) and not
actually stored anywhere in the view, my callback would have to break
this abstraction (essentially, I have a function that gets called by
initiateFormAction, and in this function I want to set the
intermediate form value and then call the callback that the user
provides, but to do this, I need to set the intermediate form value on
the widget from a function that is being called in formview).

My solution to this was to remove intermediate-form-values from the
dataform widget.  Instead, I would add a field to form-view-field that
stores intermediate values, and change the obtain-view-field-value to
return this value instead of the field's value when it is set.  It
seemed like the way intermediate-form-values is currently being done
is a bit hackish as it is (I feel like the view is responsible for
maintaining the actual fields that are being displayed and their
rendering).  Plus, having this value at a the form field level doesn't
keep the dataform widget from still accessing it.  Does anyone have
any objections to this change/is there anything I am overlooking?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"weblocks" 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/weblocks?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to