Javascript Integration - notify of events?

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

Javascript Integration - notify of events?

Hank Ratzesberger

The documentation describes accessing <input> values,
but is there a way to be notified of a submission
or some other xml event?

I want to integrate with Google maps and I want to
update the map when values change.  I suppose I
could do this asynchronously, using an non-xforms
'update' button that calls a javascript function,
or a timer function that looks at a hidden value
(update-time).

Suggestions welcome.

Thanks,
Hank Ratzesberger

NEES@UCSB
www.nees.ucsb.edu





--
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 Integration - notify of events?

Alessandro  Vernet
Administrator
Hi Hank,

You are making a very good point. This also came up a few times
recently so I felt the need to summarize what can be done today and
the plans are for tomorrow on:

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

Comments are welcome!

Alex

On 6/2/06, Hank Ratzesberger <[hidden email]> wrote:

>
> The documentation describes accessing <input> values,
> but is there a way to be notified of a submission
> or some other xml event?
>
> I want to integrate with Google maps and I want to
> update the map when values change.  I suppose I
> could do this asynchronously, using an non-xforms
> 'update' button that calls a javascript function,
> or a timer function that looks at a hidden value
> (update-time).
>
> Suggestions welcome.
>
> Thanks,
> Hank Ratzesberger
>
> NEES@UCSB
> www.nees.ucsb.edu
>
>
>
>
>
>
> --
> 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
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Javascript Integration - notify of events?

Hank Ratzesberger

Alex,

I like your proposal.  I think it is a very
practical extension.  It is one thing for
proposal writers to obscure all system implementation,
but for application writers, eventually there's
a "bump in the road."

In my brief look at xforms.js, I didn't see
a way to smooth out one more issue, inspecting
an instance document.  e.g.:

 var myNode = getXFormsInstance('instance_name');

which would return the document node for the
instance, with the understanding that changing
any values is "unsupported."

Cheers,
Hank

Quoting Alessandro Vernet <[hidden email]>:

> Hi Hank,
>
> You are making a very good point. This also came up a few times
> recently so I felt the need to summarize what can be done today and
> the plans are for tomorrow on:
>
> https://wiki.objectweb.org/ops/Wiki.jsp?page=XFormsJavaScriptEventHandlers
>
> Comments are welcome!
>
> Alex
>
> On 6/2/06, Hank Ratzesberger <[hidden email]> wrote:
> >
> > The documentation describes accessing <input> values,
> > but is there a way to be notified of a submission
> > or some other xml event?
> >
> > I want to integrate with Google maps and I want to
> > update the map when values change.  I suppose I
> > could do this asynchronously, using an non-xforms
> > 'update' button that calls a javascript function,
> > or a timer function that looks at a hidden value
> > (update-time).
> >
> > Suggestions welcome.
> >
> > Thanks,
> > Hank Ratzesberger
> >
> > NEES@UCSB
> > www.nees.ucsb.edu
>

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




--
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 Integration - notify of events?

Hank Ratzesberger
Correction:

var myNode = getInstanceDocument('myDocID');

per the 1.0 recomendation. (Next you will
show that it's already implemented and I can
really be red-faced ;)

Cheers,
Hank

----- Original Message -----
From: <[hidden email]>
To: <[hidden email]>
Sent: Saturday, June 03, 2006 9:05 AM
Subject: Re: [ops-users] Javascript Integration - notify of events?


