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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:32:47+00:00 2026-06-11T04:32:47+00:00

I’ve been strugling with an issue I can’t find the way to solve it

  • 0

I’ve been strugling with an issue I can’t find the way to solve it and I can’t find anything related on the web.

I’m using Netbeans with Primefaces to develop a JSF web app.

Everything works fine except that sometimes the call to the actionlisteners is being done several times.

For example this is my JSF page with primefaces:

<h:body>
   <ui:composition template="home.xhtml">

        <ui:define name="content">
            <h2>Administración de alertas SMS</h2>


                    <p:panel id="display">

                        <p:selectBooleanCheckbox itemLabel="Enviar alertas SMS" value="#{smsConfigBean.alertsEnabled}"/>

                        <p>
                        <h:outputText value="Mensaje de Texto: " /><br /><br />
                        <p:inputTextarea rows="5" cols="50" counterTemplate="{0} caracteres restantes." counter="counter" maxlength="160" value="#{smsConfigBean.smsMessage}" id="smsMessage"/>
                        <br />
                        <h:outputText id="counter" />
                        </p>

                        <p>   
                        <h:outputText value="Dispositivo de envio SMS: " />  
                        <p:selectOneRadio id="options" value="#{smsConfigBean.usePhone}">  
                            <f:selectItem itemLabel="Modem USB"  itemValue="false" />  
                            <f:selectItem itemLabel="Telefono Android" itemValue="true" />                                        
                        </p:selectOneRadio>  
                        </p>
                        <br />
                        <p:tabView id="tabView">  

                            <p:tab id="tab1" title="Modem USB">  
                                <h:panelGrid id="modemGrid" columns="2" cellpadding="4">  
                                    <h:outputText value="Puerto: " />  
                                    <p:inputText id="port" value="#{smsConfigBean.port}"/>  

                                    <h:outputText value="Bit Rate (Opcional): " />  
                                    <p:inputText id="bitRate" value="#{smsConfigBean.bitRate}"/>  

                                    <h:outputText value="Nombre de modem (Opcional): " />  
                                    <p:inputText id="modemName" value="#{smsConfigBean.modemName}"/>

                                    <h:outputText value="PIN: " />  
                                    <p:inputText id="pin" value="#{smsConfigBean.modemPin}"/>

                                    <h:outputText value="Centro de Mensajes: " />  
                                    <p:inputText id="smsc" value="#{smsConfigBean.SMSC}"/>                                  
                                </h:panelGrid>
                            </p:tab>  

                            <p:tab id="tab2" title="Telefono Android">  

                                 <h:panelGrid id="phoneGrid" columns="2" cellpadding="4">  
                                    <h:outputText value="Path ADB:" />  
                                    <p:inputText id="adbPath" value="#{smsConfigBean.adbPath}"/>  

                                    <h:outputText value="Directorio de Configuracion:" />  
                                    <p:inputText id="configPath" value="#{smsConfigBean.configPath}"/>  

                                    <h:outputText value="Modo de conexion " />  
                                    <p:selectOneRadio id="connectOptions" value="#{smsConfigBean.useWifi}">  
                                        <f:selectItem itemLabel="USB" itemValue="false"/>  
                                        <f:selectItem itemLabel="WiFi" itemValue="true" />                                        
                                    </p:selectOneRadio>  

                                    <h:outputText value="Direccion IP (Solo para WiFi): " />  
                                    <p:inputText id="ipDir" value="#{smsConfigBean.ipDir}"/>  

                                </h:panelGrid> 
                            </p:tab>  

                        </p:tabView> 


                    </p:panel>

                    <br />
                    <p:commandButton id="saveSmsAlerts" value="Guardar" update="messages" action="#{smsConfigBean.saveChanges}" actionListener="#{smsConfigBean.saveChanges}"/>



        </ui:define>

    </ui:composition>
</h:body>

And this is my backend bean:

package Beans;

import helpers.Global; import javax.faces.bean.ManagedBean; import
javax.faces.bean.SessionScoped;

