Hi, <xforms:setfocus ev:event="xforms-ready"
control="_eventdetails_WAR_eventdetails_redirector" />/* liferay id*/ or <xforms:setfocus ev:event="xforms-ready" control="redirector"
/> <xforms:trigger id="redirector"
appearance="minimal"> <xforms:label>Add </xforms:label> <xforms:action
ev:event="DOMFocusIn"
if="instance('createdby-instance')/loginuser = 'false'"> <xforms:load
resource="http://localhost:8080/web/guest/home" /> </xforms:action> </xforms: trigger> I wanted to redirect the page depending on the user login.
<xforms:setfocus is working fine with orbeon.But When I integrated with liferay, it is not working.What could be the
wrong? Do we have any other method to redirect?. Thanks, Prameela -- 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 |
Administrator
|
Prameela,
<quote author="Prameela R"> <xforms:setfocus ev:event="xforms-ready" control="_eventdetails_WAR_eventdetails_redirector" />/* liferay id*/ or <xforms:setfocus ev:event="xforms-ready" control="redirector" /> <xforms:trigger id="redirector" appearance="minimal"> <xforms:label>Add </xforms:label> <xforms:action ev:event="DOMFocusIn" if="instance('createdby-instance')/loginuser = 'false'"> <xforms:load resource="http://localhost:8080/web/guest/home" /> </xforms:action> </xforms: trigger> I wanted to redirect the page depending on the user login. <xforms:setfocus is working fine with orbeon.But When I integrated with liferay, it is not working.What could be the wrong? </quote> 1) Does the <xforms:load> work at all in the portlet? I.e. if you run it on DOMActivate instead of DOMFocusIn and click on the button, does it got to the page you specified? 2) If it does, what about doing the <xforms:load> directly in the handler for xforms-ready. Does that work for you? Alex |
Hi Alex, >1) Does the <xforms:load> work at all in the portlet? I.e. if you run it on >DOMActivate instead of DOMFocusIn and click on the button, does it got to >the page you specified? Yes it works with DOMActivate. >2) If it does, what about doing the <xforms:load> directly in the handler >for xforms-ready. Does that work for you? <xforms:load> directly with xforms ready is not working. It works with DOM FocusIn So we are trying to set focus on a control .Even I tried with the event xform-focus.But it didn't work. I just want to allow the user to add details if he is logged in else redirect to Login page. -----Original Message----- From: Alessandro Vernet [mailto:[hidden email]] Sent: Tuesday, March 17, 2009 6:05 AM To: [hidden email] Subject: [ops-users] Re: xform:setfocus for redirecting the page Prameela, Prameela R wrote: > > <xforms:setfocus ev:event="xforms-ready" > control="_eventdetails_WAR_eventdetails_redirector" />/* liferay id*/ > > or > > <xforms:setfocus ev:event="xforms-ready" control="redirector" /> > > > > <xforms:trigger id="redirector" appearance="minimal"> > > <xforms:label>Add </xforms:label> > > <xforms:action ev:event="DOMFocusIn" > if="instance('createdby-instance')/loginuser = 'false'"> > > <xforms:load > resource="http://localhost:8080/web/guest/home" /> > > </xforms:action> > > </xforms: trigger> > > > > I wanted to redirect the page depending on the user login. > <xforms:setfocus > is working fine with orbeon.But > > When I integrated with liferay, it is not working.What could be the wrong? > DOMActivate instead of DOMFocusIn and click on the button, does it got to the page you specified? 2) If it does, what about doing the <xforms:load> directly in the handler for xforms-ready. Does that work for you? 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 -- View this message in context: http://www.nabble.com/xform%3Asetfocus-for-redirecting-the-page-tp22510238p2 2550488.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 |
Administrator
|
Prameela,
OK, good. I am wondering if this is because there is a problem with an ID, or because the script sent by the server to the browser to be executed when the page loads isn't running. Could you try to put the following action in the xforms-model-construct-done (or xforms-ready): <xxforms:script>alert("Did run!")</xxforms:script>. Do you see the message "Did run!" when the page loads? Alex |
Hi Alex,
<xforms:action ev:event="xforms-model-construct-done">//(or xforms:ready) <xxforms:script>alert("Did run!")</xxforms:script><xforms:load resource="http://localhost:8080/web/guest/home" /> </xforms:action> Able to get the alert but not xforms:load working under initializing events. Prameela. -----Original Message----- From: Alessandro Vernet [mailto:[hidden email]] Sent: Tuesday, March 17, 2009 10:35 PM To: [hidden email] Subject: [ops-users] RE: Re: xform:setfocus for redirecting the page Prameela, Prameela R wrote: > > Yes it works with DOMActivate. > OK, good. Prameela R wrote: > > <xforms:load> directly with xforms ready is not working. It works > with > DOM FocusIn So we are trying to set focus on a control .Even I tried with > the event xform-focus.But it didn't work. I just want to allow the user to > add details if he is logged in else redirect to Login page. > I am wondering if this is because there is a problem with an ID, or because the script sent by the server to the browser to be executed when the page loads isn't running. Could you try to put the following action in the xforms-model-construct-done (or xforms-ready): <xxforms:script>alert("Did run!")</xxforms:script>. Do you see the message "Did run!" when the page loads? 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 -- View this message in context: http://www.nabble.com/xform%3Asetfocus-for-redirecting-the-page-tp22510238p2 2563699.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 |
Administrator
|
Prameela,
So in the portlet, xxforms:script works, but xforms:setfocus and xforms:load don't. As a work-around, you can try this: set an ID on the control on which you want to set the focus, check in the source of the generated HTML what that ID is (it will have a prefix and/or suffix added), and run <xxforms:script>document.getElementById(thatID).focus();</xxforms:script>. If the element is an input, the getElementById() returns the around the input, so you need to get the input inside the span before you do the focus(). Of course, ideally both xforms:setfocus and xforms:load should work in xforms-model-construct-done for portlets. Issues that happen only in portlet mode tend to have a lesser priority for us right now, so you might want to investigate this yourself if you'd like, and of course if you fix this, please do contribute your change back ;), and we'll make sure to integrate your contribution in the source tree. Alex |
Thanks Alex,
This solution is ok to some extent. -----Original Message----- From: Alessandro Vernet [mailto:[hidden email]] Sent: Thursday, March 19, 2009 1:56 PM To: [hidden email] Subject: [ops-users] RE: RE: Re: xform:setfocus for redirecting the page Prameela, Prameela R wrote: > > Able to get the alert but not xforms:load working under initializing > events. > So in the portlet, xxforms:script works, but xforms:setfocus and xforms:load don't. As a work-around, you can try this: set an ID on the control on which you want to set the focus, check in the source of the generated HTML what that ID is (it will have a prefix and/or suffix added), and run <xxforms:script>document.getElementById(thatID).focus();</xxforms:script>. If the element is an input, the getElementById() returns the around the input, so you need to get the input inside the span before you do the focus(). Of course, ideally both xforms:setfocus and xforms:load should work in xforms-model-construct-done for portlets. Issues that happen only in portlet mode tend to have a lesser priority for us right now, so you might want to investigate this yourself if you'd like, and of course if you fix this, please do contribute your change back ;), and we'll make sure to integrate your contribution in the source tree. 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 -- View this message in context: http://www.nabble.com/xform%3Asetfocus-for-redirecting-the-page-tp22510238p2 2595083.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 |
Administrator
|
Prameela,
I'm glad this work-around works for you, for now. Alex |
Free forum by Nabble | Edit this page |