passing data from xf-model to xf-model

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

passing data from xf-model to xf-model

c.harder
Unfortunately, I couldn?t find an example to my problem.
I am using orbeon 3.0 beta2.

I have 2 simple views (input-view.xhtml and output-view.xhtml).
Both use the same xforms-model, which is included in the head of each xhtml.
After I have entered some data in "input-view", I like to go to the "output-view", which should show me the input (xforms:output).

I tried this:

<page   id="input"
        path-info="/dvz"
        view="input-view.xhtml">
   <action when="/form/action = 'output'">
       <result page="output">
          <xu:update select="/form">
              <xu:copy-of select="document('input:instance')/form/*" />
          </xu:update>
       </result>
    </action>
</page>
<page   id="output"
        path-info="/dvz/output"
        view="output-view.xml" />

..but its not working . There is no error and output is empty.

Do I have to use xforms:trigger or xforms:submit --> submission methode="post"?
 
How can I pass the data from model to model and solve this little Problem.
Maybe someone can give a little example? ;-)



--
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: passing data from xf-model to xf-model

Ryan Puddephatt
Hi,
        You haven't specified a xforms attribute in the <page> element! This
should contain an XML file to hold the instance data through both pages an
example can be found here :
http://www.orbeon.com/ops/goto-example/xforms-wizard-pfc

alternately you could use <submission> in your first page that would submit
the data to the second page! More information can be found on W3 on how to
use submission!

Hope this helps

Ryan Puddephatt
Web Developer
TFX Group
1 Michaelson Square
Livingston
West Lothian
Scotand
EH54 7DP
 
* [hidden email]
( 01506 407 110
7  01506 407 108
 

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: 07 November 2005 17:12
To: [hidden email]
Subject: [ops-users] passing data from xf-model to xf-model

Unfortunately, I couldnt find an example to my problem.
I am using orbeon 3.0 beta2.

I have 2 simple views (input-view.xhtml and output-view.xhtml).
Both use the same xforms-model, which is included in the head of each xhtml.
After I have entered some data in "input-view", I like to go to the
"output-view", which should show me the input (xforms:output).

I tried this:

<page   id="input"
        path-info="/dvz"
        view="input-view.xhtml">
   <action when="/form/action = 'output'">
       <result page="output">
          <xu:update select="/form">
              <xu:copy-of select="document('input:instance')/form/*" />
          </xu:update>
       </result>
    </action>
</page>
<page   id="output"
        path-info="/dvz/output"
        view="output-view.xml" />

..but its not working . There is no error and output is empty.

Do I have to use xforms:trigger or xforms:submit --> submission
methode="post"?
 
How can I pass the data from model to model and solve this little Problem.
Maybe someone can give a little example? ;-)





--
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: RE: passing data from xf-model to xf-model

c.harder
Thanks for reply.

I know what you mean, but the pfc-example has an explecite xforms-model (model.xml), which is bound through <page xforms="model.xml"../>.

My xform-model is placed in the head of the xhtml-views and I don't know how to bound in that way?

Any other ideas?



--
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: passing data from xf-model to xf-model

Erik Bruchez
Administrator
In reply to this post by Ryan Puddephatt
Ryan Puddephatt wrote:
> Hi,
> You haven't specified a xforms attribute in the <page> element! This
> should contain an XML file to hold the instance data through both pages an
> example can be found here :
> http://www.orbeon.com/ops/goto-example/xforms-wizard-pfc
>
> alternately you could use <submission> in your first page that would submit
> the data to the second page! More information can be found on W3 on how to
> use submission!

Ryan,

What you are saying is correct if you are using the Classic XForms
engine. However the new XForms engine no longer uses the "xforms"
attribute on the <page> element in the page flow.

You are however correct that it is possible to post directly to the
second page (elaborating on that in another email!).

-Erik



--
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: passing data from xf-model to xf-model

Erik Bruchez
Administrator
In reply to this post by c.harder
Ok, the "XForms Wizard with PFC" example was quite out of date. I
brought it up to date to show how you can pass information from page to
page while still using XForms NG.

If you understand how data is passed from the first page to the second
one, you should get the rest easily! The idea is as follows:

