Extending the standard controls


I am looking at extending some of the in-built XForms controls and
wondering what is the most standards aligned (and thus
cross-implementation compliant) way of doing this.

As an example one customer asked me about an inline edit control such
as jeditable[1]. I know that Steven Pemberton has demonstrated a
similar capability as shown in XForms for HTML Authors Part 2 [2].

Now whilst Steven's approach is very smart and does make use of the
XForms standards to achieve the inline editing function it is
bordering on programming* - see below.

   <case id="showName">
      <trigger appearance="minimal">
         <label ref="name"/>
         <toggle case="editName" ev:event="DOMActivate"/>
   <case id="editName">
      <input ref="name">
          <toggle case="showName" ev:event="DOMFocusOut"/>

I would have thought that rather than having code as per the snippet
above we would have a declarative extension mechanism such that you
could define something along the lines of.

<input ref="name" xxf:apperance="inline-editable">

For some controls such as the one above there would be sensible
fall-back behaviour if the implementation does not support the
extension - in this case simply showing a normal input field.

Locally I could achieve what I want by declaring my inline editable
inputs as per the snippet above which are expanded to a full working
XForm (e.g. using Steven's logic) via a pre-processing XSLT. As I
mentioned however I am looking for a mechanism that makes the form as
portable as possible. A different approach is followed by Orbeon which
- as far as I understand - uses XBL to allow extensions to be defined.
Is XBL the preferred way of adding these extensions?

Finally - I had some hope for these sorts of things being done via
http://www.exforms.org/ however this does not appear to have been

Any feedback on what the recommend approach should be is greatly appreciated.


[1] http://www.appelsiini.net/projects/jeditable
[2] http://www.w3.org/MarkUp/Forms/2010/xforms11-for-html-authors/part2.html#Trigger
* Not that programming is bad, just that it goes against the
declarative nature of XForms
Michael Odling-Smee | www.xml-solutions.com

Received on Friday, 7 March 2014 20:43:09 UTC