Model inside the view

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

Model inside the view

Tania Magnenat
Hi everybody!

How to update (in the page flow) a xforms model when the model is inside
the view?
If the model is separated from the view, I have no problem (the xforms
model is updated correctly with data from the previous model), but when
the model is inside the view it doesn't works.

Page flow example where the update works:
=========================================

<page id="travel" path-info="/travel" model="model-travel.xpl"
xforms="form-travel.xml" view="view-travel.xsl">
        <action when="/*/action='add-travel'">
                <result page="add-travel">
                        <xu:update select="/form/id">
                                <xu:value-of select="document('input:instance')/*/document/ProjectID"/>
                        </xu:update>
                </result>
        </action>
</page>
<page id="add-travel" path-info="/add-travel" xforms="/travel/form.xml"
view="/travel/view.xhtml"/>


Page flow example where the update doesn't works:
================================================

<page id="travel" path-info="/travel" model="model-travel.xpl"
xforms="form-travel.xml" view="view-travel.xsl">
        <action when="/*/action='add-travel'">
                <result page="add-travel">
                        <xu:update select="/form/id">
                                <xu:value-of select="document('input:instance')/*/document/ProjectID"/>
                        </xu:update>
                </result>
        </action>
</page>
<page id="add-travel" path-info="/add-travel" view="/travel/view.xhtml"/>


Thanks in advance!

Tania

P.S: I'm using OPS 3.0 beta 4



--
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: Model inside the view

Ryan Puddephatt
Tania,
        If you have the model within the view-travel.xsl file then you don't
need the xforms attribute. Try removing it!

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: Tania Magnenat [mailto:[hidden email]]
>Sent: 18 January 2006 11:12
>To: [hidden email]
>Subject: [ops-users] Model inside the view
>
>Hi everybody!
>
>How to update (in the page flow) a xforms model when the model is inside
>the view?
>If the model is separated from the view, I have no problem (the xforms
>model is updated correctly with data from the previous model), but when
>the model is inside the view it doesn't works.
>
>Page flow example where the update works:
>=========================================
>
><page id="travel" path-info="/travel" model="model-travel.xpl"
>xforms="form-travel.xml" view="view-travel.xsl">
> <action when="/*/action='add-travel'">
> <result page="add-travel">
> <xu:update select="/form/id">
> <xu:value-of
>select="document('input:instance')/*/document/ProjectID"/>
> </xu:update>
> </result>
> </action>
></page>
><page id="add-travel" path-info="/add-travel" xforms="/travel/form.xml"
>view="/travel/view.xhtml"/>
>
>
>Page flow example where the update doesn't works:
>================================================
>
><page id="travel" path-info="/travel" model="model-travel.xpl"
>xforms="form-travel.xml" view="view-travel.xsl">
> <action when="/*/action='add-travel'">
> <result page="add-travel">
> <xu:update select="/form/id">
> <xu:value-of
>select="document('input:instance')/*/document/ProjectID"/>
> </xu:update>
> </result>
> </action>
></page>
><page id="add-travel" path-info="/add-travel" view="/travel/view.xhtml"/>
>
>
>Thanks in advance!
>
>Tania
>
>P.S: I'm using OPS 3.0 beta 4




--
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: Model inside the view

Tania Magnenat
Hi Ryan,
I know that I don't need the xforms attribute if I have the model within
the view ...
The problem is that when I don't have the xforms attribute (because the
model is within the view), the xupdate doesn't works and I don't know
why ...

Tania

Ryan Puddephatt wrote:

