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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:33:56+00:00 2026-05-31T02:33:56+00:00

In my JSF file I have below at the start. <h:form><h:commandLink value=Create New Staff

  • 0

In my JSF file I have below at the start.

<h:form><h:commandLink value="Create New Staff Account" action="adminCreateStaffMember"/></h:form>.

By use of this, when I create on Create New Staff Account I get re-directed to the page where I have form to create new account.

BUT, When I use the same inside dataTable, NO ACTION is taken. I am still on same page 🙁

<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 value="Create New Staff Account" action="adminCreateStaffMember"/></h:form>
  </h:column>
</h:dataTable>

Actually what I wanted to print is details of respective staff member where I would be using f:setPropertyActionListener. But as above is not working, I won’t go ahead.

Please suggest me where I am going wrong.

Update 1

My newStaffMemberServiceBean is in RequestScoped

@ManagedBean(name = "newStaffMemberServiceBean")
@RequestScoped
public class NewStaffMemberServiceBean {
    // some code
}

Update 2

HTML Generated are as below

Outside of dataTable

<div align="right">
<form id="j_idt35" name="j_idt35" method="post" action="/adminManageStaffMember" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="j_idt35" value="j_idt35" />
<a href="#" onclick="mojarra.jsfcljs(document.getElementById('j_idt35'),{'j_idt35:j_idt36':'j_idt35:j_idt36'},'');return false">Create New Staff Account</a><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="2664682277023387375:-3250423983171933030" autocomplete="off" />
</form>

Inside dataTable

<form id="staffListDataTable:0:j_idt43" name="staffListDataTable:0:j_idt43" method="post" action="/adminManageStaffMember" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="staffListDataTable:0:j_idt43" value="staffListDataTable:0:j_idt43" />
<a href="#" onclick="mojarra.jsfcljs(document.getElementById('staffListDataTable:0:j_idt43'),{'staffListDataTable:0:j_idt43:j_idt45':'staffListDataTable:0:j_idt43:j_idt45'},'');return false">Create New Staff Account</a><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="2664682277023387375:-3250423983171933030" autocomplete="off" />
</form>
  • 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-31T02:33:58+00:00Added an answer on May 31, 2026 at 2:33 am

    I would suggest a few modifications for your original code:

    1. don’t use h:form for each of your commandLink, instead use one form for your dataTable.

    2. the action will get executed only when it finds the component that triggered the aciton. If you use a request scoped list for your datatable then that list won’t be there when the view is restored or may not match the original one which was used to create the view. You may have to change the managed bean from request scope to view scope or higher.

    3. as a suggestion, you can use h:outputLink or h:link instead of the commandLink and provide the f:param to simplify this, in which case you don’t need the form also.

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

Sidebar

Related Questions

I have a JSF file with a rather large form, the form consists of
I have a JSP file with JSF components index.jsp : <body> <h:form prependId=false> <h:panelGrid
In action method (JSF) i have something like below: public String getFile() { byte[]
If you have a JSF <h:commandLink> (which uses the onclick event of an <a>
We have JSF web application that generates XLS file and gives user link to
Properties file location is WEB-INF/classes/auth.properties . I cannot use JSF-specific ways (with ExternalContext) because
I have a jsf component that must access to a javascript file, i added
I have jsf application in which I have to use a facelet custom component
I'm creating login form using JSF 2.0. Below is the detailed description. When I
I have a problem with following tutorial: http://www.mkyong.com/jsf2/jsf-2-internationalization-example/ In faces-context file you have to

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.