Jos,
You are opening a vast subject, that of "how do web application keep
track of their internal state between pages".
> It looks like the full instance is transported to and from the
> client via the hidden variable $instance. Is this true?
Yes it is. The reason the full instance is currently stored in the
page is because it's a safe and easy way. Sending the state to the
client allows cloning windows or tabs in your web browser, for
example. Also, it doesn't require the server to even store anything in
a session.
> If yes, can't this be avoided by letting the server remember the
> instance for a session?
I should say that there is in general no such thing as "the instance
for a session". A session is associated with a single user, but not
with a single navigational flow. A single session may see multiple
flows of pages using different XForms instances. Some web applications
do not follow this logic so if you happen to clone a web browser
window or tab and try navigate in both simultaneously, the
applicationt becomes a mess. The session should only store what is
related to the user, such as application preferences, profile, etc.,
but not what is related to the page flow.
> When I add large amounts of data to the instance to be used as an
> XForms nodeset for selections, say the list of all countries in the
> world, it is transported twice: once in the XHTML <select> and once
> as the hidden $instance variable.
You are right that with large instances sending all the data to the
client can be a problem. I see at least two solutions:
1. Do not store you list of countries in the instance, but rather, in
a separate XML file. With XSLT, you can easily create a list of
items by iterating over the entries in that XML file with the
doc('') function.
2. Implement in Presentation Server an alternative way of storing page
state server-side. This may involve using the session as well, but
with an additional trick like associating an ever-changing id,
which allows separating out page flows.
-Erik
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
orbeon-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/orbeon-user