W3C home > Mailing lists > Public > public-forms@w3.org > May 2008

what happens if someone puts a model inside a form tag?

From: <Nick_Van_den_Bleeken@inventivegroup.com>
Date: Thu, 15 May 2008 17:50:02 +0200
To: public-forms@w3.org
Message-ID: <OFDFA95ACB.057564DA-ONC125744A.0026FE80-C125744A.0056FB63@inventivegroup.com>
All,


We have to decide what it means when a user adds an explicit model inside 
a form wrapper element :

<form name="F" ...> 
   ... 
   <model id="S1">
        ...
        <bind nodeset="number" type="card-number" 
constraint="is-card-number(.)"/>
        ...
   </model>
   ... 
   <!-- streamlined XForms markup --> 
</form> 

We decided yesterday that we are going to postpone nested models to XForms 
2.0 (as original planned and because of the work that is required on how 
we are going to support nested models in XForms). 
Therefore I see three possible solutions:

1. The implicit model created by the form element is a separate model  and 
the example form above has two separate models in its canonical XForms 
representation. This has the disadvantage that there is no possible to 
transfer data from one model to the other without doing submissions to the 
server (I know you can do it through scripting but this is hack/bug)


2. The explicit model replaces the implicit model. There is only one model 
so no inter model communication is necessary. But this has the 
disadvantage that all the MIPs and default values that are specified on 
the UI controls are lost.

3. The implicit model is merged with the first explicit model. This has 
the advantage that you can specify MIPs and default values on the 
UI-controls and use binds, submissions in the model for more advanced 
constructs (applying MIPs to all nodes with a certain name, define the 
submission parameters only once and reuse them in multiple 
submit-controls,...). We could even specify that the default values on the 
controls override the defaults in the default instance, this will require 
some modification to the current lazy authoring specification but they can 
be done locally and easily.


Example:


<form name="F" ...> 
   ... 
   <model id="S1">
        ...
        <bind nodeset="number" type="card-number" 
constraint="is-card-number(.)"/>

        <submission id="advanced-search" resource="
http://example.com/search" method="post" ... />
        ...
   </model>
   ... 
   <input ref="number" readonly="true()">
        <label>Credit card number</label>
   </input>

   <submit submission="search">
        <label>Search...</label>
   </submit>

</form> 


is 'transformed' to

<form name="F" ...> 
   ... 
   <model id="S1">
        ...
        <bind nodeset="number" type="card-number" 
constraint="is-card-number(.)"/>
        <bind nodeset="number" type="card-number" readonly="true()" />

        <submission id="search" resource="http://example.com/search" 
method="post" ... />
        ...
   </model>
   ... 
   <input ref="number" >
        <label>Credit card number</label>
   </input>

   <submit submission="search">
        <label>Search...</label>
   </submit>

</form> 


Nick Van den Bleeken  -  Research & Development Manager
Inventive Designers
Phone: +32 - 3 - 8210170
Fax: +32 - 3 - 8210171
Email: Nick_Van_den_Bleeken@inventivegroup.com
Inventive Designers' Email Disclaimer:   http://www.inventivedesigners.com/email-disclaimer =
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
--
Received on Thursday, 15 May 2008 15:50:56 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 October 2013 22:06:48 UTC