>
> Alex,
>
> I like your proposal.  I think it is a very
> practical extension.  It is one thing for
> proposal writers to obscure all system implementation,
> but for application writers, eventually there's
> a "bump in the road."
>
> In my brief look at xforms.js, I didn't see
> a way to smooth out one more issue, inspecting
> an instance document.  e.g.:
>
> var myNode = getXFormsInstance('instance_name');
>
> which would return the document node for the
> instance, with the understanding that changing
> any values is "unsupported."
>
> Cheers,
> Hank
>
> Quoting Alessandro Vernet <[hidden email]>:
>
>> Hi Hank,
>>
>> You are making a very good point. This also came up a few times
>> recently so I felt the need to summarize what can be done today and
>> the plans are for tomorrow on:
>>
>> https://wiki.objectweb.org/ops/Wiki.jsp?page=XFormsJavaScriptEventHandlers
>>
>> Comments are welcome!
>>
>> Alex
>>
>> On 6/2/06, Hank Ratzesberger <[hidden email]> wrote:
>> >
>> > The documentation describes accessing <input> values,
>> > but is there a way to be notified of a submission
>> > or some other xml event?
>> >
>> > I want to integrate with Google maps and I want to
>> > update the map when values change.  I suppose I
>> > could do this asynchronously, using an non-xforms
>> > 'update' button that calls a javascript function,
>> > or a timer function that looks at a hidden value
>> > (update-time).
>> >
>> > Suggestions welcome.
>> >
>> > Thanks,
>> > Hank Ratzesberger
>> >
>> > NEES@UCSB
>> > www.nees.ucsb.edu
>>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>
>

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


>
> --
> 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 Integration - notify of events?

Alessandro  Vernet
Administrator
Hi Hank,

You can't use getInstanceDocument('myDocID') in JavaScript because the
whole instance is not sent to the browser. Only the parts that are
bound to XForms controls are available. In general, the benefit of not
having to send the whole instance (security and speed) outweighs the
drawback of not being able to see the whole instance in JavaScript.

If the logic you want to implement in JavaScript is such that having
access to just parts of the instance is not practical and that you
need to have access to the whole, at this point you will have to
implement this on the server-side and use an <xforms:submission> to
call that code.

Alex

On 6/5/06, Hank Ratzesberger <[hidden email]> wrote:

> Correction:
>
> var myNode = getInstanceDocument('myDocID');
>
> per the 1.0 recomendation. (Next you will
> show that it's already implemented and I can
> really be red-faced ;)
>
> Cheers,
> Hank
>
> ----- Original Message -----
> From: <[hidden email]>
> To: <[hidden email]>
> Sent: Saturday, June 03, 2006 9:05 AM
> Subject: Re: [ops-users] Javascript Integration - notify of events?
>
>
> >
> > Alex,
> >
> > I like your proposal.  I think it is a very
> > practical extension.  It is one thing for
> > proposal writers to obscure all system implementation,
> > but for application writers, eventually there's
> > a "bump in the road."
> >
> > In my brief look at xforms.js, I didn't see
> > a way to smooth out one more issue, inspecting
> > an instance document.  e.g.:
> >
> > var myNode = getXFormsInstance('instance_name');
> >
> > which would return the document node for the
> > instance, with the understanding that changing
> > any values is "unsupported."
> >
> > Cheers,
> > Hank
> >
> > Quoting Alessandro Vernet <[hidden email]>:
> >
> >> Hi Hank,
> >>
> >> You are making a very good point. This also came up a few times
> >> recently so I felt the need to summarize what can be done today and
> >> the plans are for tomorrow on:
> >>
> >> https://wiki.objectweb.org/ops/Wiki.jsp?page=XFormsJavaScriptEventHandlers
> >>
> >> Comments are welcome!
> >>
> >> Alex
> >>
> >> On 6/2/06, Hank Ratzesberger <[hidden email]> wrote:
> >> >
> >> > The documentation describes accessing <input> values,
> >> > but is there a way to be notified of a submission
> >> > or some other xml event?
> >> >
> >> > I want to integrate with Google maps and I want to
> >> > update the map when values change.  I suppose I
> >> > could do this asynchronously, using an non-xforms
> >> > 'update' button that calls a javascript function,
> >> > or a timer function that looks at a hidden value
> >> > (update-time).
> >> >
> >> > Suggestions welcome.
> >> >
> >> > Thanks,
> >> > Hank Ratzesberger
> >> >
> >> > NEES@UCSB
> >> > www.nees.ucsb.edu
> >>
> >
> >
> > ----------------------------------------------------------------
> > This message was sent using IMP, the Internet Messaging Program.
> >
> >
> >
>
>
> --------------------------------------------------------------------------------
>
>
> >
> > --
> > 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
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Javascript Integration - notify of events?

Erik Bruchez
Administrator
Alex,

