13 Replies Latest reply on Mar 26, 2009 6:18 PM by Matias Santana

    Button action fires on each page refresh

    Matias  Santana Newbie

      Hi! I have a problem, when i try to fire the action of a button. The action fires each time i refresh the page.
      Anyone who has a tip?
      Thanx in advice!

      The CarritoBean:

      public @Stateful class CarritoBean implements Carrito {
      private Double importeTotal=0.0;
          private List<Producto> productosAComprar;
          public Double getImporteTotal() {
                return importeTotal;
           public void setImporteTotal(Double importeTotal) {
                this.importeTotal = importeTotal;
          @Remove @Destroy
          public void destroy() {}
          public void addProductoAComprar(){
               try {
                    Long productoId = new Long(FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("producto"));
                         productosAComprar = new LinkedList<Producto>();
                    InitialContext ic = new InitialContext();
                    ProductosService productosService = (ProductosService)ic.lookup("SGAF-ear/ProductosServiceBean/remote");
                    Producto producto = productosService.getProductoById(productoId);
                } catch (Exception e) {
          public void removeProductoAComprar(){
               importeTotal=importeTotal - producto.getImporte();*/

      The code in the xhtml:

      <rich:column styleClass="action">
           <f:facet name="header">Acciones</f:facet>
             <s:button value="Comprar"
                <f:param name="producto" value="#{producto.productoId}"/>