o First page:

   o Gets its XForms instance from a "default submission"
   o Fills out some data in that instance.
   o Submits (POST) that instance to the same URL the page was loaded
     from, while specifying an action in the submitted instance as well.

o PFC:

   o Receives submission.
   o Runs action, which performs an XML submission to the second page.

o Second page:

   o Gets its XForms instance from the XML submission.
   o etc.

This scenario gives control of the page flow to... page-flow.xml.
Alternatively, you could remove all page flow control from the
page-flow.xml (i.e. remove all <action> and <result> elements), and have
the XForms submissions performed directly to the next or previous page.
This way however page flow is encoded directly within each individual
page, which may or may not be what you want.

The updated version is attached in a zip file. If you remove what you
have under:

   examples/web/examples/xforms/xforms-wizard-pfc

And unzip those files there, the new version should just work. It will
make it soon in the unstable builds as well.

-Erik

[hidden email] wrote:

> Unfortunately, I couldn?t find an example to my problem.
> I am using orbeon 3.0 beta2.
>
> I have 2 simple views (input-view.xhtml and output-view.xhtml).
> Both use the same xforms-model, which is included in the head of each xhtml.
> After I have entered some data in "input-view", I like to go to the "output-view", which should show me the input (xforms:output).
>
> I tried this:
>
> <page   id="input"
>         path-info="/dvz"
> view="input-view.xhtml">
>    <action when="/form/action = 'output'">
>        <result page="output">
>  <xu:update select="/form">
>      <xu:copy-of select="document('input:instance')/form/*" />
>  </xu:update>
>        </result>
>     </action>
> </page>
> <page   id="output"
> path-info="/dvz/output"
> view="output-view.xml" />
>
> ..but its not working . There is no error and output is empty.
>
> Do I have to use xforms:trigger or xforms:submit --> submission methode="post"?
>  
> How can I pass the data from model to model and solve this little Problem.
> Maybe someone can give a little example? ;-)


--
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

