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

This is a discussion on is there a way to get action url value of jsf command button - Websphere ; I need to get the url that gets submitted when we submit jsf hx:command button. Is there a way to find the url?...

+ Reply to Thread
Results 1 to 8 of 8

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

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


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

  2. Re: is there a way to get action url value of jsf command button

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

  3. Re: is there a way to get action url value of jsf command button

    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

  4. Re: is there a way to get action url value of jsf command button

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

  5. Re: is there a way to get action url value of jsf command button

    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.

  6. Re: is there a way to get action url value of jsf command button

    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.

  7. Re: is there a way to get action url value of jsf command button

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

  8. Re: is there a way to get action url value of jsf command button

    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

+ Reply to Thread