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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:46:30+00:00 2026-05-31T04:46:30+00:00

Below are the files I have. manageStaff.xhtml <h:dataTable var=c value=#{newStaffMemberServiceBean.newStaffMemberDataBeanList} styleClass=order-table headerClass=order-table-header rowClasses=order-table-odd-row,order-table-even-row border=1

  • 0

Below are the files I have.

manageStaff.xhtml

<h:dataTable var="c" value="#{newStaffMemberServiceBean.newStaffMemberDataBeanList}"
             styleClass="order-table"
             headerClass="order-table-header"
             rowClasses="order-table-odd-row,order-table-even-row"
             border="1" id="staffListDataTable" width="100%">

    <h:column>
        <f:facet name="header">
            Staff Member Name
    </f:facet>
        <h:form>
            <h:commandLink action="viewStaffMemberProfileData" value="#{c.firstName}">
                <f:setPropertyActionListener target="#{newStaffMemberServiceBean.userId}" value="XXXYYYZZZZ"/>
            </h:commandLink>
        </h:form>
    </h:column>
</h:dataTable>

viewStaffMemberProfileData.xhtml

 My Name is -<h:outputText value="#{newStaffMemberServiceBean.userId}" />-

NewStaffMemberServiceBean.java

@ManagedBean(name = "newStaffMemberServiceBean")
//@RequestScoped
@ViewScoped
//@SessionScoped
public class NewStaffMemberServiceBean {

    private String userId;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

In output what I get is in below format

Staff Member Name
++++++++++++++++++

Name 1
Name 2
Name 3
.
.
.
.

On Clicking Name 1, I get re-directed to viewStaffMemberProfileData.xhtml.

BUT problems are

  1. To get re-directed on viewStaffMemberProfileData.xhtml page, I have to click link (Name 1, Name 2, etc) twice 🙁

  2. When I get re-directed to viewStaffMemberProfileData.xhtml I only see output as

    My Name is --

    What I want is My Name is -XXXYYYZZZZ-.

Suggest me where I am going wrong.

NOTE

I have all beans in ViewScope.

Update 1

@prajeeshkumar

Getter setter are as below

    public List<NewStaffMemberDataBean> getNewStaffMemberDataBeanList() {
    return newStaffMemberDataBeanList;
    }

    public void setNewStaffMemberDataBeanList(List<NewStaffMemberDataBean> newStaffMemberDataBeanList) {
    this.newStaffMemberDataBeanList = newStaffMemberDataBeanList;
    }
  • 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-31T04:46:31+00:00Added an answer on May 31, 2026 at 4:46 am

    The reason for this behavior is the view scope of the newStaffMemberServiceBean , its being destroyed and created again… so the value is being nullified… here an alternative solution:

    haven’t tried this one, But worth trying

    change

    <h:commandLink action="viewStaffMemberProfileData" value="#{c.firstName}">
         <f:setPropertyActionListener target="#{newStaffMemberServiceBean.userId}" value="XXXYYYZZZZ"/>
    </h:commandLink>
    

    into

    <h:link value="#{c.firstName}" outcome="nameOfXhtmlGoesHere">
         <f:param name="id" value="XXXYYYZZZZ" />
    </h:link>
    

    and in viewStaffMemberProfileData.xhtml

    add this before the <h:head>

    <f:metadata>
        <f:viewParam name="id" value="#{newStaffMemberServiceBean.userId}" />
    </f:metadata>
    

    you can also add <f:event type="preRenderView" listener="#{newStaffMemberServiceBean.init}" /> to the f:metadata in order to do some init…

    based on this BalusC great article – Communication in JSF 2.0

    OR

    you can turn the scope of newStaffMemberServiceBean into SessionScope…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have removed all header files within the below path due to numerous errors
I have 2 files in the directory bar for testing. from the code below,
I have the below program that will move files from one directory to other.
I have a large number of csv files that look like this below: xxxxxxxx
I have 2 css files in my page: Site.css jquery-ui.css Site.css is listed BELOW
I have two XML files. The structure of both XML files is as below:
I have two text files. hash_only.txt and final_output.txt hash_only.txt looks like below. 193548 401125
I have a script snippet looks like below: <ItemGroup> <files Include=*.txt></files> </ItemGroup> <Message Text=@(files)>
i have a char matrix like below char files[4][10]; And in the matrix these
As you can see on the image below my aspx files does not have

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.