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 6115853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:08:23+00:00 2026-05-23T15:08:23+00:00

imagine there is BeanA bound to ViewA.xhtml and BeanB bound to ViewB.xhtml. BeanA and

  • 0

imagine there is BeanA bound to ViewA.xhtml and BeanB bound to ViewB.xhtml. BeanA and BeanB are backing beans with just one attribute per bean: “Object obj;” with getters and setters.

Now i am in ViewA doing the following:

<ui:repeat value="#{someOtherBean.listOfObjects}" var="objSelected">
    <h:commandLink value="someValue" action="ViewB"> 
        <f:setPropertyActionListener target="#{beanB.obj}" value="#{objSelected}" />
    </h:commandLink>
</ui:repeat>

This works great! I iterate through a List and the object i click on (via commandLink) is set into BeanB.

Problem: I need to work with a GET Request, so i have so use h:link or h:outputLink (btw, where is the difference?). But doing so, i can’t use the f:setPropertyActionListener component, because a GET request does not fire an action event.

Since there is no action event i have to use a GET request, giving the ID of the object to BeanB as a parameter. BeanB then uses a dao to get the object with the specified ID. But this sux. I don’t want to use the dao. So my specific question:

What is the equivalent to f:setPropertyActionListener for GET request links? How can I set a property of a BackingBean when I click on a h:link or h:outputLink component?

I hope there is a solution, thanks in advance.

  • 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-05-23T15:08:24+00:00Added an answer on May 23, 2026 at 3:08 pm

    Pass it as a request parameter. Request parameters can be only strings, so you need to convert it (or better, the smallest possible part which uniquely identifies the object in question) to string first.

    Here’s an example which uses the (database) identifier of the object for this:

    <ui:repeat value="#{someOtherBean.listOfObjects}" var="objSelected">
        <h:link outcome="ViewB"> 
            <f:param name="id" value="#{objSelected.id}" />
        </h:link>
    </ui:repeat>
    

    And in BeanB add:

    @ManagedProperty("#{param.id}")
    private Long id;
    private SomeObject objSelected;
    
    @PostConstruct
    public void init {
        objSelected = objService.find(id);
    }
    
    // ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

imagine there are two interfaces arranged via composite pattern, one of them has a
Imagine this scenario: in our company there is an employee that play around graphic,css,html
Imagine it like this. There is a field in my database called flags in
If there were such a thing I would imagine the syntax to be something
Is there a secure Python intepreter? Imagine a Python VM you can run on
Imagine you use a plugin and want to change settings on-the-fly, there are 2
I would like to ask you: Imagine that you have a site and there
Let's imagine I have instantiated generic type by Activator.CreateInstance. Is there any way to
Good morning all. Is there any jsf control that escapes the html tags? Imagine
Imagine there's a picturebox which loads a monochrome image. And there is a need

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.