Custom events doesn't work when orbeon is in portal

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

Custom events doesn't work when orbeon is in portal

Mauno
Hi.
I've had difficulties getting custom javascript events to work properly.

I added
 xxforms:external-events="wdid-invalid wdid-valid"  to my model (I have only 1 model).

and I've this control in body:
<xforms:input id="wdid" ref="wdId">
  <xforms:action ev:event="xforms-value-changed">
     <xxforms:script>
      ORBEON.xforms.Document.dispatchEvent("wdid", "wdid-invalid");
     </xxforms:script>
  </xforms:action>
  <xforms:action ev:event="wdid-invalid">
         <xforms:setvalue ref="instance('data')/wdid/isValid">false</xforms:setvalue>
  </xforms:action>
</xforms:input>


I've tried dispatching other events also, DOMActivate, DOMFocusOut, etc..But nothing seem to work.

I tested "custom-events" example in portlet and it doesn't work either. It works if I test it with ops-servlet.

Events are sent to server if I observe http post:
    <xxforms:action>
        <xxforms:event name="wdid-invalid" source-control-id="wdid"></xxforms:event>

Versions: Tomcat 5.5, Liferay 4.3.4, Orbeon Forms Release 3.6.0.200802010415.


Reply | Threaded
Open this post in threaded view
|

Re: Custom events doesn't work when orbeon is in portal

Mark.El
Hi Mauno,

Are you sure your portlet is functioning at all?

You should make sure the sample portlet works... that way you can discount environment set up.

One thing I found useful solving an issue today is to use Firebug plugin for Firefox, that way you can see Javascript errors what is getting posted and alot more information!

Regards

Mark

On Wed, Mar 5, 2008 at 2:30 PM, Mauno <[hidden email]> wrote:

Hi.
I've had difficulties getting custom javascript events to work properly.

I added
 xxforms:external-events="wdid-invalid wdid-valid"  to my model (I have only
1 model).

and I've this control in body:
<xforms:input id="wdid" ref="wdId">
 <xforms:action ev:event="xforms-value-changed">
    <xxforms:script>
     ORBEON.xforms.Document.dispatchEvent("wdid", "wdid-invalid");
    </xxforms:script>
 </xforms:action>
 <xforms:action ev:event="wdid-invalid">
        <xforms:setvalue
ref="instance('data')/wdid/isValid">false</xforms:setvalue>
 </xforms:action>
</xforms:input>


I've tried dispatching other events also, DOMActivate, DOMFocusOut, etc..But
nothing seem to work.

I tested "custom-events" example in portlet and it doesn't work either. It
works if I test it with ops-servlet.

Events are sent to server if I observe http post:
   <xxforms:action>
       <xxforms:event name="wdid-invalid"
source-control-id="wdid"></xxforms:event>

Versions: Tomcat 5.5, Liferay 4.3.4, Orbeon Forms Release
3.6.0.200802010415.



--
View this message in context: http://www.nabble.com/Custom-events-doesn%27t-work-when-orbeon-is-in-portal-tp15850095p15850095.html
Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.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




--
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: Custom events doesn't work when orbeon is in portal

Mauno
Hi,
Yes portlet is functioning. Everything is working properly but custom events are not.

Example application "xforms-sandbox/samples/custom-events.xhtml" works in servlet but not in portlet. It loads and shows input contaning "abc" but no dialog is shown.

Also http-post for event is successful so problem exists at server side.

Mark.El wrote
Hi Mauno,

Are you sure your portlet is functioning at all?

You should make sure the sample portlet works... that way you can discount
environment set up.

One thing I found useful solving an issue today is to use Firebug plugin for
Firefox, that way you can see Javascript errors what is getting posted and
alot more information!

Regards

Mark

On Wed, Mar 5, 2008 at 2:30 PM, Mauno <mauno@leegio.net> wrote:

>
> Hi.
> I've had difficulties getting custom javascript events to work properly.
>
> I added
>  xxforms:external-events="wdid-invalid wdid-valid"  to my model (I have
> only
> 1 model).
>
> and I've this control in body:
> <xforms:input id="wdid" ref="wdId">
>  <xforms:action ev:event="xforms-value-changed">
>     <xxforms:script>
>      ORBEON.xforms.Document.dispatchEvent("wdid", "wdid-invalid");
>     </xxforms:script>
>  </xforms:action>
>  <xforms:action ev:event="wdid-invalid">
>         <xforms:setvalue
> ref="instance('data')/wdid/isValid">false</xforms:setvalue>
>  </xforms:action>
> </xforms:input>
>
>
> I've tried dispatching other events also, DOMActivate, DOMFocusOut,
> etc..But
> nothing seem to work.
>
> I tested "custom-events" example in portlet and it doesn't work either. It
> works if I test it with ops-servlet.
>
> Events are sent to server if I observe http post:
>    <xxforms:action>
>        <xxforms:event name="wdid-invalid"
> source-control-id="wdid"></xxforms:event>
>
> Versions: Tomcat 5.5, Liferay 4.3.4, Orbeon Forms Release
> 3.6.0.200802010415.
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Custom-events-doesn%27t-work-when-orbeon-is-in-portal-tp15850095p15850095.html
> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>
>
>
> --
> You receive this message as a subscriber of the ops-users@ow2.org mailing
> list.
> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
> For general help: mailto:sympa@ow2.org?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Custom events doesn't work when orbeon is in portal

