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

The Archive Base Latest Questions

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

I am Using JSF 2 and EJB 3.1 to create a form. I am

  • 0

I am Using JSF 2 and EJB 3.1 to create a form.

I am using this part of the page to get me some data, so I can pass it to my bean using the confirmDialog just below

<p:column headerText="#{bundle.edit}" style="width:10px; overflow:visible;">  
    <p:rowEditor/>                            
</p:column>
<p:column headerText="#{bundle.delete}" style="width:10px; overflow:visible;">
    <p:commandButton update=":form" oncomplete="confirmation.show()" 
                     image="ui-icon ui-icon-close" title="Delete">  
        <f:param value="#{user}" name="userAction" />
    </p:commandButton>  
</p:column>
</p:dataTable>

<p:confirmDialog message="Are you sure? user:#{param['userAction']} " width="500"  
                    header="Confirm" severity="alert" widgetVar="confirmation">  
    <p:commandButton value="Yes sure" update=":form" 
              actionListener="#{userController.deleteAction(param['userAction'])}"
              oncomplete="confirmation.hide()" />  
    <p:commandButton value="Not yet" onclick="confirmation.hide()" type="button" />  

</p:confirmDialog>

</h:form>

And this is the Bean that should get it

@Named(value = "userController")
@Stateful
@RequestScoped
@TransactionManagement(TransactionManagementType.CONTAINER)
public class UserController implements Serializable {

    private User current;

    @Inject
    private br.com.cflex.itm.dataaccess.UserFacade userFacade;

    public UserController() {
    }

    public void deleteAction(User user) {
        userFacade.remove(user);
    }

But My bean is only receiving null as User, and in the Dialog I am printing the data so I can see there is a User Object selected there.

What is wrong in passing params like that ?
Why am I getting null in my Bean? Because they are getting lost in the communication between client and server-side…

  • 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-26T07:44:24+00:00Added an answer on May 26, 2026 at 7:44 am
    <p:commandButton action="#{userController.deleteAction(param['userAction'])}" />
    

    The EL of action (and actionListener) is evaluated when the form is been submitted, not when the form is been displayed. Request parameters are request scoped and are not there in the subsequent request of the form submit. You need to pass it along:

    <p:commandButton action="#{userController.deleteAction(param['userAction'])}">  
        <f:param name="userAction" value="#{param['userAction']}" />
    </p:commandButton>
    

    The EL of <f:param> is evaluated when the form is been displayed. So it will be there in the generated HTML and JavaScript will take care that it is passed along.

    Note that request parameters are of String type. Expecting them to be User won’t work at all. Basically, it contains the value of User#toString(). You’d need to take String as action argument and convert it to User yourself. Or better, use <f:viewParam> wherein you can explicitly specify a converter.

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

Sidebar

Related Questions

I want to dynamically create controls in my bean. I am using JSF 2.0
I have a problem using JSF to display some data in Facelets. I have
I'm using EJB and JSF. I made a jsp simple page with a button
I'm using JSF/Facelets, and I'm trying to iterate over some Document objects (custom object)
I'm using jsf 1.2. When a particular jsp has more than one form with
I'm using JSF (Mojarra 1.2) with Richfaces (3.3.2) within some facelets which are used
How do I connect to the database(MYSQL) in connection bean using JSF to retrieve
I am using a JEE6 stack including JPA 2.0, JSF 2.0, EJB 3.1 etc.
I am using JSF 2.1, EJB 3.1, JPA 2.0, Glassfish 3.1.1 and NetBeans 7.0.1.
I'm using JSF 2.0 with GlassFish 3.0. I have the following Managed Bean: @ManagedBean

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.