Multiple models

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple models

Jurgis Lukss
Hello!

Currently we are using Orbeon Forms for a big project and I'm considering options on how to optimize our XForms code early on. Thought, of using common models for multiple XForms pages with similar functionality, seemed logical. But I could not find a way to perform even simplest cross model operations, like setting a value of instance element in one model to a value of instance element from other model. Because, setvalue can have only one model as an evaluation context.

Is there any recommended practice on using common models for similar XForms pages? For example, I have a large XML instance with it's associated XForms bindings, and it's required in multiple XForms pages, but this instance must be dynamically updatable, in each page, with values from other instances. It's not optimal to rewrite and support this instance and it's bindings separately in every XForms page. I could use XInclude, to insert it in each page's main model as just an instance with bindings, but inserted document would have to be an invalid XML document, as it can't have a root element (<xforms:instance> and <xforms:binding> should be on the same level).

Thanks,
Jurgis


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Multiple models

Erik Bruchez
Administrator
Jurgis,

> Currently we are using Orbeon Forms for a big project and I'm
> considering options on how to optimize our XForms code early on.
> Thought, of using common models for multiple XForms pages with similar
> functionality, seemed logical. But I could not find a way to perform
> even simplest cross model operations, like setting a value of instance
> element in one model to a value of instance element from other model.
> Because, setvalue can have only one model as an evaluation context.

Orbeon Forms provides an xxforms:instance() function, which allows you
to access instances in any models. This could be of help to you.

> Is there any recommended practice on using common models for similar
> XForms pages? For example, I have a large XML instance with it's
> associated XForms bindings, and it's required in multiple XForms pages,
> but this instance must be dynamically updatable, in each page, with
> values from other instances. It's not optimal to rewrite and support
> this instance and it's bindings separately in every XForms page. I could
> use XInclude, to insert it in each page's main model as just an instance
> with bindings, but inserted document would have to be an invalid XML
> document, as it can't have a root element (<xforms:instance> and
> <xforms:binding> should be on the same level).
So then yes, I think you could use XInclude to include an entire model,
and then use xxforms:instance() whenever you need cross-model access.

It is not very clear to me why the instance() function is limited to the
current model anyway, since instance ids are global.

-Erik

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws