Re: FW: XForms how-to

Greetings Martin, I'll try and deal with your items 1 at a time.

1) This area does seem subject to some confusion and is being considered
within the Working Group. When you have a homogeneous collection of items
such as those in your example they are a natural candidate for binding with
a repeat. Because all the elements which constitute a repeating set do not
have to appear in the original markup it is necessary for the BIND to refer
to all the elements to which they will eventually need to be bound. So,
your bind:

<xforms:bind ref="employee/@income" type="xsd:int" />

would apply the type to all the elements not just the first.

2) The element <name /> should not be readOnly, as you state the user needs
to be able to supply a value. We supply two form controls which you should
use. <input /> should be used in the circumstance that the user is allowed
to change the value and <output /> should be used when you wish to display
the value but not allow it to be changed.

3) I'm not sure what you are asking here. If an element is required to have
a value and none is supplied then any form control bound to that element
will need to explain that the required constraint has not been satisfied.
If no form control is bound to an element which requires a value and for
which none is supplied, this is an authoring error which the user cannot
fix.

4) If you application requires information from two sources and that a
subset the "blended" combination is submitted, then this could be tackled
by merging the two inputs into a single instance at the server (i.e.
outside the scope of XForms) and designing the merged structure such that
the appropriate subset can be specified by the "single node binding
attributes" of a submitInfo.

Regards, Roland
Ease of Use Strategy
Tel: +44 (0)1926-465440,   Fax: +44 (0)1926-465323, Mobile:  +44
(0)773-0300-937
Internet: Roland_Merrick@uk.ibm.com
Ease of Use:     http://www.ibm.com/easy/           http://w3.ibm.com/easy/


                                                                                                         
                    Plech?míd Martin                                                                     
                    <Martin.Plechsmid@       To:     "'www-forms@w3.org'" <www-forms@w3.org>             
                    merlin.cz>               cc:                                                         
                    Sent by:                 Subject:     FW: XForms how-to                              
                    www-forms-request@                                                                   
                    w3.org                                                                               
                                                                                                         
                                                                                                         
                    28/01/2002 16:22                                                                     
                                                                                                         
                                                                                                         




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 Tuesday, 29 January 2002 09:12:48 UTC