1 Reply Latest reply on Jul 8, 2009 4:32 AM by msantana

    Error on showing error messages

    msantana

      Hi guys!
      I've stucked on this like a week ago and i hope someone has a clue.


      Here´s the situation.


      I have a modal panel with an ajax commmandButton, and when i press it, the method on the backing bean makes some validations.
      If there´s exists not valid data i throw an exception, and add to FacesMessage a message.


      I tried with all components like h message or rich message, but without succed.


      Here you have the code.



      This is the button on the page


      <a:commandButton value="Aceptar" rendered="#{movimientoHome.operacionSeleccionada != 'Transferir'}"
                propagation="default" title="Aceptar"
                     id="btnStockModif" 
                    action="#{stockHome.agregarProductoAfectado()}" reRender="stockSelecList">
      </a:commandButton>



      Here is where i add the message to FacesMessage:




      catch (NoResultException e) {
              e.printStackTrace();
           FacesMessages.instance().add("No existe un factor para las unidades de medida seleccionadas");
           return false;
      }
      




      I have deleted from the coded all the message components, hoping someone has an idea where to put it.




      Thanx in advice guys!!! I really need this help.!


        • 1. Re: Error on showing error messages
          msantana

          The main problem here is that the button is on a modalPanel so, the button hides it.
          So i have to close the modal panel only if the method return the string success, if not, the modal has to keep open, showing the error message.


          This comment is only to clarify a little bit more.
          Thanx again!