Javascript call after trigger

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

Javascript call after trigger

Shaw, Richard A
Javascript call after trigger

I have a journey planning page which contains 3 areas -

- xform for journey input
- div for textual results
- map which is javascript driven

I've set my form to do a submission with an instance replace so that my textual results appear in the division when they have been returned.

What I then need to do is to extract the geographic extents of the journey from the model and update the map position with a javascript call on the client.

Is this possible ?

If I put my map position data into a hidden xforms input then I can get the extents from there using (  var extents = ORBEON.xforms.Document.getValue('extents');) and call a javascript function to update the map, but what I can't work out is how to get the javascript function to be called at the correct time - I'm using a button at the moment called update map.

Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Richard Shaw  
Technical Design Authority - Information Solutions Consultancy  
Intelligent Transport Systems

Atkins Highways and Transportation
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW

Tel: +44 (0) 1372 756407 
Fax: +44 (0) 1372 740055
Mob: 07740 817586 
E-mail: [hidden email]

www.atkinsglobal.com/its



This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.

The ultimate parent company of the Atkins Group is WS Atkins plc.  Registered in England No. 1885586.  Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.

P Consider the environment. Please don't print this e-mail unless you really need to.



--
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: Javascript call after trigger

David McIntyre
I believe the following would work.  Modify your submission to include an <xxforms:script/> element which contains some javascript to update the map.  Something along the lines of
 
<xforms:submission id="getJourney" replace="instance" ....>
    <xxforms:script ev:event="xforms-submit-done">
        updateMapExtent();
    </xxforms:script>
</xforms:submission>
 
See this link for a brief description of this element: http://www.orbeon.com/ops/doc/reference-xforms-ng#xxforms-script-extension 
 
Cheers,
 
Dave Mc
 
 
Dave McIntyre   MA, DPhil
Software Developer
[hidden email]
P: +64 9 638 0600
F: +64 9 638 0699
M: +64 21 212 8087
S: dave.mcintyre


>>> "Shaw, Richard A" <[hidden email]> 27/02/2007 4:13 a.m. >>>

I have a journey planning page which contains 3 areas -

- xform for journey input
- div for textual results
- map which is javascript driven

I've set my form to do a submission with an instance replace so that my textual results appear in the division when they have been returned.

What I then need to do is to extract the geographic extents of the journey from the model and update the map position with a javascript call on the client.

Is this possible ?

If I put my map position data into a hidden xforms input then I can get the extents from there using (  var extents = ORBEON.xforms.Document.getValue('extents');) and call a javascript function to update the map, but what I can't work out is how to get the javascript function to be called at the correct time - I'm using a button at the moment called update map.

Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Richard Shaw  
Technical Design Authority - Information Solutions Consultancy  
Intelligent Transport Systems

Atkins Highways and Transportation
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW

Tel: +44 (0) 1372 756407 
Fax: +44 (0) 1372 740055
Mob: 07740 817586 
E-mail: [hidden email]

www.atkinsglobal.com/its



This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.

The ultimate parent company of the Atkins Group is WS Atkins plc.  Registered in England No. 1885586.  Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.

P Consider the environment. Please don't print this e-mail unless you really need to.



--
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: Javascript call after trigger

Shaw, Richard A
That only works if I put DomActivate as the event type.

I've now realised that I need to perform a bit of javascript before the submit occurs - is there a way of doing this ?

What I want to do is create my own Loading message in the middle of the screen as well as the red loading message because my submit takes about 20 seconds to complete.


Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Richard Shaw  
Technical Design Authority - Information Solutions Consultancy  
Intelligent Transport Systems

Atkins Highways and Transportation
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW

Tel: +44 (0) 1372 756407
Fax: +44 (0) 1372 740055
Mob: 07740 817586
E-mail: [hidden email]

www.atkinsglobal.com/its

-----Original Message-----
From: David McIntyre [mailto:[hidden email]]
Sent: 26 February 2007 21:33
To: [hidden email]
Subject: Re: [ops-users] Javascript call after trigger

I believe the following would work.  Modify your submission to include an <xxforms:script/> element which contains some javascript to update the map.  Something along the lines of

<xforms:submission id="getJourney" replace="instance" ....>
    <xxforms:script ev:event="xforms-submit-done">
        updateMapExtent();
    </xxforms:script>
</xforms:submission>

See this link for a brief description of this element: http://www.orbeon.com/ops/doc/reference-xforms-ng#xxforms-script-extension 

Cheers,

Dave Mc




Dave McIntyre   MA, DPhil
Software Developer
[hidden email]
P: +64 9 638 0600
F: +64 9 638 0699
M: +64 21 212 8087
S: dave.mcintyre
www.orionhealth.com


>>> "Shaw, Richard A" <[hidden email]> 27/02/2007 4:13
>>> a.m. >>>

I have a journey planning page which contains 3 areas -
- xform for journey input
- div for textual results
- map which is javascript driven
I've set my form to do a submission with an instance replace so that my textual results appear in the division when they have been returned.
What I then need to do is to extract the geographic extents of the journey from the model and update the map position with a javascript call on the client.
Is this possible ?
If I put my map position data into a hidden xforms input then I can get the extents from there using (  var extents = ORBEON.xforms.Document.getValue('extents');) and call a javascript function to update the map, but what I can't work out is how to get the javascript function to be called at the correct time - I'm using a button at the moment called update map.
Richard Shaw
¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤
Richard Shaw  
Technical Design Authority - Information Solutions Consultancy  
Intelligent Transport Systems
Atkins Highways and Transportation
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW
Tel: +44 (0) 1372 756407
Fax: +44 (0) 1372 740055
Mob: 07740 817586
E-mail: [hidden email]
www.atkinsglobal.com/its