@ManagedBean @SessionScoped public class SmsConfigBean {

private Boolean alertsEnabled;
private Boolean usePhone;
private Boolean useWifi;

private String port;
private int bitRate;
private String modemName;
private String modemPin;
private String SMSC;
private String adbPath;
private String configPath;
private String ipDir;

private String smsMessage;

public SmsConfigBean() {
    alertsEnabled = Global.getAlertsEnabled();      
    port = Global.getPort();
    bitRate = Global.getBitRate();
    modemName = Global.getModemName();
    modemPin = Global.getModemPin();
    SMSC = Global.getSMSC();
    usePhone = Global.getUsePhone();
    adbPath = Global.getAdbPath();
    configPath = Global.getConfigPath();
    useWifi = Global.getUseWifi();
    ipDir = Global.getIpDir();     
    smsMessage = Global.getSmsMessage();
}

public Boolean getAlertsEnabled() {
    return alertsEnabled;
}

public void setAlertsEnabled(Boolean alertsEnabled) {
    this.alertsEnabled = alertsEnabled;
}

public String getPort() {
    return port;
}

public void setPort(String port) {
    this.port = port;
}

public int getBitRate() {
    return bitRate;
}

public void setBitRate(int bitRate) {
    this.bitRate = bitRate;
}

public String getModemName() {
    return modemName;
}

public void setModemName(String modemName) {
    this.modemName = modemName;
}

public String getModemPin() {
    return modemPin;
}

public void setModemPin(String modemPin) {
    this.modemPin = modemPin;
}

public String getSMSC() {
    return SMSC;
}

public void setSMSC(String SMSC) {
    this.SMSC = SMSC;
}

public Boolean getUsePhone() {
    return usePhone;
}

public void setUsePhone(Boolean usePhone) {
    this.usePhone = usePhone;
}

public String getAdbPath() {
    return adbPath;
}

public void setAdbPath(String adbPath) {
    this.adbPath = adbPath;
}

public String getConfigPath() {
    return configPath;
}

public void setConfigPath(String configPath) {
    this.configPath = configPath;
}

public Boolean getUseWifi() {
    return useWifi;
}

public void setUseWifi(Boolean useWifi) {
    this.useWifi = useWifi;
}

public String getIpDir() {
    return ipDir;
}

public void setIpDir(String ipDir) {
    this.ipDir = ipDir;
}

public String getSmsMessage() {
    return smsMessage;
}

public void setSmsMessage(String smsMessage) {
    this.smsMessage = smsMessage;
}

public void saveChanges(){
    Global.setSmsMessage(smsMessage);
    Global.setIpDir(ipDir);
    Global.setUseWifi(useWifi);
    Global.setConfigPath(configPath);
    Global.setAdbPath(adbPath);
    Global.setUsePhone(usePhone);
    Global.setSMSC(SMSC);
    Global.setModemPin(modemPin);
    Global.setModemName(modemName);
    Global.setBitRate(bitRate);
    Global.setPort(port);
    Global.setAlertsEnabled(alertsEnabled);
    Global.sendInfoResponseMessage("Cambios guardados con exito");
} 

}

The problem is that when saving the changes of this form by hitting the commandButton ‘saveSmsAlerts’ the call is being made twice. Resulting in the growl message to be shown twice too.
(You won’t see the growl component because it was defined in the template)

This happens also in another page that I did for the same app that uploads a file using fileuploader. The file is uploaded 4 times!!

I’m using chrome to test the application and netbeans to develop it.

  • 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-11T04:32:49+00:00Added an answer on June 11, 2026 at 4:32 am

    You should remove one of action or actionListener attribute.

    <p:commandButton id="saveSmsAlerts" value="Guardar" update="messages" action="#{smsConfigBean.saveChanges}"/>
    

    if you remove action attribute you should change the action method signature

    <p:commandButton id="saveSmsAlerts" value="Guardar" update="messages"  actionListener="#{smsConfigBean.saveChanges}"/>
    

    Like this

    public void saveChanges(ActionEvent e){
    ...
    }
    

    here is the difference between action and actionListener

    Differences between action and actionListener

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

Sidebar

Related Questions

Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a jquery bug and I've been looking for hours now, I can't
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm interested in microtypography issues on the web. I want a tool to fix:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

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.