WebSphere Portal Server - is there a way to get action url value of jsf command button

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > December 2006 > is there a way to get action url value of jsf command button





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author is there a way to get action url value of jsf command button

2006-12-04, 7:26 pm


I need to get the url that gets submitted when we submit jsf hx:command button.
Is there a way to find the url?
yurykats

2006-12-04, 7:26 pm

The button causes the form to be submitted, hence the url is in the action attribute of the form.
bnaha

2006-12-06, 1:33 am

hi ,thanks for the reply.

when we do the submit using regular button in jsf command the processAction() of the portlet calls super.processAction and this super.processAction in turn calls the button action.

However when i simulate button click using javascript and do submit the processAction() of the portlet gets invoked but looks like the super.processAction doesnot call the button action or the jsf life cycle doesnot get executed,

Any particular reason for that? Also from javascript is there something special i need to do to make the processAction in my portlet call super.processAction and execute the jsf life cycle
yurykats

2006-12-06, 3:07 pm

To call button's action method, JSF lifecycle has to know that the form was submitted using this particular button. When you click on a button, the browser puts the button's id in the request parameters to indicate the form was submitted via the button cl
ick. If you submit the form via JS call, the browser doesn't do this and the JSF has no way of knowing that it has to call the button's action method.
bnaha

2006-12-06, 3:07 pm

yury thanks again.
We need a way to invoke the lifecycle. from javascript with using normal JS or using ajax and sending some parameters in xmlhttprequest.Kindly advice us.
yurykats

2006-12-06, 3:07 pm

Lifecycle is invoked. Your button's action isn't executed because you didn't click the button. Which is the correct behavior for the lifecycle.

The two potential solutions could be:
a) use JS to click the button
b) put the additional parameters into request so that JSF thinks the button was clicked.
bnaha

2006-12-06, 3:07 pm

thanks yury.
will try out and post the results on the thread
bnaha

2006-12-06, 3:07 pm

yury thanks for your advice. I was able to invoke lifecycle of jsf using the second option you gave of using the build up of request parameter.
I used AJAX and it worked .
thanks again
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com