xforms-wizard-pfc.zip (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: RE: passing data from xf-model to xf-model

Ryan Puddephatt
In reply to this post by c.harder
If you are going to use the instance in the header of each page you will
need to use a submission to pass the data between them! The older examples
use the page flow and a separate XML file to hold the instance data, the
newer examples hold all the page data in the page header and pass it between
pages using submissions

Hope this helps

Ryan Puddephatt
Web Developer
TFX Group
1 Michaelson Square
Livingston
West Lothian
Scotand
EH54 7DP
 
* [hidden email]
( 01506 407 110
7  01506 407 108
 
-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: 07 November 2005 18:07
To: [hidden email]
Subject: Re: RE: [ops-users] passing data from xf-model to xf-model

Thanks for reply.

I know what you mean, but the pfc-example has an explecite xforms-model
(model.xml), which is bound through <page xforms="model.xml"../>.

My xform-model is placed in the head of the xhtml-views and I don't know how
to bound in that way?

Any other ideas?





--
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: Re: passing data from xf-model to xf-model

c.harder
In reply to this post by Erik Bruchez
Hi ,
I tried it in Erics way, but its still not working. ;-(
I am getting following error message:

Warning: Include operation failed, reverting to fallback. Resource error reading file as XML (href='input:instance'). Reason: unknown protocol: input

Whats wrong? Is there a problem with orbeon3 beta2?
------------------------------------
This is my Code:

initial-instance.xml
<form>
  <action />
  <user>
    <name />
    <age />
  </user>
</form>

page-flow.xml
<config
  xmlns="http://www.orbeon.com/oxf/controller"
  xmlns:xu="http://www.xmldb.org/xupdate">
  <page
    id="input"
    path-info="/dvz"
    default-submission="initial-instance.xml"
    view="input-view.xhtml">
    <action when="/form/action = 'output'">
      <result
        page="output"
        transform="oxf:xupdate">
        <xu:transformations>
          <xu:update select="/form/action" />
          <xu:update select="/form/user">
            <xu:copy-of select="document('input:instance')/form/user/*" />
          </xu:update>
        </xu:transformations>
      </result>
    </action>
  </page>
  <page
    id="output"
    path-info="/dvz/output"
    default-submission="initial-instance.xml"
    view="output-view.xhtml" />
  <epilogue url="oxf:/config/epilogue.xpl" />
</config>

input-view.xhtml
<xhtml:html
  xmlns:xforms="http://www.w3.org/2002/xforms"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xi="http://www.w3.org/2003/XInclude"
  xmlns:ev="http://www.w3.org/2001/xml-events">
  <xhtml:head>
    <xhtml:title>Example Input</xhtml:title>
    <xforms:model xmlns:xforms="http://www.w3.org/2002/xforms">
      <xforms:instance>
        <xi:include href="input:instance" />
      </xforms:instance>
      <xforms:submission
        id="main"
        method="post"
        action="/dvz" />
    </xforms:model>
  </xhtml:head>
  <xhtml:body>
    <xforms:group ref="/form/user">
      <xforms:input ref="name">
        <xforms:label>Name</xforms:label>
      </xforms:input>
      <xforms:input ref="age">
        <xforms:label>Age</xforms:label>
      </xforms:input>
      <xforms:trigger>
        <xforms:label>Output</xforms:label>
        <xforms:action ev:event="DOMActivate">
          <xforms:setvalue ref="/form/action">output</xforms:setvalue>
          <xforms:send submission="main" />
        </xforms:action>
      </xforms:trigger>
    </xforms:group>
  </xhtml:body>
</xhtml:html>

output-view.xhtml
<xhtml:html
  xmlns:xforms="http://www.w3.org/2002/xforms"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xi="http://www.w3.org/2003/XInclude">
  <xhtml:head>
    <xhtml:title>Example Output</xhtml:title>
    <xforms:model xmlns:xforms="http://www.w3.org/2002/xforms">
      <xforms:instance>
        <xi:include href="input:instance" />
      </xforms:instance>
    </xforms:model>
  </xhtml:head>
  <xhtml:body>
    <xhtml:div class="maincontent">
      <xforms:group ref="/form/user">
        <xforms:output ref="name">
          <xforms:label>Name</xforms:label>
        </xforms:output>
        <xforms:output ref="age">
          <xforms:label>Age</xforms:label>
        </xforms:output>
      </xforms:group>
      <xhtml:p />
    </xhtml:div>
  </xhtml:body>
</xhtml:html>



--
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: passing data from xf-model to xf-model

Erik Bruchez
Administrator
In reply to this post by c.harder
You are getting that error message because I used the following construct:

<xi:include href="input:instance"/>

which is only supported after OPS 3.0 beta 3.

You can either upgrade to a nightly build, or try instead this:

1. Add the xsl namespace declaration on the root element of your page
    views:

    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

2. Also add xsl:version="2.0" on the root element of your page views

3. Replace:

    <xi:include href="input:instance"/>

    with:

    <xsl:copy-of select="doc('input:instance')/*"/>

This will do the same thing, but with XSLT instead of XInclude.

-Erik

[hidden email] wrote:

> Hi ,
> I tried it in Erics way, but its still not working. ;-(
> I am getting following error message:
>
> Warning: Include operation failed, reverting to fallback. Resource error reading file as XML (href='input:instance'). Reason: unknown protocol: input
>
> Whats wrong? Is there a problem with orbeon3 beta2?
> ------------------------------------
> This is my Code:
>
> initial-instance.xml
> <form>
>   <action />
>   <user>
>     <name />
>     <age />
>   </user>
> </form>
>
> page-flow.xml
> <config
>   xmlns="http://www.orbeon.com/oxf/controller"
>   xmlns:xu="http://www.xmldb.org/xupdate">
>   <page
>     id="input"
>     path-info="/dvz"
>     default-submission="initial-instance.xml"
>     view="input-view.xhtml">
>     <action when="/form/action = 'output'">
>       <result
>         page="output"
>         transform="oxf:xupdate">
>         <xu:transformations>
>           <xu:update select="/form/action" />
>           <xu:update select="/form/user">
>             <xu:copy-of select="document('input:instance')/form/user/*" />
>           </xu:update>
>         </xu:transformations>
>       </result>
>     </action>
>   </page>
>   <page
>     id="output"
>     path-info="/dvz/output"
>     default-submission="initial-instance.xml"
>     view="output-view.xhtml" />
>   <epilogue url="oxf:/config/epilogue.xpl" />
> </config>
>
> input-view.xhtml
> <xhtml:html
>   xmlns:xforms="http://www.w3.org/2002/xforms"
>   xmlns:xhtml="http://www.w3.org/1999/xhtml"
>   xmlns:xi="http://www.w3.org/2003/XInclude"
>   xmlns:ev="http://www.w3.org/2001/xml-events">
>   <xhtml:head>
>     <xhtml:title>Example Input</xhtml:title>
>     <xforms:model xmlns:xforms="http://www.w3.org/2002/xforms">
>       <xforms:instance>
>         <xi:include href="input:instance" />
>       </xforms:instance>
>       <xforms:submission
>         id="main"
>         method="post"
>         action="/dvz" />
>     </xforms:model>
>   </xhtml:head>
>   <xhtml:body>
>     <xforms:group ref="/form/user">
>       <xforms:input ref="name">
>         <xforms:label>Name</xforms:label>
>       </xforms:input>
>       <xforms:input ref="age">
>         <xforms:label>Age</xforms:label>
>       </xforms:input>
>       <xforms:trigger>
>         <xforms:label>Output</xforms:label>
>         <xforms:action ev:event="DOMActivate">
>           <xforms:setvalue ref="/form/action">output</xforms:setvalue>
>           <xforms:send submission="main" />
>         </xforms:action>
>       </xforms:trigger>
>     </xforms:group>
>   </xhtml:body>
> </xhtml:html>
>
> output-view.xhtml
> <xhtml:html
>   xmlns:xforms="http://www.w3.org/2002/xforms"
>   xmlns:xhtml="http://www.w3.org/1999/xhtml"
>   xmlns:xi="http://www.w3.org/2003/XInclude">
>   <xhtml:head>
>     <xhtml:title>Example Output</xhtml:title>
>     <xforms:model xmlns:xforms="http://www.w3.org/2002/xforms">
>       <xforms:instance>
>         <xi:include href="input:instance" />
>       </xforms:instance>
>     </xforms:model>
>   </xhtml:head>
>   <xhtml:body>
>     <xhtml:div class="maincontent">
>       <xforms:group ref="/form/user">
>         <xforms:output ref="name">
>           <xforms:label>Name</xforms:label>
>         </xforms:output>
>         <xforms:output ref="age">
>           <xforms:label>Age</xforms:label>
>         </xforms:output>
>       </xforms:group>
>       <xhtml:p />
>     </xhtml:div>
>   </xhtml:body>
> </xhtml:html>



--
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: passing data from xf-model to xf-model

Ryan Puddephatt
In reply to this post by Erik Bruchez
Thanks for clearing that up Erik, I'm still trying to get to grips with what
is in OPS 3.0beta and what isn't!

Ryan Puddephatt
Web Developer
TFX Group
1 Michaelson Square
Livingston
West Lothian
Scotand
EH54 7DP
 
* [hidden email]
( 01506 407 110
7  01506 407 108
 

-----Original Message-----
From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
Sent: 07 November 2005 22:23
To: [hidden email]
Subject: Re: [ops-users] passing data from xf-model to xf-model

Ryan Puddephatt wrote:
> Hi,
> You haven't specified a xforms attribute in the <page> element! This
> should contain an XML file to hold the instance data through both pages an
> example can be found here :
> http://www.orbeon.com/ops/goto-example/xforms-wizard-pfc
>
> alternately you could use <submission> in your first page that would
submit
> the data to the second page! More information can be found on W3 on how to
> use submission!

Ryan,

What you are saying is correct if you are using the Classic XForms
engine. However the new XForms engine no longer uses the "xforms"
attribute on the <page> element in the page flow.

You are however correct that it is possible to post directly to the
second page (elaborating on that in another email!).

-Erik





--
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: passing data from xf-model to xf-model

Erik Bruchez
Administrator
In reply to this post by Erik Bruchez
Following up on this, we have now upgraded the Hello World tutorial
examples to XForms NG. In particular the last example, under:

   examples/web/examples/tutorial/hello4

illustrates how to pass data from one page to the other. I attach the
updated version as a zip file here. It will also make it to the unstable
builds soon. Again, this is something to run with a post-OPS 3.0 beta 3
build.

-Erik



--
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

hello4.zip (5K) Download Attachment