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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:37:47+00:00 2026-06-17T21:37:47+00:00

I have a problem and I am pretty new for primefaces and JSF altogether,

  • 0

I have a problem and I am pretty new for primefaces and JSF altogether, probably it is my lack of knowledge, but I couldn’t find an answer yet, I have XHTML-s, on the main one I have several buttons, and I wrote one feedback dialog which tells that the operation successful, and the name of operation.

The dialog appears, looks fine, but the message is always what I specified on the last button.
Perhaps I misunderstood something with the concept, can anybody help me what am I doing wrong?

here are the code:

Bean

@ManagedBean
@ViewScoped
public class ActionSuccessController extends AbstractAction implements
    Serializable {

public String setParam(String actionName) {
    ResourceBundle messageBundle = ResourceBundle
            .getBundle("hu.avhga.web.partner.messages");
    description = messageBundle.getString("actionSuccess");
    this.actionName = actionName;
    return "";
}
...

Main XHTML where I have the buttons

...
                            <p:commandButton id="lock"
                            value="#{msg['PartnerAdmin.button.lock']}" 
                            action="#{partnerAccountAdminAction.lock}" 
                            update=":partnerAccountAdminForm :actionSuccessForm"
                            disabled="#{partnerAccountAdminAction.disabledButtonMap.get('LOCK')}"
                            rendered="#{partnerAccountAdminAction.passwordAdmin}"
                            styleClass="gold"
                            onclick="#{actionSuccessController.setParam(msg['PartnerAdmin.button.lock'])}"
                            oncomplete="usersTableWidget.filter();actionSuccessDialogVar.show();"/>

                        <p:commandButton id="unlock"
                            value="#{msg['PartnerAdmin.button.unlock']}" 
                            action="#{partnerAccountAdminAction.unlock}"
                            update=":partnerAccountAdminForm :actionSuccessForm"
                            disabled="#{partnerAccountAdminAction.disabledButtonMap.get('UNLOCK')}"
                            rendered="#{partnerAccountAdminAction.passwordAdmin}"
                            styleClass="gold"
                            onclick="#{actionSuccessController.setParam(msg['PartnerAdmin.button.unlock'])}"
                            oncomplete="usersTableWidget.filter();actionSuccessDialogVar.show();"/>

                        <p:commandButton id="suspend"
                            value="#{msg['PartnerAdmin.button.suspend']}" 
                            action="#{partnerAccountAdminAction.suspend}"
                            update=":partnerAccountAdminForm :actionSuccessForm"
                            disabled="#{partnerAccountAdminAction.disabledButtonMap.get('SUSPEND')}"
                            rendered="#{partnerAccountAdminAction.userAdmin}"
                            styleClass="gold"
                            onclick="#{actionSuccessController.setParam(msg['PartnerAdmin.button.suspend'])}"
                            oncomplete="usersTableWidget.filter();actionSuccessDialogVar.show();"/>

                        <p:commandButton id="remove"
                            value="#{msg['PartnerAdmin.button.remove']}" 
                            action="#{partnerAccountAdminAction.remove}"
                            update=":partnerAccountAdminForm :actionSuccessForm"
                            disabled="#{partnerAccountAdminAction.disabledButtonMap.get('REMOVE')}"
                            rendered="#{partnerAccountAdminAction.userAdmin}"
                            styleClass="gold"
                            onclick="#{actionSuccessController.setParam(msg['PartnerAdmin.button.remove'])}"
                            oncomplete="usersTableWidget.filter();actionSuccessDialogVar.show();"/>
...

After this I have the import of the following XHTML:

<p:dialog id="actionSuccessDialogId" header="#{actionSuccessController.actionName}"
        styleClass="dialog" closable="false"
        widgetVar="actionSuccessDialogVar" modal="true" appendToBody="true" dynamic="true"
        resizable="false" showEffect="fade" hideEffect="explode">
    <h:form id="actionSuccessForm" style="text-align:center;">
        <h:outputText value="#{actionSuccessController.description}" />
        <br />
        <br />
        <p:commandButton id="okButtonId" value="#{msg['Common.ok']}"
                        onclick="actionSuccessDialogVar.hide()" 
                        type="button" />
    </h:form>
</p:dialog>

I am sure that these “setParam”s run always and for me it seems without reason.
So again the question why I always get the name of “remove” property. Is it because of ajax? Or because these all run when I click somewhere? I am a bit confused. Thanks in advance!

  • 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-17T21:37:48+00:00Added an answer on June 17, 2026 at 9:37 pm

    In a nutshell, onclick can’t call a setter like that. What you seem to want is to pass a parameter to your bean action, right? In that case, you want to use the f:setPropertyActionListener tag. So your button would look like this:

    <p:commandButton id="unlock"
                        value="#{msg['PartnerAdmin.button.unlock']}" 
                        action="#{partnerAccountAdminAction.unlock}"
                        update=":partnerAccountAdminForm :actionSuccessForm"
                        disabled="#{partnerAccountAdminAction.disabledButtonMap.get('UNLOCK')}"
                        rendered="#{partnerAccountAdminAction.passwordAdmin}"
                        styleClass="gold"
                        oncomplete="usersTableWidget.filter();actionSuccessDialogVar.show();">
          <f:setPropertyActionListener target="#{actionSuccessController.param}" value="#{msg['PartnerAdmin.button.lock']}" />
    </p:commandButton>
    

    The f:setPropertyActionListener invokes the setter specified in the target with the value specified in the value attribute.

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

Sidebar

Related Questions

I'm pretty new to C, but I have come across a problem with fread...
I have a problem in wpf xaml and i'm pretty new on this so
I'm pretty new to databases and sql. I have a problem where I have
i have a problem with csv file reading. I'm pretty new to mfc and
Good evening! I'm pretty new to Linux and Apache and I have a problem
I'm pretty new to Java (C# programmer) and I have here a problem that
I am pretty new to XNA 4.0 and have a problem I can't seem
I'm pretty new to Phonegap. I have a problem where the default css used
So basically I am still pretty new to Python and I have a problem
I'm pretty new to Java and I have a problem in my code, where

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.