W3C home > Mailing lists > Public > public-html@w3.org > July 2007

unify WF2 and XF

From: Dmitry Turin <html60@narod.ru>
Date: Thu, 28 Jun 2007 11:23:32 +0300
Message-ID: <89510955.20070628112332@narod.ru>
To: public-html@w3.org

(1) Unification WF2 and XF to hide-show and repeat html-elements.

WebForms2 give possibility to duplicate html-element
(with html-elements, enclosed into it).
Attribute  'repeat'
(and attributes 'repeat-start', 'repeat-min', 'repeat-max', accompanying to it)
can be added to any element.

<tr id="order" repeat="template">
  <td><input type="text" name="row[order].product"></td>
  <td><input type="text" name="row[order].quantity"></td>
  <td><button type="remove">Remove This Row</button></td>
</tr>
<tr>
  <td><button type="add" template="order">Add Row</button></td>
</tr>

It's unknown, is it possible in XForms to demonstrate another html-element 
depending on choice in radio-group (<input type=radio),
or either demonstrate or not demonstrate element depending on switching-on of
<input type=checkbox>,
but in any case it was burdened by two artificial manners:
'binding' and 'constraining values'.
Both these manners over-sophisticate and should be used optional.
Besides that, restriction of values is already developed in WebForms2
(attribute 'pattern' and new values of attribute 'type' of tag INPUT),
and there is no necessity to dublicate these possibilities.

<xforms:model>
  <xforms:instance>
    <ecommerce xmlns="">
      <method/>
      <number/>
      <expiry/>
    </ecommerce>
  </xforms:instance>
  <xforms:submission action="http://example.com/submit" method="post" id="submit"/>

  <xforms:bind nodeset="/payment/number" relevant="/payment/@method = 'cc'">
  <xforms:bind nodeset="/payment/expiry" relevant="/payment/@method = 'cc'">
</xforms:model>

<select1 ref="method">Select Payment Method:
  <item>Cash <value>cash</value> </item>
  <item>Credit <value>cc</value> </item>
</select1>
<input ref="number">Credit Card Number</input>
<input ref="expiry">Expiration Date</input>
<submit submission="submit">Submit</submit>

(1.1) In purpose of unification and simplification, i offer to use machanism,
applied in WebForms, instead XForms for demonstration of alternatives.

<tr id="ecommerce">
  <td><input type="text" name="number"></td>
  <td><input type="text" name="expire"></td>
</tr>
<tr>
  <td><input type="radio" name="method" value="cc"
       template="ecommerce">Show Row</button></td>
</tr>

or so

<tr id="ecommerce">
  <td><input type="text" name="number"></td>
  <td><input type="text" name="expire"></td>
</tr>
<tr>
  <td><input type="checkbox" name="method" value="cc"
       template="ecommerce">Show Row</button></td>
</tr>

(1.2) WebForms in existing state allows only to duplicate html-element,
but not to fill duplicated copies by values,
entered earlier through this document into some database.
I offer to add this possibility and to enter attributes
'repeat-data' (specifies identifier of element DATA with data) and
'repeat-right' (specifies _name of attribute_, containing rights of access to record,
e.g, value 'read' of attribute means,
that it's impossible to delete record by <button type="remove">).
Accordingly value of attribute 'repeat-start' should be interpreted as
quantity of empty (not filled) html-elements,
existing besides those, which are filled by attribute 'repeat-data'.

<tr id="order" repeat-data="records" repeat-right="r">
  <td><input type="text" name="product"></td>
  <td><input type="text" name="quantity"></td>
  <td><button type="remove">Remove This Row</button></td>
</tr>
<tr>
  <td><button type="add" template="order">Add Row</button></td>
</tr>

<data id="records">
  <order product="Tom figurine"   quantity="12" r="read">
  <order product="Jerry figurine" quantity="5"  r="operate">
</data>

Any user, who enter data, needs right to update, because he can make mistake
during inserting values. Anyone, who update fields, can write senseless values
or assign "null" into them - both that, and another is equivalent to deleting of
record. Right to update without right to read is looks very strange. Therefore
right to update is senseless without rights to delete and to read and should be
complemented by them - we shall name such whole right as right to operate
(operate = update + delete + read).

(2) Unification of WF2 and XF for sending xml-elements to server.

(2.1) For comportability with database of server,
WebForms2 should send the same constructions
(<order product= quantity= >), which browser was receive
(practice of indexes in xml-constructions primaraly perverted, irrelevance -
regardless of that, for what this constructions are used:
they can be applied not only for communication).

<formdata>
  <order product="Tom figurine"   quantity="12>
  <order product="Jerry figurine" quantity="5">
</formdata>

XForms discords with this format of sending

<formdata>
  <ecommerce>
    <method>cc</method>
    <number>1235467789012345</number>
    <expiry>2001-08</expiry>
  </ecommerce>
</formdata>

In purpose of unification, i offer to use only one of format for coding.
Since variant of XForms goes into cut with practice of database,
i offer to use format, applied in WebForms, in XForms

<formdata>
  <ecommerce method="cc" number="1235467789012345" expiry="2001-08">
</formdata>

(2.2) In spite of the fact, that XForms copies value of attribute
'id'=ecommerce into name of tag (ECOMMERCE),
WebForms2 should does not send the same, i.e.

<tr id="ord" repeat-data="records" repeat-right="r">

will not (!) send ORD

<data id="records">
  <ord product="Tom figurine"   quantity="12" r="read">
  <ord product="Jerry figurine" quantity="5"  r="operate">
</data>


Dmitry Turin
HTML6     (6.1.0)  http://html60.chat.ru
SQL4      (4.1.0)  http://sql40.chat.ru
Computer2 (2.0.2)  http://computer20.chat.ru
Received on Thursday, 5 July 2007 06:52:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:02 GMT