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

  • Home
  • SEARCH
  • 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 8860393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:15:26+00:00 2026-06-14T15:15:26+00:00

I have the following structure: listView.xhtml <h:dataTable value=#{listBean.myList} …> //for every row I create

  • 0

I have the following structure:

listView.xhtml

<h:dataTable value="#{listBean.myList} ...>
  //for every row I create a commandLink
  <h:commandLink action="editView" value="edit" />
</h:dataTable>

ListBean.java

@ManagedBean
@ViewScoped
public class ListBean{
   public List<Entity> myList; // also getters and setters
}

editView.xhtml

<h:inputText value="#{editBean.selectedEntity.name}" />

EditBean.java

@ManagedBean
@ViewScoped
public class EditBean{
   public Entity selectedEntity; // also getters and setters
}

You know the question: How can I transport the selected Entity from listView to editView? This should be very simple I thought, but after a whole day, I didnt get it work.

I tried different stuff, like @ManagedProperty and <f:param name="" value=""> but I didnt help me.
So please, show me how simple and nice this can be 🙂

Thanks in advance!


UPDATE – Solution#1

Thanks to Daniel,
a possible way that works is, when the entity is hold by an EntityManager, so you can access the entity by its id. So you will pass the id as an request Parameter. Here we go:

listView.xhtml

<h:dataTable value="#{listBean.myList} ...>
  //for every row I create a commandLink, so you can click on that entity to edit it
  <h:commandLink action="editView" value="edit">
     <f:param name="selectedEntityId" value="#{entity.id}" />
  </h:commandLink>
</h:dataTable>

EditBean.java

@ManagedBean
@ViewScoped
public class EditBean{

    private Entity selectedEntity;

    @PostConstruct
    public void init() {
        Map<String, String> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
        long selectedEntityId = Long.parseLong(params.get("selectedEntityId"));

        selectedEntity = SomeEntityManagerUtil.getEntity(selectedEntityId);
    }
}
  • 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-14T15:15:28+00:00Added an answer on June 14, 2026 at 3:15 pm

    The general idea could be :

    To pass an id of that entity and get an entity by that id later on…

    You also could use a converter and inside it translate that id into entity…

    like this :

    <h:inputText value="#{editBean.selectedEntity.name}" converter="myEntityConverter"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my rails view(index.html.erb), i have following structure <div> <%= render :partial => create
I have following structure for check-boxes <input type=checkbox name=reg_field['first_name'] value=1 /> First Name<br />
I have following structure <div onClick=javascript:Myfunction('value');> <div title=Mytitle> </div> </div> Can I access in
I have following structure struct { int myData; int myAnotherData; }Value; struct AnotherStructure {
I must customize .NET ListView control. ListViewItem must have following structure: alt text http://img257.imageshack.us/img257/1575/85834837.jpg
In my app I have following data structure: A ListView that user can add,
I have an sqlite table with the following structure: String CREATE_ACHIEVEMENTS_TABLE = CREATE TABLE
I have following structure with example data: id season_id title 1 1 Intro 2
I have following data structure (simplified): A giant list of the class TestClass public
I have following object structure, deseralized from XML (WS): <ns2:Category> <ns2:CategoryId>800003</ns2:CategoryId> <ns2:CategoryName>Name1</ns2:CategoryName> <ns2:Categories> <ns2:Category>

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.