Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8717807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:22:51+00:00 2026-06-13T06:22:51+00:00

When I call a method in a page with a param in its URI,

  • 0

When I call a method in a page with a param in its URI, the method is not invoked unless I pass the parameters of the uri again. For example if I have:

http://maywebsite/myapp/mypage.xhtml?mykey=myvalue

This method results in error (obviously because it renders the page again without params, but the method foo is never invoked):

<h:commandLink value="Do Action" actionListener="#{mybean.foo}"/>

So I added an ajax to only update the component, but the button is not getting fired:

<h:commandLink value="Do Action" actionListener="#{mybean.foo}">
    <f:ajax render="somecomponent"/>
</h:commandLink>

When I passed the param values again, the button invokes the method just fine:

 <h:commandLink value="Do Action" actionListener="#{mybean.foo}">
     <f:param name="mykey" value="myvalue"/>
     <f:ajax render="somecomponent"/>
 </h:commandLink>

However, this button is included (ui:include) in many pages with different param keys and values. How can I invoke the method without passing the param values?

Im using glassfish 3.1.2, jsf 2.0

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:22:53+00:00Added an answer on June 13, 2026 at 6:22 am

    Apparently the bean is request scoped and the parameter plays a role in the way how the command link is rendered (e.g. by the rendered attribute on one of its parent components, or by a dynamic include of the template containing the command link).

    All those conditions are namely re-evaluated during apply request values phase of the form submit. The developer has to make sure that all those conditions are exactly the same as when the form was presented to the enduser. So, when the bean is request scoped and the parameter is absent, then the command link appears as non-rendered in the component tree and this way its action won’t be invoked.

    Putting the bean in the view scope is the easiest way to fix this (unless you’re using a dynamic <ui:include>, this is then more complicated, you’d need to turn off partial state saving for the particular view).

    See also:

    • commandButton/commandLink/ajax action/listener method not invoked or input value not updated – point 5
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to call a Page Method using a jQuery 'attached' event function, in
i wan to call mvc controller method while page load : public ActionResult Detail(int
i want to call a method that placed in tag in master page like
I have a requirement: I want to call method every day at any particular
I have 2 classes 'Main' and 'FOR'. From 'Main' I will call method 'display'
In my Django web page I need Javascript to call a public method of
I have a method call in my view like this <%= Navigation.with(params) do |menu|
I have a scenario where I need to call a Java method which sets
How to call method of my Service each time Activity unbinds it? It's desirable
I'm trying to call method from .jar But when I want to declare array

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.