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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:48:22+00:00 2026-05-23T07:48:22+00:00

Environment: JSF 2.0 / JPA (provided by EclipseLink) / Glassfish 3.1 / java-EE-5 /

  • 0

Environment: JSF 2.0 / JPA (provided by EclipseLink) / Glassfish 3.1 / java-EE-5 /

  • A small JSF (No Spring, no EJB, no CDI) web application consists mainly on displaying datatables for entities, but the purpose is to display the list of an entity iems for a given Writer:

  • A datatable (<h:datatable/>) displays the list of Writers.

  • A datatable (<h:datatable/>) displays the list of Books written by Writers. (1–*)
  • A datatable (<h:datatable/>) displays the list of Evaluations given to Writers. (1–*)
  • A datatable (<h:datatable/>) displays the list of Topics treated by Writers. (1–*).

This is how I am seeing things:

Since all the datatables have a column with the Writer ID (primary key of Writer).
How can I achieve telling the current user session to hold a parameter (Writer ID), when the user selects a given writer (preferably from the Writer datatable) and use it to display only the records related to that selected writer row.

The same way, when a user is done with the selected writer, he/she can reset the session to hold another writer ID and explore happily with the new selected writer child items.

In other words, using <h:datatables />, and <f:param /> (or something similar), how can I list Book, Evaluation and Topic items for a selected writer persistently.

E.G: Persistently for me means = When the user selects a writer from the datatable, and navigates to /book/List.xhtml page, the book datatable must list only the book items that the selected writer has. And if the user navigates to somewhere else, he can see only what’s related to the same writer.

One idea is to use OpenFaces datatable filters, but it is too cruel for the end user to filter the table each time he/she navigates to a page. He has to do it only once.
(An exciting solution is to add an OpenFaces filter (<o:inputTextFilter />) for each datatable (<o:datatable > in that case) and then all the filters for all tables get automatically the writer ID held as parameter by the user session during the JSF cycle. But is that really feasible 🙁 ?

Sorry for the redundancy. Hope someone could help with hints, ideas, solutions or better alternative.
regards.

  • 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-23T07:48:23+00:00Added an answer on May 23, 2026 at 7:48 am

    Assuming that you’re indeed running Java EE 6 and not Java EE 5, you could just pass the currently selected writer as method argument to the bean in a commandlink/button in a datatable and let the other tables depend on that.

    Given the following Writer entity:

    public class Writer {
    
        private String name;
        private List<Book> books;
        private List<Evaluation> evaluations;
        private List<Topic> topics;
    
        // ...
    }
    

    and the following managed bean:

    @ManagedBean
    @ViewScoped // request or session are also okay.
    public class Bean {
    
        private List<Writer> writers; // +getter
        private Writer writer; // +getter +setter
    
        // ...
    }
    

    then you can setup your datatables as follows (in a single view):

    <h:form>
        <h:dataTable value="#{bean.writers}" var="writer">
            <h:column>#{writer.name}</h:column>
            <h:column>
                <h:commandButton value="View" action="#{bean.setWriter(writer)}">
                    <f:ajax render=":details" />
                </h:commandButton>
            </h:column>
        </h:dataTable>
    </h:form>
    <h:panelGroup id="details">
        <ui:fragment rendered="#{not empty bean.writer}">
            <h:dataTable value="#{bean.writer.books}" var="book">
                <h:column>#{book.name}</h:column>
                ...
            </h:dataTable>
            <h:dataTable value="#{bean.writer.evaluations}" var="evaluation">
                <h:column>#{evaluation.name}</h:column>
                ...
            </h:dataTable>
            <h:dataTable value="#{bean.writer.topics}" var="topic">
                <h:column>#{topic.name}</h:column>
                ...
            </h:dataTable>
        </ui:fragment>
    </h:panelGroup>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Standard Java EE environment: JPA + EJB called from JSF beans. Server: glassfish 3.1.1
We're developing a data heavy modular web application stack with java but have little
I am using JSR 303 Bean validation in my JSF 2.0 web application and
I am developing a Java web application that bases it behavior through large XML
We currently maintain a JSF application developed using Netbeans 5.5.1 using the Visual Web
ENVIRONMENT NetBeans 6.9.1, GlassFish 3.1 + METRO 2.1 I am hosting METRO web services,
I have a web app using JSF2 with JPA Entities, Stateless ejb session beans
Environment I'm working on a C++ application that uses SQL Native Client 9.0 to
I have been investigating a JSF upgrade on our existing web apps that are
Environment: JSF 1.2 RI, RichFaces 3.3.2 We utilize jQuery for is to change CSS

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.