> Tania,
> If you have the model within the view-travel.xsl file then you don't
> need the xforms attribute. Try removing it!
>
> 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: Tania Magnenat [mailto:[hidden email]]
>> Sent: 18 January 2006 11:12
>> To: [hidden email]
>> Subject: [ops-users] Model inside the view
>>
>> Hi everybody!
>>
>> How to update (in the page flow) a xforms model when the model is inside
>> the view?
>> If the model is separated from the view, I have no problem (the xforms
>> model is updated correctly with data from the previous model), but when
>> the model is inside the view it doesn't works.
>>
>> Page flow example where the update works:
>> =========================================
>>
>> <page id="travel" path-info="/travel" model="model-travel.xpl"
>> xforms="form-travel.xml" view="view-travel.xsl">
>> <action when="/*/action='add-travel'">
>> <result page="add-travel">
>> <xu:update select="/form/id">
>> <xu:value-of
>> select="document('input:instance')/*/document/ProjectID"/>
>> </xu:update>
>> </result>
>> </action>
>> </page>
>> <page id="add-travel" path-info="/add-travel" xforms="/travel/form.xml"
>> view="/travel/view.xhtml"/>
>>
>>
>> Page flow example where the update doesn't works:
>> ================================================
>>
>> <page id="travel" path-info="/travel" model="model-travel.xpl"
>> xforms="form-travel.xml" view="view-travel.xsl">
>> <action when="/*/action='add-travel'">
>> <result page="add-travel">
>> <xu:update select="/form/id">
>> <xu:value-of
>> select="document('input:instance')/*/document/ProjectID"/>
>> </xu:update>
>> </result>
>> </action>
>> </page>
>> <page id="add-travel" path-info="/add-travel" view="/travel/view.xhtml"/>
>>
>>
>> Thanks in advance!
>>
>> Tania
>>
>> P.S: I'm using OPS 3.0 beta 4
>
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> 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


--
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: Model inside the view

Erik Bruchez
Administrator
In reply to this post by Tania Magnenat
Tania,

As pointed out, you will have to remove the "xforms" attribute in your
page flow, as keeping it triggers the XForms Classic engine:

   http://www.orbeon.com/ops/doc/home-faq#xforms-classic-or-ng

Once that is done, you should tackle the next problem ;-)

I assume you want to update an XForms instance. I suggest, if not
already done, that you have a look at the following sections of the
documentation:

   http://www.orbeon.com/ops/doc/reference-page-flow#xml-submission
 
http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-instance-initialization

-Erik

Tania Magnenat wrote:
 > Hi everybody!
 >
 > How to update (in the page flow) a xforms model when the model is inside
 > the view?
 > If the model is separated from the view, I have no problem (the xforms
 > model is updated correctly with data from the previous model), but when
 > the model is inside the view it doesn't works.
 >
 > Page flow example where the update works:
 > =========================================
 >
 > <page id="travel" path-info="/travel" model="model-travel.xpl"
 > xforms="form-travel.xml" view="view-travel.xsl">
 >     <action when="/*/action='add-travel'">
 >         <result page="add-travel">
 >             <xu:update select="/form/id">
 >                 <xu:value-of
 > select="document('input:instance')/*/document/ProjectID"/>
 >             </xu:update>
 >         </result>
 >     </action>
 > </page>
 > <page id="add-travel" path-info="/add-travel" xforms="/travel/form.xml"
 > view="/travel/view.xhtml"/>
 >
 >
 > Page flow example where the update doesn't works:
 > ================================================
 >
 > <page id="travel" path-info="/travel" model="model-travel.xpl"
 > xforms="form-travel.xml" view="view-travel.xsl">
 >     <action when="/*/action='add-travel'">
 >         <result page="add-travel">
 >             <xu:update select="/form/id">
 >                 <xu:value-of
 > select="document('input:instance')/*/document/ProjectID"/>
 >             </xu:update>
 >         </result>
 >     </action>
 > </page>
 > <page id="add-travel" path-info="/add-travel" view="/travel/view.xhtml"/>
 >
 >
 > Thanks in advance!
 >
 > Tania
 >
 > P.S: I'm using OPS 3.0 beta 4




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

ejb3

jacques FAUQUEX
Erik:

