RE: FW: XForms how-to - Question 3

Hello.

> The author is responsible for ensuring that it is possible to supply a
> value for such an instance data node, this MAY be by binding 
> a form control
> that would allow the user to supply a value to the node or it 
> may be by an
> xforms action such as setValue or even by a script.

You're maybe right, though I'm not sure completely - having still the same
situation with invisible constrained instance-nodes in my mind. But let me
begin from another side:

When a form is submitted, constraints on its content (="xforms:bind"s) need
to be checked. But checking them on the client side is not enough, the
server cannot trust that the client checked the data properly. Hence, it is
natural to require that the client and the server used a common file
defining constraints onto the submitted data. But the point is that the
constraints are used to constrain the submitted data, not the way how they
were obtained.

Now back to our topic. If an instance node is set by setValue and no form
control is tied with it, you say that it is the form's author's
responsibility to tell the user which form control is badly filled. This
approach would result in authors misusing constraints and actions for the
purpose of determination of the right form control that the user must
re-enter, instead of focusing on their tasks and putting the constraints on
the form itself (as I described in the previous paragraph - ignoring that it
is not possible to do it in the current version of xforms (because I can put
xlink:href on individual "xforms:bind"s only, I'm not able to import a set
of binds)). 

The solution would be either in automating the determination of the right
form control that the user has to re-enter, which would probably require a
run-time analysis of the xpath expression in the "value" attribute of the
xforms:setValue element, and an ability to tell automatically which input
value caused the result not to satisfy the constraints. Or allowing to put
the "required" and similar attributes also on the form controls.

Summing it all up:
  1. I suggest to group the "xforms:bind"s in "xforms:model"s, in order to
be able to import all related constraints from a file at once.
  2. I suggest to allow "required" (and "readOnly") attribute on form
controls.

Best regards,
		Martin.

Received on Thursday, 31 January 2002 04:29:56 UTC