W3C home > Mailing lists > Public > www-forms@w3.org > January 2002

FW: XForms how-to

From: Plech¹míd Martin <Martin.Plechsmid@merlin.cz>
Date: Mon, 28 Jan 2002 17:22:57 +0100
Message-ID: <E50028F23FC6D3118B7D00609761083F015E6FD3@merkur.merlin.cz>
To: "'www-forms@w3.org'" <www-forms@w3.org>
Hello.

I have several things that I don't know how to do in XForms:

1) How to put a constraint on a set of data elements at once?
The problem is in that the xforms:bind element can have the attribute "ref"
only, not "nodeset". Having e.g.:
	<xforms:instance>
		<employee name="Karl" income="12345" />
		<employee name="Mark" income="2345" />
		<employee name="Peter" income="3458" />
		<employee name="John" income="23456" />
	</xforms:instance>
	<xforms:bind ref="employee/@income" type="xsd:int" />
this would put a constraint on Karl's @income only.

2) "readOnly" is not allowed on form controls. Thus, it seems impossible to
me to have a form field displayed on several places in a form, but editable
only on the place of its first occurence. I could write something like
	<xforms:instance>
		<name>Peter</name>
		<copy-of-name />
	</xforms:instance>
	<xforms:bind ref="copy-of-name" readOnly="yes" />
and somehow copy the value from "name" to "copy-of-name", but this a) seems
to me unnecessarily complicated (making the form control readOnly would be
simpler), b) seems to me even impossible, as the standard says nothing on
that readOnly data are not considered readOnly for updates by xforms actions
(in fact, it is stated explicitly in section 6.1.2 that the readOnly data
nodes' values cannot be changed).

3) Similarly with the "required" attribute: If a user forgets to fill in a
required data field, I have to tell him which _form_control_ he has to fill
in. What should I say to the user, if no form control corresponds to the
required data field (the data field can be e.g. calculated)?

4) Imagine the following scenario:
I want to build a form initialized with data taken from a database. These db
values are read into an xforms:instance section of a xforms:model. But the
form contains also other controls that are not to be initialized. As some
instance data must correspond to them, there must be another xforms:instance
section, distinct from the first instance. And because (a subset of) _both_
the initialized and non-initialized data needs to be submitted back to the
server, the values from the first instance would have to be copied into the
corresponding fields in the second instance.
  If what I said here is true, having to have several "xforms:model"s for
each form complicates the forms authoring too much.

	Thank you,
			Martin.
Received on Monday, 28 January 2002 11:17:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:21:50 GMT