This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.
The ultimate parent company of the Atkins Group is WS Atkins plc.  Registered in England No. 1885586.  Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.
P Consider the environment. Please don't print this e-mail unless you really need to.

This message has been scanned for viruses by MailControl - (see http://bluepages.wsatkins.co.uk/?6875772)



--
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: Javascript call after trigger

Hank Ratzesberger
Richard,

To my knowledge this is not possible at this time.

The reason is that <xforms:action> are atomic and
<xxforms:script> are executed last.  All the actions
are taken on the server then the client is updated.

But perhaps there is an update to this:

https://wiki.objectweb.org/ops/Wiki.jsp?page=XFormsClientNotification

Regards,
Hank

Institute for Crustal Studies


----- Original Message -----
From: "Shaw, Richard A" <[hidden email]>
To: <[hidden email]>
Sent: Wednesday, February 28, 2007 8:00 AM
Subject: RE: [ops-users] Javascript call after trigger


That only works if I put DomActivate as the event type.

I've now realised that I need to perform a bit of javascript before the submit occurs - is there a way of doing this ?

What I want to do is create my own Loading message in the middle of the screen as well as the red loading message because my submit
takes about 20 seconds to complete.


Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Richard Shaw
Technical Design Authority - Information Solutions Consultancy
Intelligent Transport Systems

Atkins Highways and Transportation
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW

Tel: +44 (0) 1372 756407
Fax: +44 (0) 1372 740055
Mob: 07740 817586
E-mail: [hidden email]

www.atkinsglobal.com/its

-----Original Message-----
From: David McIntyre [mailto:[hidden email]]
Sent: 26 February 2007 21:33
To: [hidden email]
Subject: Re: [ops-users] Javascript call after trigger

I believe the following would work.  Modify your submission to include an <xxforms:script/> element which contains some javascript
to update the map.  Something along the lines of

<xforms:submission id="getJourney" replace="instance" ....>
    <xxforms:script ev:event="xforms-submit-done">
        updateMapExtent();
    </xxforms:script>
</xforms:submission>

See this link for a brief description of this element: http://www.orbeon.com/ops/doc/reference-xforms-ng#xxforms-script-extension

Cheers,

Dave Mc




Dave McIntyre   MA, DPhil
Software Developer
[hidden email]
P: +64 9 638 0600
F: +64 9 638 0699
M: +64 21 212 8087
S: dave.mcintyre
www.orionhealth.com


>>> "Shaw, Richard A" <[hidden email]> 27/02/2007 4:13
>>> a.m. >>>

I have a journey planning page which contains 3 areas -
- xform for journey input
- div for textual results
- map which is javascript driven
I've set my form to do a submission with an instance replace so that my textual results appear in the division when they have been
returned.
What I then need to do is to extract the geographic extents of the journey from the model and update the map position with a
javascript call on the client.
Is this possible ?
If I put my map position data into a hidden xforms input then I can get the extents from there using (  var extents =
ORBEON.xforms.Document.getValue('extents');) and call a javascript function to update the map, but what I can't work out is how to
get the javascript function to be called at the correct time - I'm using a button at the moment called update map.
Richard Shaw
¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤
Richard Shaw
Technical Design Authority - Information Solutions Consultancy
Intelligent Transport Systems
Atkins Highways and Transportation
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW
Tel: +44 (0) 1372 756407
Fax: +44 (0) 1372 740055
Mob: 07740 817586
E-mail: [hidden email]
www.atkinsglobal.com/its



This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this
communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be
legally binding.
The ultimate parent company of the Atkins Group is WS Atkins plc.  Registered in England No. 1885586.  Registered Office Woodcote
Grove, Ashley Road, Epsom, Surrey KT18 5BW.
P Consider the environment. Please don't print this e-mail unless you really need to.

This message has been scanned for viruses by MailControl - (see http://bluepages.wsatkins.co.uk/?6875772)




--------------------------------------------------------------------------------


>
> --
> 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: Javascript call after trigger

Adrian Baker
In reply to this post by Shaw, Richard A
You can use a standard onclick handler which does your bit of javascript, and then fires an xforms event: http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-javascript-events.

Adrian

Shaw, Richard A wrote:
That only works if I put DomActivate as the event type.

I've now realised that I need to perform a bit of javascript before the submit occurs - is there a way of doing this ?

What I want to do is create my own Loading message in the middle of the screen as well as the red loading message because my submit takes about 20 seconds to complete.


Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Richard Shaw  
Technical Design Authority - Information Solutions Consultancy  
Intelligent Transport Systems 

Atkins Highways and Transportation 
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW

Tel: +44 (0) 1372 756407 
Fax: +44 (0) 1372 740055
Mob: 07740 817586 
E-mail: [hidden email]

www.atkinsglobal.com/its

-----Original Message-----
From: David McIntyre [[hidden email]] 
Sent: 26 February 2007 21:33
To: [hidden email]
Subject: Re: [ops-users] Javascript call after trigger

I believe the following would work.  Modify your submission to include an <xxforms:script/> element which contains some javascript to update the map.  Something along the lines of

<xforms:submission id="getJourney" replace="instance" ....>
    <xxforms:script ev:event="xforms-submit-done">
        updateMapExtent();
    </xxforms:script>
</xforms:submission>

See this link for a brief description of this element: http://www.orbeon.com/ops/doc/reference-xforms-ng#xxforms-script-extension 

Cheers,

Dave Mc




Dave McIntyre   MA, DPhil
Software Developer
[hidden email]
P: +64 9 638 0600
F: +64 9 638 0699
M: +64 21 212 8087
S: dave.mcintyre
www.orionhealth.com 


  
"Shaw, Richard A" [hidden email] 27/02/2007 4:13 
a.m. >>>
        

I have a journey planning page which contains 3 areas -
- xform for journey input
- div for textual results
- map which is javascript driven
I've set my form to do a submission with an instance replace so that my textual results appear in the division when they have been returned.
What I then need to do is to extract the geographic extents of the journey from the model and update the map position with a javascript call on the client.
Is this possible ? 
If I put my map position data into a hidden xforms input then I can get the extents from there using (  var extents = ORBEON.xforms.Document.getValue('extents');) and call a javascript function to update the map, but what I can't work out is how to get the javascript function to be called at the correct time - I'm using a button at the moment called update map.
Richard Shaw
¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤ 
Richard Shaw   
Technical Design Authority - Information Solutions Consultancy   
Intelligent Transport Systems
Atkins Highways and Transportation
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW
Tel: +44 (0) 1372 756407
Fax: +44 (0) 1372 740055
Mob: 07740 817586
E-mail: [hidden email]
www.atkinsglobal.com/its 



This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.
The ultimate parent company of the Atkins Group is WS Atkins plc.  Registered in England No. 1885586.  Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.
P Consider the environment. Please don't print this e-mail unless you really need to.

This message has been scanned for viruses by MailControl - (see http://bluepages.wsatkins.co.uk/?6875772)

  

-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] 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: Javascript call after trigger

Alessandro Vernet
Administrator
In reply to this post by Shaw, Richard A
Hi Richard,

Here is what you can do:

1. On DOMActivate, you use <xxforms:script> to run some JavaScript.
2. This JavaScript displays your message and calls
ORBEON.xforms.Document.dispatchEvent() to dispatch an event.
3. In the event hander for that event you execute your long-running
task. At the end of the task you include a <xxforms:script> which
hides the message on the client side.

Alex

On 2/28/07, Shaw, Richard A <[hidden email]> wrote:

> That only works if I put DomActivate as the event type.
>
> I've now realised that I need to perform a bit of javascript before the submit occurs - is there a way of doing this ?
>
> What I want to do is create my own Loading message in the middle of the screen as well as the red loading message because my submit takes about 20 seconds to complete.
>
>
> Richard Shaw
>
> ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤
>
> Richard Shaw
> Technical Design Authority - Information Solutions Consultancy
> Intelligent Transport Systems
>
> Atkins Highways and Transportation
> Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW
>
> Tel: +44 (0) 1372 756407
> Fax: +44 (0) 1372 740055
> Mob: 07740 817586
> E-mail: [hidden email]
>
> www.atkinsglobal.com/its
>
> -----Original Message-----
> From: David McIntyre [mailto:[hidden email]]
> Sent: 26 February 2007 21:33
> To: [hidden email]
> Subject: Re: [ops-users] Javascript call after trigger
>
> I believe the following would work.  Modify your submission to include an <xxforms:script/> element which contains some javascript to update the map.  Something along the lines of
>
> <xforms:submission id="getJourney" replace="instance" ....>
>     <xxforms:script ev:event="xforms-submit-done">
>         updateMapExtent();
>     </xxforms:script>
> </xforms:submission>
>
> See this link for a brief description of this element: http://www.orbeon.com/ops/doc/reference-xforms-ng#xxforms-script-extension
>
> Cheers,
>
> Dave Mc
>
>
>
>
> Dave McIntyre   MA, DPhil
> Software Developer
> [hidden email]
> P: +64 9 638 0600
> F: +64 9 638 0699
> M: +64 21 212 8087
> S: dave.mcintyre
> www.orionhealth.com
>
>
> >>> "Shaw, Richard A" <[hidden email]> 27/02/2007 4:13
> >>> a.m. >>>
>
> I have a journey planning page which contains 3 areas -
> - xform for journey input
> - div for textual results
> - map which is javascript driven
> I've set my form to do a submission with an instance replace so that my textual results appear in the division when they have been returned.
> What I then need to do is to extract the geographic extents of the journey from the model and update the map position with a javascript call on the client.
> Is this possible ?
> If I put my map position data into a hidden xforms input then I can get the extents from there using (  var extents = ORBEON.xforms.Document.getValue('extents');) and call a javascript function to update the map, but what I can't work out is how to get the javascript function to be called at the correct time - I'm using a button at the moment called update map.
> Richard Shaw
> ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤
> Richard Shaw
> Technical Design Authority - Information Solutions Consultancy
> Intelligent Transport Systems
> Atkins Highways and Transportation
> Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW
> Tel: +44 (0) 1372 756407
> Fax: +44 (0) 1372 740055
> Mob: 07740 817586
> E-mail: [hidden email]
> www.atkinsglobal.com/its
>
>
>
> This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.
> The ultimate parent company of the Atkins Group is WS Atkins plc.  Registered in England No. 1885586.  Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.
> P Consider the environment. Please don't print this e-mail unless you really need to.
>
> This message has been scanned for viruses by MailControl - (see http://bluepages.wsatkins.co.uk/?6875772)
>
>
>
> --
> 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
>
>

--
Orbeon Forms - Web 2.0 Forms for the Enterprise
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
Reply | Threaded
Open this post in threaded view
|

RE: Javascript call after trigger

Shaw, Richard A
I'm not sure what I'm doing wrong but I can't get this to work. My model contains the following -

    <xhtml:head>
        <xhtml:title>Cycle Plan</xhtml:title>
        <xforms:model xxforms:external-events="submit">
        <xforms:instance id="instance">
            <xi:include href="input:instance" />
        </xforms:instance>
           
         <xforms:submission id="do-get-results" ref="/" method="post" action="/mosaic/cycle-plan/formatted-results"
                                        replace="instance" instance="plan-results"/>

                        <xforms:action id="get-results" ev:event="submit">
                                <xforms:send submission="do-get-results"/>
                        </xforms:action>
                               
        </xforms:model>

                <xhtml:script type="text/javascript" src="/mosaic/cycle-plan/dynamic-map.js">
                </xhtml:script>
               
    </xhtml:head>

My buttons are is -

        <xhtml:input value="Plan" type="button" onClick="getResults()" />

      <xforms:submit submission="do-get-results">
            <xforms:label>Plan</xforms:label>
        </xforms:submit>

My java script (dynamic-map.js) contains -

function getResults()
{
        ORBEON.xforms.Document.dispatchEvent("get-results", "submit");
}

The xforms submit button works fine, but the standard button doesn't.

At first I tried it without an external-event and used xforms-submit as my event name, that didn't work, so I changed it as above and it still doesn't work.

What am I missing ?


Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Richard Shaw  
Technical Design Authority - Information Solutions Consultancy  
Intelligent Transport Systems

Atkins Highways and Transportation
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW

Tel: +44 (0) 1372 756407
Fax: +44 (0) 1372 740055
Mob: 07740 817586
E-mail: [hidden email]

www.atkinsglobal.com/its

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Alessandro Vernet
Sent: 01 March 2007 00:19
To: [hidden email]
Subject: Re: [ops-users] Javascript call after trigger

Hi Richard,

Here is what you can do:

1. On DOMActivate, you use <xxforms:script> to run some JavaScript.
2. This JavaScript displays your message and calls
ORBEON.xforms.Document.dispatchEvent() to dispatch an event.
3. In the event hander for that event you execute your long-running task. At the end of the task you include a <xxforms:script> which hides the message on the client side.

Alex

On 2/28/07, Shaw, Richard A <[hidden email]> wrote:

> That only works if I put DomActivate as the event type.
>
> I've now realised that I need to perform a bit of javascript before the submit occurs - is there a way of doing this ?
>
> What I want to do is create my own Loading message in the middle of the screen as well as the red loading message because my submit takes about 20 seconds to complete.
>
>
> Richard Shaw
>
> ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤
>
> Richard Shaw
> Technical Design Authority - Information Solutions Consultancy
> Intelligent Transport Systems
>
> Atkins Highways and Transportation
> Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW
>
> Tel: +44 (0) 1372 756407
> Fax: +44 (0) 1372 740055
> Mob: 07740 817586
> E-mail: [hidden email]
>
> www.atkinsglobal.com/its
>
> -----Original Message-----
> From: David McIntyre [mailto:[hidden email]]
> Sent: 26 February 2007 21:33
> To: [hidden email]
> Subject: Re: [ops-users] Javascript call after trigger
>
> I believe the following would work.  Modify your submission to include
> an <xxforms:script/> element which contains some javascript to update
> the map.  Something along the lines of
>
> <xforms:submission id="getJourney" replace="instance" ....>
>     <xxforms:script ev:event="xforms-submit-done">
>         updateMapExtent();
>     </xxforms:script>
> </xforms:submission>
>
> See this link for a brief description of this element:
> http://www.orbeon.com/ops/doc/reference-xforms-ng#xxforms-script-exten
> sion
>
> Cheers,
>
> Dave Mc
>
>
>
>
> Dave McIntyre   MA, DPhil
> Software Developer
> [hidden email]
> P: +64 9 638 0600
> F: +64 9 638 0699
> M: +64 21 212 8087
> S: dave.mcintyre
> www.orionhealth.com
>
>
> >>> "Shaw, Richard A" <[hidden email]> 27/02/2007 4:13
> >>> a.m. >>>
>
> I have a journey planning page which contains 3 areas -
> - xform for journey input
> - div for textual results
> - map which is javascript driven
> I've set my form to do a submission with an instance replace so that my textual results appear in the division when they have been returned.
> What I then need to do is to extract the geographic extents of the journey from the model and update the map position with a javascript call on the client.
> Is this possible ?
> If I put my map position data into a hidden xforms input then I can get the extents from there using (  var extents = ORBEON.xforms.Document.getValue('extents');) and call a javascript function to update the map, but what I can't work out is how to get the javascript function to be called at the correct time - I'm using a button at the moment called update map.
> Richard Shaw
> ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤
> Richard Shaw
> Technical Design Authority - Information Solutions Consultancy
> Intelligent Transport Systems Atkins Highways and Transportation
> Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW
> Tel: +44 (0) 1372 756407
> Fax: +44 (0) 1372 740055
> Mob: 07740 817586
> E-mail: [hidden email]
> www.atkinsglobal.com/its
>
>
>
> This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.
> The ultimate parent company of the Atkins Group is WS Atkins plc.  Registered in England No. 1885586.  Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.
> P Consider the environment. Please don't print this e-mail unless you really need to.
>
> This message has been scanned for viruses by MailControl - (see
> http://bluepages.wsatkins.co.uk/?6875772)
>
>
>
> --
> 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
>
>

--
Orbeon Forms - Web 2.0 Forms for the Enterprise 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
Reply | Threaded
Open this post in threaded view
|

Re: Javascript call after trigger

Ryan Puddephatt
Richard,
    The ID "get-results" is defined on an action, this should be the id
of the submission, the action is referenced by the "submit"

also why don't you use the DOMActivate event in the xforms:input like so

<xforms:send ev:event="DOMActivate" submission="do-get-results"/>

to avoid a possible security risk with leaving the submit event
accessible to the client

Ryan

Shaw, Richard A wrote:

> I'm not sure what I'm doing wrong but I can't get this to work. My model contains the following -
>
>     <xhtml:head>
>         <xhtml:title>Cycle Plan</xhtml:title>
>         <xforms:model xxforms:external-events="submit">
>         <xforms:instance id="instance">
>             <xi:include href="input:instance" />
>         </xforms:instance>
>            
>          <xforms:submission id="do-get-results" ref="/" method="post" action="/mosaic/cycle-plan/formatted-results"
> replace="instance" instance="plan-results"/>
>
> <xforms:action id="get-results" ev:event="submit">
> <xforms:send submission="do-get-results"/>
> </xforms:action>
>
>         </xforms:model>
>
> <xhtml:script type="text/javascript" src="/mosaic/cycle-plan/dynamic-map.js">
> </xhtml:script>
>
>     </xhtml:head>
>
> My buttons are is -
>
> <xhtml:input value="Plan" type="button" onClick="getResults()" />
>
>       <xforms:submit submission="do-get-results">
>             <xforms:label>Plan</xforms:label>
> </xforms:submit>
>
> My java script (dynamic-map.js) contains -
>
> function getResults()
> {
> ORBEON.xforms.Document.dispatchEvent("get-results", "submit");
> }
>
> The xforms submit button works fine, but the standard button doesn't.
>
> At first I tried it without an external-event and used xforms-submit as my event name, that didn't work, so I changed it as above and it still doesn't work.
>
> What am I missing ?
>
>
> Richard Shaw
>
> ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤
>
> Richard Shaw  
> Technical Design Authority - Information Solutions Consultancy  
> Intelligent Transport Systems
>
> Atkins Highways and Transportation
> Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW
>
> Tel: +44 (0) 1372 756407
> Fax: +44 (0) 1372 740055
> Mob: 07740 817586
> E-mail: [hidden email]
>
> www.atkinsglobal.com/its
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of Alessandro Vernet
> Sent: 01 March 2007 00:19
> To: [hidden email]
> Subject: Re: [ops-users] Javascript call after trigger
>
> Hi Richard,
>
> Here is what you can do:
>
> 1. On DOMActivate, you use <xxforms:script> to run some JavaScript.
> 2. This JavaScript displays your message and calls
> ORBEON.xforms.Document.dispatchEvent() to dispatch an event.
> 3. In the event hander for that event you execute your long-running task. At the end of the task you include a <xxforms:script> which hides the message on the client side.
>
> Alex
>
> On 2/28/07, Shaw, Richard A <[hidden email]> wrote:
>  
>> That only works if I put DomActivate as the event type.
>>
>> I've now realised that I need to perform a bit of javascript before the submit occurs - is there a way of doing this ?
>>
>> What I want to do is create my own Loading message in the middle of the screen as well as the red loading message because my submit takes about 20 seconds to complete.
>>
>>
>> Richard Shaw
>>
>> ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤
>>
>> Richard Shaw
>> Technical Design Authority - Information Solutions Consultancy
>> Intelligent Transport Systems
>>
>> Atkins Highways and Transportation
>> Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW
>>
>> Tel: +44 (0) 1372 756407
>> Fax: +44 (0) 1372 740055
>> Mob: 07740 817586
>> E-mail: [hidden email]
>>
>> www.atkinsglobal.com/its
>>
>> -----Original Message-----
>> From: David McIntyre [mailto:[hidden email]]
>> Sent: 26 February 2007 21:33
>> To: [hidden email]
>> Subject: Re: [ops-users] Javascript call after trigger
>>
>> I believe the following would work.  Modify your submission to include
>> an <xxforms:script/> element which contains some javascript to update
>> the map.  Something along the lines of
>>
>> <xforms:submission id="getJourney" replace="instance" ....>
>>     <xxforms:script ev:event="xforms-submit-done">
>>         updateMapExtent();
>>     </xxforms:script>
>> </xforms:submission>
>>
>> See this link for a brief description of this element:
>> http://www.orbeon.com/ops/doc/reference-xforms-ng#xxforms-script-exten
>> sion
>>
>> Cheers,
>>
>> Dave Mc
>>
>>
>>
>>
>> Dave McIntyre   MA, DPhil
>> Software Developer
>> [hidden email]
>> P: +64 9 638 0600
>> F: +64 9 638 0699
>> M: +64 21 212 8087
>> S: dave.mcintyre
>> www.orionhealth.com
>>
>>
>>    
>>>>> "Shaw, Richard A" <[hidden email]> 27/02/2007 4:13
>>>>> a.m. >>>
>>>>>          
>> I have a journey planning page which contains 3 areas -
>> - xform for journey input
>> - div for textual results
>> - map which is javascript driven
>> I've set my form to do a submission with an instance replace so that my textual results appear in the division when they have been returned.
>> What I then need to do is to extract the geographic extents of the journey from the model and update the map position with a javascript call on the client.
>> Is this possible ?
>> If I put my map position data into a hidden xforms input then I can get the extents from there using (  var extents = ORBEON.xforms.Document.getValue('extents');) and call a javascript function to update the map, but what I can't work out is how to get the javascript function to be called at the correct time - I'm using a button at the moment called update map.
>> Richard Shaw
>> ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤
>> Richard Shaw
>> Technical Design Authority - Information Solutions Consultancy
>> Intelligent Transport Systems Atkins Highways and Transportation
>> Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW
>> Tel: +44 (0) 1372 756407
>> Fax: +44 (0) 1372 740055
>> Mob: 07740 817586
>> E-mail: [hidden email]
>> www.atkinsglobal.com/its
>>
>>
>>
>> This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.
>> The ultimate parent company of the Atkins Group is WS Atkins plc.  Registered in England No. 1885586.  Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.
>> P Consider the environment. Please don't print this e-mail unless you really need to.
>>
>> This message has been scanned for viruses by MailControl - (see
>> http://bluepages.wsatkins.co.uk/?6875772)
>>
>>
>>
>> --
>> 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
>>
>>
>>    
>
>
> --
> Orbeon Forms - Web 2.0 Forms for the Enterprise 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
>  




--
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: Javascript call after trigger

Alessandro Vernet
Administrator
On 3/1/07, Ryan Puddephatt <[hidden email]> wrote:
>     The ID "get-results" is defined on an action, this should be the id
> of the submission, the action is referenced by the "submit"

Exactly. So Richard, you should have instead:

ORBEON.xforms.Document.dispatchEvent("main-model", "submit");

Where "main-model" is the id of your model (you need to add one in the
example code you sent earlier).

> also why don't you use the DOMActivate event in the xforms:input like so
> <xforms:send ev:event="DOMActivate" submission="do-get-results"/>
>
> to avoid a possible security risk with leaving the submit event
> accessible to the client

Ryan, I think this is because in his getResults() Richard would like
to display a waiting dialog before dispatching the event.

Alex
--
Orbeon Forms - Web 2.0 Forms for the Enterprise
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
Reply | Threaded
Open this post in threaded view
|

Delete failure

Shaw, Richard A
Can anybody suggest why my delete doesn't work in the following code ? The OIS Monitoring in Eclipse says that it is processing the delete action but it shows that the instance it is returning hasn't been modified.

I haven't upgraded by version of OPS recently, I'm using an early version 3 - not sure how to tell exactly what version I'm using.

        <xforms:group ref="instance('instance')/form">
        <xhtml:div id="input-form">
            <xhtml:table>
                <xhtml:tr>
                    <xhtml:td>
                        Origin:
                                        </xhtml:td>
                                </xhtml:tr>
                                <xhtml:tr>
                    <xhtml:td>
                                                <xforms:input id="origin" ref="origin" class="in-origin"/>
                                        </xhtml:td>
                </xhtml:tr>
                    <xhtml:tr>
                        <xhtml:td>
                            <xforms:group>
                            <xforms:action ev:event="DOMActivate">
                                        <xforms:insert ev:event="DOMActivate" nodeset="vias/via" at="min((last(), index('via-repeat')))" position="after" />
                                                                <xforms:setvalue ref="vias/via[index('via-repeat')]" value="''"/>
                            </xforms:action>
                                    <xforms:trigger appearance="xxforms:image">
                                                                <xxforms:img src="/mosaic/cycle-plan/files/add.gif"/>
                                                                <xforms:label>Add</xforms:label>
                                    </xforms:trigger>
                                    <xforms:trigger appearance="xxforms:link">
                                                                <xforms:label>Add Via</xforms:label>
                                                        </xforms:trigger>
                                                </xforms:group>
                        </xhtml:td>
                    </xhtml:tr>
                    <xforms:repeat nodeset="vias/via[position() &lt; last()]" id="via-repeat">
                        <xhtml:tr>
                   <xhtml:td>
                            <xforms:group>
                                    <xforms:action ev:event="DOMActivate">
                                        <xforms:delete ev:event="DOMActivate" nodeset="vias/via" at="index('via-repeat')" />
                                    </xforms:action>
                                        <xforms:trigger appearance="xxforms:image">
                                                                        <xxforms:img src="/mosaic/cycle-plan/files/remove.gif"/>
                                            <xforms:label>Delete</xforms:label>
                                        </xforms:trigger>
                            </xforms:group>
                                <xforms:input id="via" ref="."/>
                           </xhtml:td>
                   </xhtml:tr>
                </xforms:repeat>
                    <xhtml:tr>
                    <xhtml:td>
                        Destination:
                                        </xhtml:td>
                                </xhtml:tr>
                <xhtml:tr>
                    <xhtml:td>
                        <xforms:input id="destination" ref="destination" class="in-destination"/>
                    </xhtml:td>
                </xhtml:tr>


My instance looks like this -

<model>
    <!-- form contains all of the user entered data -->
    <form>
    <origin>534747,179517</origin>
                <vias>
    <via>enter via</via>
                </vias>
    <destination>534324,177762</destination>
    <skill>1</skill>
                <mapSessionID></mapSessionID>
     </form>
     
     <error/>
     
     <!-- The name of the button pushed -->
     <action/>
     
</model>


Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Richard Shaw  
Technical Design Authority - Information Solutions Consultancy  
Intelligent Transport Systems

Atkins Highways and Transportation
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW

Tel: +44 (0) 1372 756407
Fax: +44 (0) 1372 740055
Mob: 07740 817586
E-mail: [hidden email]

www.atkinsglobal.com/its



This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.

The ultimate parent company of the Atkins Group is WS Atkins plc.  Registered in England No. 1885586.  Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.

Consider the environment. Please don't print this e-mail unless you really need to.



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

Set repeat inputs in javascript

Shaw, Richard A
In reply to this post by Alessandro Vernet
Is it possible to set the value of an input in a repeat section using javascript.

I've tried -

        ORBEON.xforms.Document.setValue('via', 'test');

When my xform contains -

                    <xforms:repeat nodeset="vias/via[position() &lt; last()]" id="via-repeat">
                        <xhtml:tr>
                   <xhtml:td>
                            <xforms:group>
                                    <xforms:action ev:event="DOMActivate">
                                        <xforms:delete ev:event="DOMActivate" nodeset="vias/via" at="index('via-repeat')" />
                                    </xforms:action>
                                        <xforms:trigger appearance="xxforms:image">
                                                                        <xxforms:img src="/mosaic/cycle-plan/files/remove.gif"/>
                                            <xforms:label>Delete</xforms:label>
                                        </xforms:trigger>
                            </xforms:group>
                                <xforms:input id="via" ref="."/>
                           </xhtml:td>
                   </xhtml:tr>
                </xforms:repeat>

I thought it might set the active row in the repeat. But it doesn't do anything.

I'm selecting the via location from a map, and need to get the selected position into the via input box.

Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Richard Shaw  
Technical Design Authority - Information Solutions Consultancy  
Intelligent Transport Systems

Atkins Highways and Transportation
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW

Tel: +44 (0) 1372 756407
Fax: +44 (0) 1372 740055
Mob: 07740 817586
E-mail: [hidden email]

www.atkinsglobal.com/its

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Alessandro Vernet
Sent: 02 March 2007 00:30
To: [hidden email]
Subject: Re: [ops-users] Javascript call after trigger

On 3/1/07, Ryan Puddephatt <[hidden email]> wrote:
>     The ID "get-results" is defined on an action, this should be the
> id of the submission, the action is referenced by the "submit"

Exactly. So Richard, you should have instead:

ORBEON.xforms.Document.dispatchEvent("main-model", "submit");

Where "main-model" is the id of your model (you need to add one in the example code you sent earlier).

> also why don't you use the DOMActivate event in the xforms:input like
> so <xforms:send ev:event="DOMActivate" submission="do-get-results"/>
>
> to avoid a possible security risk with leaving the submit event
> accessible to the client

Ryan, I think this is because in his getResults() Richard would like to display a waiting dialog before dispatching the event.

Alex
--
Orbeon Forms - Web 2.0 Forms for the Enterprise http://www.orbeon.com/



This message has been scanned for viruses by MailControl - (see http://bluepages.wsatkins.co.uk/?6875772)


This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.

The ultimate parent company of the Atkins Group is WS Atkins plc.  Registered in England No. 1885586.  Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.

Consider the environment. Please don't print this e-mail unless you really need to.



--
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: Set repeat inputs in javascript

Joseph Lawrence
Hi Richard,
    I believe it is possible to set the value of an input in a repeat  section using javascript. I have created a sample test case for the same. Please review it. In the attached sample, select the an input control and click the 'Setvalue' link.

Thanks
Joseph Lawrence
Stabilix Solutions

"Shaw, Richard A" <[hidden email]> wrote:
Is it possible to set the value of an input in a repeat section using javascript.

I've tried -

ORBEON.xforms.Document.setValue('via', 'test');

When my xform contains -










Delete







I thought it might set the active row in the repeat. But it doesn't do anything.

I'm selecting the via location from a map, and need to get the selected position into the via input box.

Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Richard Shaw
Technical Design Authority - Information Solutions Consultancy
Intelligent Transport Systems

Atkins Highways and Transportation
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW

Tel: +44 (0) 1372 756407
Fax: +44 (0) 1372 740055
Mob: 07740 817586
E-mail: [hidden email]

www.atkinsglobal.com/its

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Alessandro Vernet
Sent: 02 March 2007 00:30
To: [hidden email]
Subject: Re: [ops-users] Javascript call after trigger

On 3/1/07, Ryan Puddephatt wrote:
> The ID "get-results" is defined on an action, this should be the
> id of the submission, the action is referenced by the "submit"

Exactly. So Richard, you should have instead:

ORBEON.xforms.Document.dispatchEvent("main-model", "submit");

Where "main-model" is the id of your model (you need to add one in the example code you sent earlier).

> also why don't you use the DOMActivate event in the xforms:input like
> so
>
> to avoid a possible security risk with leaving the submit event
> accessible to the client

Ryan, I think this is because in his getResults() Richard would like to display a waiting dialog before dispatching the event.

Alex
--
Orbeon Forms - Web 2.0 Forms for the Enterprise http://www.orbeon.com/



This message has been scanned for viruses by MailControl - (see http://bluepages.wsatkins.co.uk/?6875772)


This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.

The ultimate parent company of the Atkins Group is WS Atkins plc. Registered in England No. 1885586. Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.

Consider the environment. Please don't print this e-mail unless you really need to.


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


TV dinner still cooling?
Check out "Tonight's Picks" on Yahoo! TV.

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

repeat-setvalue.xhtml (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Delete failure

Joseph Lawrence
In reply to this post by Shaw, Richard A
Hi Richard,
    The problem is with the @nodeset value in delete. I have made some slight modification in your code and am attaching it. Please review whether it works as expected.

Thanks
Joseph Lawrence
Stabilix Solutions

"Shaw, Richard A" <[hidden email]> wrote:
Can anybody suggest why my delete doesn't work in the following code ? The OIS Monitoring in Eclipse says that it is processing the delete action but it shows that the instance it is returning hasn't been modified.

I haven't upgraded by version of OPS recently, I'm using an early version 3 - not sure how to tell exactly what version I'm using.






Origin:
















Add


Add Via













Delete








Destination:









My instance looks like this -




534747,179517

enter via

534324,177762
1











Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Richard Shaw
Technical Design Authority - Information Solutions Consultancy
Intelligent Transport Systems

Atkins Highways and Transportation
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW

Tel: +44 (0) 1372 756407
Fax: +44 (0) 1372 740055
Mob: 07740 817586
E-mail: [hidden email]

www.atkinsglobal.com/its



This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.

The ultimate parent company of the Atkins Group is WS Atkins plc. Registered in England No. 1885586. Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.

Consider the environment. Please don't print this e-mail unless you really need to.


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


Check out the all-new Yahoo! Mail beta - Fire up a more powerful email and get things done faster.

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

repeat-delete.xhtml (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Delete failure

Erik Bruchez
Administrator
In reply to this post by Shaw, Richard A
Richard,

This is an easy one. Your xforms:delete is within a xforms:repeat. What
you need to look at is the XPath evaluation context for
xforms:delete/@nodeset. That evaluation context is the node of
xforms:repeat/@nodeset corresponding to the current iteration.

In your case, the current repeat node is one of the vias/via nodes. So
when you write xforms:delete/@nodeset="vias/via", that is evaluated
against a via element, and the result is probably an empty node-set.

You probably want to write:

   xforms:delete/@nodeset="../via"

-Erik

Shaw, Richard A wrote:

> Can anybody suggest why my delete doesn't work in the following code ? The OIS Monitoring in Eclipse says that it is processing the delete action but it shows that the instance it is returning hasn't been modified.
>
> I haven't upgraded by version of OPS recently, I'm using an early version 3 - not sure how to tell exactly what version I'm using.
>
>         <xforms:group ref="instance('instance')/form">
>         <xhtml:div id="input-form">
>             <xhtml:table>
>                 <xhtml:tr>
>                     <xhtml:td>
>                         Origin:
> </xhtml:td>
> </xhtml:tr>
> <xhtml:tr>
>                     <xhtml:td>
> <xforms:input id="origin" ref="origin" class="in-origin"/>
> </xhtml:td>
>                 </xhtml:tr>
>            <xhtml:tr>
>                <xhtml:td>
>             <xforms:group>
>             <xforms:action ev:event="DOMActivate">
>                        <xforms:insert ev:event="DOMActivate" nodeset="vias/via" at="min((last(), index('via-repeat')))" position="after" />
> <xforms:setvalue ref="vias/via[index('via-repeat')]" value="''"/>
>             </xforms:action>
>             <xforms:trigger appearance="xxforms:image">
> <xxforms:img src="/mosaic/cycle-plan/files/add.gif"/>
> <xforms:label>Add</xforms:label>
>             </xforms:trigger>
>             <xforms:trigger appearance="xxforms:link">
> <xforms:label>Add Via</xforms:label>
> </xforms:trigger>
> </xforms:group>
>                </xhtml:td>
>            </xhtml:tr>
>            <xforms:repeat nodeset="vias/via[position() &lt; last()]" id="via-repeat">
>                <xhtml:tr>
>                    <xhtml:td>
>                     <xforms:group>
>             <xforms:action ev:event="DOMActivate">
>                         <xforms:delete ev:event="DOMActivate" nodeset="vias/via" at="index('via-repeat')" />
>             </xforms:action>
>                        <xforms:trigger appearance="xxforms:image">
> <xxforms:img src="/mosaic/cycle-plan/files/remove.gif"/>
>                            <xforms:label>Delete</xforms:label>
>                        </xforms:trigger>
>                     </xforms:group>
>                        <xforms:input id="via" ref="."/>
>            </xhtml:td>
>            </xhtml:tr>
>                 </xforms:repeat>
>            <xhtml:tr>
>                     <xhtml:td>
>                         Destination:
> </xhtml:td>
> </xhtml:tr>
>                 <xhtml:tr>
>                     <xhtml:td>
>                         <xforms:input id="destination" ref="destination" class="in-destination"/>
>                     </xhtml:td>
>                 </xhtml:tr>
>
>
> My instance looks like this -
>
> <model>
>     <!-- form contains all of the user entered data -->
>     <form>
>     <origin>534747,179517</origin>
> <vias>
>     <via>enter via</via>
> </vias>
>     <destination>534324,177762</destination>
>     <skill>1</skill>
> <mapSessionID></mapSessionID>
>      </form>
>      
>      <error/>
>      
>      <!-- The name of the button pushed -->
>      <action/>
>      
> </model>
>
>
> Richard Shaw
>
> ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤
>
> Richard Shaw  
> Technical Design Authority - Information Solutions Consultancy  
> Intelligent Transport Systems
>
> Atkins Highways and Transportation
> Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW
>
> Tel: +44 (0) 1372 756407
> Fax: +44 (0) 1372 740055
> Mob: 07740 817586
> E-mail: [hidden email]
>
> www.atkinsglobal.com/its
>
>
>
> This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.
>
> The ultimate parent company of the Atkins Group is WS Atkins plc.  Registered in England No. 1885586.  Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.
>
> Consider the environment. Please don't print this e-mail unless you really need to.
>
>

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