Re: Reusing a form in another form

What is the general feeling about this mechanism?  Is it something that is likely to be added to XForms 1.1?

I have been thinking about how an XInclude-based mechanism could work, and (unless I am missing something) it entails pointing to several distinct fragments of the "form definition" from several distinct places in the larger form -- for example, put an <xi:include> at some point(s) in the instance, pointing to somewhere within the instance of the subform;  put an <xi:include> at some other point in the model, pointing to some <bind> or <submission> element within the subform;  put an <xi:include> within some form control, pointing to some form control within the subform, and so on.

Is there a better way or any other way of reusing a form via XInclude?

If there is not, then I think that a better solution is needed, and should be something "native", defined within the XForms standard itself.  Ideally, I would like a single "inclusion point" in the main form, not three or more; and the pointer (URI) pointing to the whole subform, not to its fragments.

I think the load action, extended as described by Mark, is an excellent solution.  What is unclear to me at this point is how the instance data produced by the subform relates to the instance data produced by the main form.  

Also, what happens to the submission and the submit controls within the subform (if any)?  Does the "submission" semantics change when a form is loaded as a subform?

Have these points already been raised or discussed in this list?

Alessandro


> -----Original Message-----
> From: mark.birbeck@gmail.com [mailto:mark.birbeck@gmail.com] 
> On Behalf Of Mark Birbeck
> Sent: Tuesday, August 01, 2006 19:03
> To: Alessandro Triglia
> Cc: www-forms@w3.org
> Subject: Re: Reusing a form in another form
> 
> Hi Alessandro,
> 
> > This sounds like a great idea.  I was thinking more in 
> "static" terms...
> 
> We use XInclude a lot, but the problem is the forms can end up very
> big. What we're really after is a situation where the author doesn't
> have to think about it, but how do you explain to an author why they
> can't use 10 XInclude statements?
> 
> 
> > ... but
> > deferred loading is more interesting than static 
> aggregation and covers even
> > more use cases.
> 
> Yes, I agree. Replacing part of a form with HTML is something that is
> done a lot in the Ajax world, but it's very difficult to manage in a
> scripted environment. Our approach using XForms makes it really easy.
> 
> 
> > Did you say you are going to implement this?
> 
> Yes, we've already implemented it. And you have inspired me to write a
> short blog entry about it too, which shows an example of the mark-up:
> 
>   
> <http://internet-apps.blogspot.com/2006/08/using-subforms-in-x
forms.html>
> 
> All the best,
> 
> Mark
> 
> -- 
> Mark Birbeck
> CEO
> 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
> http://www.formsPlayer.com/
> 

Received on Wednesday, 2 August 2006 06:08:03 UTC