Congratulations :
- OPS 3.0 is easy to install on MacOSX 10.4.4 with java 1.5 and  
latest tomcat
- the examples are impressive (on osx, one needs firefox to use ajax-
based onces... safari doesn't do the job).

Just a small question:
- Is it posible to use the same ejb processor for ejb3 code ?

Thanks,

Jacques Fauquex



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

Erik Bruchez
Administrator
jacques FAUQUEX wrote:

> Congratulations :

Thanks!

> - OPS 3.0 is easy to install on MacOSX 10.4.4 with java 1.5 and latest
> tomcat

Excellent!

> - the examples are impressive (on osx, one needs firefox to use
> ajax-based onces... safari doesn't do the job).

Correct, Safari is not yet supported, as mentioned in the list of known
limitations:

   http://www.orbeon.com/ops/doc/home-changes-30#limitations

> Just a small question:
> - Is it posible to use the same ejb processor for ejb3 code ?

We at Orbeon have not tried that. There is no EJB 3-specific code in OPS
for sure. Whatever the answer to your question, you always have the
possibility to write a custom processor (which is simple with the Java
procesor) to write your own EJB integration code.

-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: Model inside the view

Tania Magnenat
In reply to this post by Erik Bruchez
Hi Erik!
Thank you for your help, I read the documentation but this doesn't solve
my problem.

I send you some files that you can test on your computer.

Put the 2 folders (formInsideView and formInsideView2) on the folder
/resources and add to your page-flow.xml the follow lines:

======================================================================

<page id="formInsideView" path-info="/formInsideView"
model="/formInsideView/model-travel.xpl"
xforms="/formInsideView/form-travel.xml"
view="/formInsideView/view-travel.xsl">
        <action when="/*/action='add-travel'">
                        <result page="formInsideView-travel">
                                <xu:update select="/form/id">
                                        1
                                </xu:update>
                        </result>
                </action>
        </page>
        <page id="formInsideView-travel" path-info="/traveltest"
xforms="/formInsideView/travel/form.xml"
view="/formInsideView/travel/view.xhtml"/>
        <page id="formInsideView2" path-info="/formInsideView2"
model="/formInsideView2/model-travel.xpl"
xforms="/formInsideView2/form-travel.xml"
view="/formInsideView2/view-travel.xsl">
        <action when="/*/action='add-travel'">
                        <result page="formInsideView-travel2">
                                <xu:update select="/form/id">
                                        1
                                </xu:update>
                        </result>
                </action>
        </page>
        <page id="formInsideView-travel2" path-info="/traveltest2"
view="/formInsideView2/travel/view.xhtml"/>

====================================================================

Then access the two pages. When you click to "Add Travel" the next page
have to update the id with 1.
In the first page (formInsideView) this works correctly, but in  the
second page (formInsideView2) this doesn't works and I suppose that is
caused by the model inside the view.

Tania

Erik Bruchez wrote:

> Tania,
>
> As pointed out, you will have to remove the "xforms" attribute in your
> page flow, as keeping it triggers the XForms Classic engine:
>
>   http://www.orbeon.com/ops/doc/home-faq#xforms-classic-or-ng
>
> Once that is done, you should tackle the next problem ;-)
>
> I assume you want to update an XForms instance. I suggest, if not
> already done, that you have a look at the following sections of the
> documentation:
>
>   http://www.orbeon.com/ops/doc/reference-page-flow#xml-submission
>
> http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-instance-initialization 
>
>
> -Erik
>
> Tania Magnenat wrote:
>  > Hi everybody!
>  >
>  > How to update (in the page flow) a xforms model when the model is inside
>  > the view?
>  > If the model is separated from the view, I have no problem (the xforms
>  > model is updated correctly with data from the previous model), but when
>  > the model is inside the view it doesn't works.
>  >
>  > Page flow example where the update works:
>  > =========================================
>  >
>  > <page id="travel" path-info="/travel" model="model-travel.xpl"
>  > xforms="form-travel.xml" view="view-travel.xsl">
>  >     <action when="/*/action='add-travel'">
>  >         <result page="add-travel">
>  >             <xu:update select="/form/id">
>  >                 <xu:value-of
>  > select="document('input:instance')/*/document/ProjectID"/>
>  >             </xu:update>
>  >         </result>
>  >     </action>
>  > </page>
>  > <page id="add-travel" path-info="/add-travel" xforms="/travel/form.xml"
>  > view="/travel/view.xhtml"/>
>  >
>  >
>  > Page flow example where the update doesn't works:
>  > ================================================
>  >
>  > <page id="travel" path-info="/travel" model="model-travel.xpl"
>  > xforms="form-travel.xml" view="view-travel.xsl">
>  >     <action when="/*/action='add-travel'">
>  >         <result page="add-travel">
>  >             <xu:update select="/form/id">
>  >                 <xu:value-of
>  > select="document('input:instance')/*/document/ProjectID"/>
>  >             </xu:update>
>  >         </result>
>  >     </action>
>  > </page>
>  > <page id="add-travel" path-info="/add-travel"
> view="/travel/view.xhtml"/>
>  >
>  >
>  > Thanks in advance!
>  >
>  > Tania
>  >
>  > P.S: I'm using OPS 3.0 beta 4
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> 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


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

formInsideView2.zip (9K) Download Attachment
formInsideView.zip (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Model inside the view

Ryan Puddephatt
Tania,
        You still have XForms in your page-flow, rather than :

> <page id="formInsideView2" path-info="/formInsideView2"
>model="/formInsideView2/model-travel.xpl"
>xforms="/formInsideView2/form-travel.xml"
>view="/formInsideView2/view-travel.xsl">
> <action when="/*/action='add-travel'">
> <result page="formInsideView-travel2">
> <xu:update select="/form/id">
> 1
> </xu:update>
> </result>
> </action>
> </page>
If should be

> <page id="formInsideView2" path-info="/formInsideView2"
>model="/formInsideView2/model-travel.xpl"
>view="/formInsideView2/view-travel.xsl">
> <action when="/*/action='add-travel'">
> <result page="formInsideView-travel2">
> <xu:update select="/form/id">
> 1
> </xu:update>
> </result>
> </action>
> </page>
As Eric said, having the XForms attribute in your page flow makes the Orbeon
engine use Classic rather than NG, which will be using the external model

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: Tania Magnenat [mailto:[hidden email]]
>Sent: 18 January 2006 15:06
>To: [hidden email]
>Subject: Re: [ops-users] Model inside the view
>
>Hi Erik!
>Thank you for your help, I read the documentation but this doesn't solve
>my problem.
>
>I send you some files that you can test on your computer.
>
>Put the 2 folders (formInsideView and formInsideView2) on the folder
>/resources and add to your page-flow.xml the follow lines:
>
>======================================================================
>
><page id="formInsideView" path-info="/formInsideView"
>model="/formInsideView/model-travel.xpl"
>xforms="/formInsideView/form-travel.xml"
>view="/formInsideView/view-travel.xsl">
> <action when="/*/action='add-travel'">
> <result page="formInsideView-travel">
> <xu:update select="/form/id">
> 1
> </xu:update>
> </result>
> </action>
> </page>
> <page id="formInsideView-travel" path-info="/traveltest"
>xforms="/formInsideView/travel/form.xml"
>view="/formInsideView/travel/view.xhtml"/>
> <page id="formInsideView2" path-info="/formInsideView2"
>model="/formInsideView2/model-travel.xpl"
>xforms="/formInsideView2/form-travel.xml"
>view="/formInsideView2/view-travel.xsl">
> <action when="/*/action='add-travel'">
> <result page="formInsideView-travel2">
> <xu:update select="/form/id">
> 1
> </xu:update>
> </result>
> </action>
> </page>
> <page id="formInsideView-travel2" path-info="/traveltest2"
>view="/formInsideView2/travel/view.xhtml"/>
>
>====================================================================
>
>Then access the two pages. When you click to "Add Travel" the next page
>have to update the id with 1.
>In the first page (formInsideView) this works correctly, but in  the
>second page (formInsideView2) this doesn't works and I suppose that is
>caused by the model inside the view.
>
>Tania
>
>Erik Bruchez wrote:
>> Tania,
>>
>> As pointed out, you will have to remove the "xforms" attribute in your
>> page flow, as keeping it triggers the XForms Classic engine:
>>
>>   http://www.orbeon.com/ops/doc/home-faq#xforms-classic-or-ng
>>
>> Once that is done, you should tackle the next problem ;-)
>>
>> I assume you want to update an XForms instance. I suggest, if not
>> already done, that you have a look at the following sections of the
>> documentation:
>>
>>   http://www.orbeon.com/ops/doc/reference-page-flow#xml-submission
>>
>> http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-instance-
>initialization
>>
>>
>> -Erik
>>
>> Tania Magnenat wrote:
>>  > Hi everybody!
>>  >
>>  > How to update (in the page flow) a xforms model when the model is
>inside
>>  > the view?
>>  > If the model is separated from the view, I have no problem (the xforms
>>  > model is updated correctly with data from the previous model), but
>when
>>  > the model is inside the view it doesn't works.
>>  >
>>  > Page flow example where the update works:
>>  > =========================================
>>  >
>>  > <page id="travel" path-info="/travel" model="model-travel.xpl"
>>  > xforms="form-travel.xml" view="view-travel.xsl">
>>  >     <action when="/*/action='add-travel'">
>>  >         <result page="add-travel">
>>  >             <xu:update select="/form/id">
>>  >                 <xu:value-of
>>  > select="document('input:instance')/*/document/ProjectID"/>
>>  >             </xu:update>
>>  >         </result>
>>  >     </action>
>>  > </page>
>>  > <page id="add-travel" path-info="/add-travel"
>xforms="/travel/form.xml"
>>  > view="/travel/view.xhtml"/>
>>  >
>>  >
>>  > Page flow example where the update doesn't works:
>>  > ================================================
>>  >
>>  > <page id="travel" path-info="/travel" model="model-travel.xpl"
>>  > xforms="form-travel.xml" view="view-travel.xsl">
>>  >     <action when="/*/action='add-travel'">
>>  >         <result page="add-travel">
>>  >             <xu:update select="/form/id">
>>  >                 <xu:value-of
>>  > select="document('input:instance')/*/document/ProjectID"/>
>>  >             </xu:update>
>>  >         </result>
>>  >     </action>
>>  > </page>
>>  > <page id="add-travel" path-info="/add-travel"
>> view="/travel/view.xhtml"/>
>>  >
>>  >
>>  > Thanks in advance!
>>  >
>>  > Tania
>>  >
>>  > P.S: I'm using OPS 3.0 beta 4
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> --
>> 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



--
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: Model inside the view

Erik Bruchez
Administrator
In reply to this post by Tania Magnenat
Tania,

Tania Magnenat wrote:
 > Hi Erik!
 > Thank you for your help, I read the documentation but this doesn't solve
 > my problem.
 >
 > I send you some files that you can test on your computer.

The first thing is that you should not have an "xforms" attribute on
your pages below, otherwise you are still using XForms Classic. Sure,
you can mix and match Classic and NG within an application, however this
quickly becomes confusing!

This said, your submission is actually working as expected: your
formInsideView-travel2 page does get the submission as produced by the
action in formInsideView2. However, your XForms view will not
automatically include that submission. After all, it's just an XML file,
right, and you provide a static XForms instance inside. What you want to
do is initialize the instance from the current XForms submission. You
can do this with XSLT or XInclude, as per:

 
http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-instance-initialization



For example, in formInsideView2/travel/view.xhtml, do:

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

Or, with XSLT:

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

Note that using XInclude is the preferred way, is it is more efficient.

-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