Problems with Ephemeral Messages, Timers and Dispatch Delays

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

Problems with Ephemeral Messages, Timers and Dispatch Delays

Andrew Bailey
Hi,

I wanted to have an ephemeral message, I saw in a post that in 2006
that it wasnt supported, is it still not supported?

As it didnt work I tried all sorts of things like creating a timer, is
that supported yet?
I thought about trying to recreate the type of message in gmail when
an email is sent.

Also dispatching an event to an action with a delay, the delay didnt
seem to work when it was inside the action inside the submission.(see
below)
When it was just inside the submission with the
ev:event="xforms-submit-done" it seemed to fire with the delay after
the form ready event.

I know I could resort to javascript but the whole point of using
xforms for me is to avoid scripting.

Can someone put me straight on how the event model works in orbeon?

Andy Bailey
http://www.hazlorealidad.com

My comments for the email start with //

<xf:action ev:event="clearMessageEvent">
        <xf:setvalue  bind="message" value="'Ready'"/>
</xf:action>

<xf:timer id="timer" timeout="1000" repeat="true">
        <xf:setvalue id="clear" ev:event="xforms-timer"
bind="message" value="'Ready'"/>
</xf:timer>

<xf:submission id="setpart"
resource="{concat('........(edited)......../',instance('parameters')/part-id,'.xml')}"
method="put" replace="none" instance="part">
<xf:action ev:event="xforms-submit-done">
//I eventually resorted to a modal message
<xf:message ev:event="xforms-submit-error" level="modal">Part Saved</xf:message>
<!--
//This didnt work the delay didnt seem to have any effect
        <xf:setvalue  bind="message" value="'Part Saved'"/>
        <xf:dispatch  name="clearMessageEvent" target="model" delay="1000"/>
-->
</xf:action>
<!--

//with the delay here it gets executed a short time after the form loads
(I presume 1 sec after the form ready event) Im not sure how would
that be  a bug?
        <xf:setvalue  ev:event="xforms-submit-done"  bind="message"
value="'Ready'" delay="1000"/>

//tried to dispatch an event to start the timer inside the submission,
but then thought that timers might need to be delared directly under
the model element
//but still no luck
        <xf:dispatch ev:event="xforms-submit-done"
name="xforms-start-timer" target="timer"/>
<xf:timer ev:event="xforms-submit-done"  id="timer" timeout="1000"
repeat="true">
        <xf:setvalue id="clear" ev:event="xforms-timer"
bind="message" value="'Ready'"/>
</xf:timer>
-->
</xf:submission>


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Problems with Ephemeral Messages, Timers and Dispatch Delays

Erik Bruchez
Administrator
> I wanted to have an ephemeral message, I saw in a post that in 2006
> that it wasnt supported, is it still not supported?

Still not supported, sorry.

> As it didnt work I tried all sorts of things like creating a timer, is
> that supported yet?

The closest thing to a timer in XForms is the new XForms 1.1  
xforms:dispatch/@delay attribute, which we don't support yet. But we  
may support it soon.

I see in your example an xf:timer element: there is no such thing in  
XForms.

> Also dispatching an event to an action with a delay, the delay didnt
> seem to work when it was inside the action inside the submission.(see
> below)

See above.

> When it was just inside the submission with the
> ev:event="xforms-submit-done" it seemed to fire with the delay after
> the form ready event.

At the moment @delay won't do anything.

> I know I could resort to javascript but the whole point of using
> xforms for me is to avoid scripting.

Agreed. It seems that we should support ephemeral messages, and  
xforms:dispatch/@delay. That should come in time, and if somebody  
wants to help us implement this it would be nice.

> Can someone put me straight on how the event model works in orbeon?

In general it works as it should, I think ;-) What exactly would you  
like to know?

-Erik

--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Problems with Ephemeral Messages, Timers and Dispatch Delays

Andrew Bailey
> I see in your example an xf:timer element: there is no such thing in XForms.
>
I saw  http://www.w3.org/MarkUp/Forms/wiki/XForms_Timer
under the Category XFormsFutureFeatures.
Ok I was just hoping that Orbeon had implemented it :)

>
> Agreed. It seems that we should support ephemeral messages, and
> xforms:dispatch/@delay. That should come in time, and if somebody wants to
> help us implement this it would be nice.
>

I thought of something like this in the meantime:

<script>
<![CDATA[
function delayedDispatch(targetId,eventName,delay) {
var timer='ORBEON.xforms.Document.dispatchEvent("'+targetId+'","'+eventName+'")';
return window.setTimeout(timer, delay);
}
]]>
</script>

....
<xf:bind id="message" nodeset="instance('parameters')/message"/>

<xf:action ev:event="clearMessageEvent">
        <xf:setvalue  bind="message" value="'Ready'"/>
</xf:action>


<xf:submission ...
<xf:action ev:event="xforms-submit-done">
        <xf:setvalue  bind="message" value="'Part Saved'"/>
<!--
        <xf:dispatch  name="clearMessageEvent" target="model" delay="1000"/>
-->
<xxf:script>
delayedDispatch("model","clearMessageEvent",1000);
window.status='Delayed Event Setup';
</xxf:script>
</xf:action>
...
 </head>
   <body>
<xf:output bind="message"/>
....

Although I think I have a problem as Welcome (the message from the
instance appears
the part gets saved but neither the messages Part Saved nor ready appear.
I think the problem is more to do with the bind than the events as the
status bar messages are appearing.

No error messages appear in the ops.log nor in the firefox Error Console.

>>    Can someone put me straight on how the event model works in orbeon?
>In general it works as it should, I think ;-) What exactly would you like to know?

Can you spot why it didnt work?


Andy Bailey
http://www.hazlorealidad.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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Problems with Ephemeral Messages, Timers and Dispatch Delays

Alessandro Vernet
Administrator
Andrew,

On Sat, Jul 19, 2008 at 7:06 AM, Andrew Bailey <[hidden email]> wrote:
> Can you spot why it didnt work?

We have done something like this in a couple of occasions, but it is
hard to debug just looking at the code. Do you have an example that
shows the issue and that runs in the sandbox?

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws