W3C home > Mailing lists > Public > www-forms@w3.org > August 2006

Re: Reusing a form in another form

From: Mark Birbeck <mark.birbeck@x-port.net>
Date: Tue, 1 Aug 2006 22:58:51 +0100
Message-ID: <640dd5060608011458y42bf248fj111eaee2e6e36426@mail.gmail.com>
To: www-forms@w3.org

Hi Alessandro,

> Is there a recommended technique for reusing small forms as components of a
> larger form?

Well that's a coincidence! We have just recently implemented exactly
this feature, in a few different ways.

The easiest is to use XInclude in the source document, but this means
you need to pre-process the document. We've been doing that for one of
our projects, but recently added XInclude support to the client
software too.

However, the main use-case for this project was that of 'deferred
loading'; we wanted to load sub-forms as the user moved around the
form, for example loading different cases as the user toggled a
switch. The idea is that even over slow network connections the user
will experience a quick initial load of the form. (The alternative is
to hop from form to form, but we don't want to do that for obvious

This last technique is fairly easy to implement, provided that the
XForms processor can dynamically add controls after the form has been
loaded. Also, there's nothing in the XForms spec to prevent xf:model
from appearing anywhere in the document too (which some people might
have trouble with philosophically!), which has allowed us to create
complete sub-forms that we can re-use in many situations.

To allow the author to indicate where to get the 'sub-form' from,
where to put it once it has been loaded, and when to do all of this,
we currently use xf:load with the addition of the "embed" XLink value
and a @target attribute.

This is, of course, non-standard, and we're still experimenting, but
the main point is that it's an incredibly powerful feature, and
somehow or other it should be supported.



On 01/08/06, Alessandro Triglia <sandro@mclink.it> wrote:
> Hi
> For example, I could have a "credit card information" form which could occur
> as a component of many (larger) forms.
> Of course, I could cut-and-paste the relevant instance fragment,
> cut-and-paste the relevant model elements (binds etc.), and cut-and-paste
> the form controls (e.g., a single group or switch control).   But I would
> hope there is a better way of building a larger form by aggregating smaller
> forms.
> Alessandro

Mark Birbeck
x-port.net Ltd.

e: Mark.Birbeck@x-port.net
t: +44 (0) 20 7689 9232
w: http://www.formsPlayer.com/
b: http://internet-apps.blogspot.com/

Download our XForms processor from
Received on Tuesday, 1 August 2006 21:59:08 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:18 UTC