Of course that's right, but to be fair to Hank, it wouldn't be
*impossible* to provide (at least read-only) access to instances from
JavaScript, whether the JavaScript is run on the client or on the server.

Currently, we do not implement DOM access from JavaScript. Note that
this is not a mandatory part of the XForms spec ("XForms Processors that
implement DOM...").

-Erik

Alessandro Vernet wrote:

> Hi Hank,
>
> You can't use getInstanceDocument('myDocID') in JavaScript because the
> whole instance is not sent to the browser. Only the parts that are
> bound to XForms controls are available. In general, the benefit of not
> having to send the whole instance (security and speed) outweighs the
> drawback of not being able to see the whole instance in JavaScript.
>
> If the logic you want to implement in JavaScript is such that having
> access to just parts of the instance is not practical and that you
> need to have access to the whole, at this point you will have to
> implement this on the server-side and use an <xforms:submission> to
> call that code.
>
> Alex
>
> On 6/5/06, Hank Ratzesberger <[hidden email]> wrote:
>> Correction:
>>
>> var myNode = getInstanceDocument('myDocID');
>>
>> per the 1.0 recomendation. (Next you will
>> show that it's already implemented and I can
>> really be red-faced ;)
>>
>> Cheers,
>> Hank
>>
>> ----- Original Message -----
>> From: <[hidden email]>
>> To: <[hidden email]>
>> Sent: Saturday, June 03, 2006 9:05 AM
>> Subject: Re: [ops-users] Javascript Integration - notify of events?
>>
>>
>> >
>> > Alex,
>> >
>> > I like your proposal.  I think it is a very
>> > practical extension.  It is one thing for
>> > proposal writers to obscure all system implementation,
>> > but for application writers, eventually there's
>> > a "bump in the road."
>> >
>> > In my brief look at xforms.js, I didn't see
>> > a way to smooth out one more issue, inspecting
>> > an instance document.  e.g.:
>> >
>> > var myNode = getXFormsInstance('instance_name');
>> >
>> > which would return the document node for the
>> > instance, with the understanding that changing
>> > any values is "unsupported."
>> >
>> > Cheers,
>> > Hank
>> >
>> > Quoting Alessandro Vernet <[hidden email]>:
>> >
>> >> Hi Hank,
>> >>
>> >> You are making a very good point. This also came up a few times
>> >> recently so I felt the need to summarize what can be done today and
>> >> the plans are for tomorrow on:
>> >>
>> >>
>> https://wiki.objectweb.org/ops/Wiki.jsp?page=XFormsJavaScriptEventHandlers 
>>
>> >>
>> >> Comments are welcome!
>> >>
>> >> Alex
>> >>
>> >> On 6/2/06, Hank Ratzesberger <[hidden email]> wrote:
>> >> >
>> >> > The documentation describes accessing <input> values,
>> >> > but is there a way to be notified of a submission
>> >> > or some other xml event?
>> >> >
>> >> > I want to integrate with Google maps and I want to
>> >> > update the map when values change.  I suppose I
>> >> > could do this asynchronously, using an non-xforms
>> >> > 'update' button that calls a javascript function,
>> >> > or a timer function that looks at a hidden value
>> >> > (update-time).
>> >> >
>> >> > Suggestions welcome.
>> >> >
>> >> > Thanks,
>> >> > Hank Ratzesberger
>> >> >
>> >> > NEES@UCSB
>> >> > www.nees.ucsb.edu
>> >>
>> >
>> >
>> > ----------------------------------------------------------------
>> > This message was sent using IMP, the Internet Messaging Program.
>> >
>> >
>> >
>>
>>
>> --------------------------------------------------------------------------------
>>
>>
>>
>> >
>> > --
>> > 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
>>
>>
>>
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> 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 - XForms Everywhere:
http://www.orbeon.com/blog/



--
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 Integration - notify of events?

Hank Ratzesberger
Thanks for reviewing this Alex and Erik.

In fact, the data I need comes from a URL.  It is
not very large so it is not really noticeable that
it is being called once by the page flow controller
and again by the Google GMap api's version of
xmlHttpRequest().

So, I'm not stopped at all, so I think the issue
can be filed away until and unless the user
community clamors for it.

Best,
Hank


----- Original Message -----
From: "Erik Bruchez" <[hidden email]>
To: <[hidden email]>
Sent: Monday, June 05, 2006 2:28 PM
Subject: Re: [ops-users] Javascript Integration - notify of events?


> Alex,
>
> Of course that's right, but to be fair to Hank, it wouldn't be
> *impossible* to provide (at least read-only) access to instances from
> JavaScript, whether the JavaScript is run on the client or on the server.
>
> Currently, we do not implement DOM access from JavaScript. Note that
> this is not a mandatory part of the XForms spec ("XForms Processors that
> implement DOM...").
>
> -Erik
>
> Alessandro Vernet wrote:
>> Hi Hank,
>>
>> You can't use getInstanceDocument('myDocID') in JavaScript because the
>> whole instance is not sent to the browser. Only the parts that are
>> bound to XForms controls are available. In general, the benefit of not
>> having to send the whole instance (security and speed) outweighs the
>> drawback of not being able to see the whole instance in JavaScript.
>>
>> If the logic you want to implement in JavaScript is such that having
>> access to just parts of the instance is not practical and that you
>> need to have access to the whole, at this point you will have to
>> implement this on the server-side and use an <xforms:submission> to
>> call that code.
>>
>> Alex
>>
>> On 6/5/06, Hank Ratzesberger <[hidden email]> wrote:
>>> Correction:
>>>
>>> var myNode = getInstanceDocument('myDocID');
>>>
>>> per the 1.0 recomendation. (Next you will
>>> show that it's already implemented and I can
>>> really be red-faced ;)
>>>
>>> Cheers,
>>> Hank
>>>
>>> ----- Original Message -----
>>> From: <[hidden email]>
>>> To: <[hidden email]>
>>> Sent: Saturday, June 03, 2006 9:05 AM
>>> Subject: Re: [ops-users] Javascript Integration - notify of events?
>>>
>>>
>>> >
>>> > Alex,
>>> >
>>> > I like your proposal.  I think it is a very
>>> > practical extension.  It is one thing for
>>> > proposal writers to obscure all system implementation,
>>> > but for application writers, eventually there's
>>> > a "bump in the road."
>>> >
>>> > In my brief look at xforms.js, I didn't see
>>> > a way to smooth out one more issue, inspecting
>>> > an instance document.  e.g.:
>>> >
>>> > var myNode = getXFormsInstance('instance_name');
>>> >
>>> > which would return the document node for the
>>> > instance, with the understanding that changing
>>> > any values is "unsupported."
>>> >
>>> > Cheers,
>>> > Hank
>>> >
>>> > Quoting Alessandro Vernet <[hidden email]>:
>>> >
>>> >> Hi Hank,
>>> >>
>>> >> You are making a very good point. This also came up a few times
>>> >> recently so I felt the need to summarize what can be done today and
>>> >> the plans are for tomorrow on:
>>> >>
>>> >>
>>> https://wiki.objectweb.org/ops/Wiki.jsp?page=XFormsJavaScriptEventHandlers 
>>>
>>> >>
>>> >> Comments are welcome!
>>> >>
>>> >> Alex
>>> >>
>>> >> On 6/2/06, Hank Ratzesberger <[hidden email]> wrote:
>>> >> >
>>> >> > The documentation describes accessing <input> values,
>>> >> > but is there a way to be notified of a submission
>>> >> > or some other xml event?
>>> >> >
>>> >> > I want to integrate with Google maps and I want to
>>> >> > update the map when values change.  I suppose I
>>> >> > could do this asynchronously, using an non-xforms
>>> >> > 'update' button that calls a javascript function,
>>> >> > or a timer function that looks at a hidden value
>>> >> > (update-time).
>>> >> >
>>> >> > Suggestions welcome.
>>> >> >
>>> >> > Thanks,
>>> >> > Hank Ratzesberger
>>> >> >
>>> >> > NEES@UCSB
>>> >> > www.nees.ucsb.edu
>>> >>
>>> >
>>> >
>>> > ----------------------------------------------------------------
>>> > This message was sent using IMP, the Internet Messaging Program.
>>> >



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