Alessandro Vernet
Administrator
>  Yes portlet is functioning. Everything is working properly but custom events
>  are not.

Which portal server are you using?

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/


--
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: Custom events doesn't work when orbeon is in portal

Mauno
Liferay 4.3.4

Alessandro Vernet wrote
Which portal server are you using?
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Custom events doesn't work when orbeon is in portal

Alessandro Vernet
Administrator
On Wed, Mar 5, 2008 at 11:29 PM, Mauno <[hidden email]> wrote:
>  Liferay 4.3.4

OK. This is intriguing. There is really nothing special going on the
client-side to handle custom events, so it shouldn't make a difference
that the application is running as a portlet. I am wondering if it is
not the initial <xxforms:script> that is supposed to run when the page
loads which in this case doesn't run (this is used in the
custom-events example). What if you dispatch the custom event on a
user's action (e.g. DOMActivate on a trigger)? Also, do you see any
JavaScript error on the client? Is the behavior the same on IE and
Firefox?

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/


--
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: Custom events doesn't work when orbeon is in portal

Mauno
Alessandro Vernet wrote
OK. This is intriguing. There is really nothing special going on the
client-side to handle custom events, so it shouldn't make a difference
that the application is running as a portlet. I am wondering if it is
not the initial <xxforms:script> that is supposed to run when the page
loads which in this case doesn't run (this is used in the
custom-events example). What if you dispatch the custom event on a
user's action (e.g. DOMActivate on a trigger)? Also, do you see any
JavaScript error on the client? Is the behavior the same on IE and
Firefox?
Client seems to process it as it sould. No javascript errors shown with firebug and XHR is also ok. It's posts custom-event to server.
    <xxforms:action>
        <xxforms:event name="wdid-invalid" source-control-id="wdid"></xxforms:event> 

Same bug occurs with that custom event example if it's accessed though liferay.
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Custom events doesn't work when orbeon is in portal

Alessandro Vernet
Administrator
On Sun, Apr 6, 2008 at 10:54 PM, Mauno <[hidden email]> wrote:
>  Client seems to process it as it sould. No javascript errors shown with
>  firebug and XHR is also ok. It's posts custom-event to server.
>
>     <xxforms:action>
>         <xxforms:event name="wdid-invalid"
>  source-control-id="wdid"></xxforms:event>

So the event is sent from the browser to the server. And what do you
have in the Ajax response? What is in the Ajax response when you run
the same code in another servlet container (say Tomcat)?

>  Same bug occurs with that custom event example if it's accessed though
>  liferay.

Sorry, I don't get that part. I thought that the problem *only*
occurred in Liferay. Did I misunderstand what you were saying?

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/


--
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: Re: Custom events doesn't work when orbeon is in portal

Mauno

Alessandro Vernet wrote
On Sun, Apr 6, 2008 at 10:54 PM, Mauno <mauno@leegio.net> wrote:

Sorry, I don't get that part. I thought that the problem *only*
occurred in Liferay. Did I misunderstand what you were saying?
Problem only occurs when form is used within Liferay. Same bug occurs with custom-events example if I access it though portlet.

With custom-events example post goes like this:
<!DOCTYPE xxforms:event-request [<!ENTITY nbsp "&#160;">]>

<xxforms:event-request xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">

    <xxforms:static-state>pers:6D0BEC4C-E294-717A-75BD-2B71A447BE17</xxforms:static-state>

    <xxforms:dynamic-state>pers:EE3D056E-3D7D-552B-C9AB-6E09EE557E1F</xxforms:dynamic-state>

    <xxforms:action>

        <xxforms:event name="acme-super-event" source-control-id="main-model"></xxforms:event>

    </xxforms:action>

</xxforms:event-request>


and response is:

<?xml version="1.0" encoding="utf-8"?>

<xxf:event-response xmlns:xxf="http://orbeon.org/oxf/xml/xforms">

 <xxf:dynamic-state>pers:EE3D056E-3D7D-552B-C9AB-6E09EE557E1F</xxf:dynamic-state>

 <xxf:action>

  <xxf:control-values/>

 </xxf:action>

</xxf:event-response>
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Custom events doesn't work when orbeon is in portal

Alessandro Vernet
Administrator
On Mon, Apr 7, 2008 at 2:32 AM, Mauno <[hidden email]> wrote:
>  Problem only occurs when form is used within Liferay. Same bug occurs with
>  custom-events example if I access it though portlet.
>
>  With custom-events example post goes like this:
>  [...]

OK, I see. Thank you for the detailed description. We just discussed
this with Erik and most likely, the model ID is prefixed in the engine
(like all the other IDs, so you don't have conflicts between
portlets), but it is not prefixed in the JavaScript code. So when your
JavaScript code tell the server to dispatch the event to "main-model",
the server doesn't because there is no model called "main-model".
Behind the scene that model has a prefix before "main-model". I added
a bug for this:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=309059&group_id=168&atid=350207

In the meantime, you can try to see what prefix is added to the IDs in
your portlet and change your JavaScript code to use that prefix before
"main-model".

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/


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