1 Reply Latest reply on Apr 5, 2008 2:14 AM by john hedden

    a4j and facesmessages

    john hedden Newbie

      Im a bit perplexed...

      Ive got a list of orders each having a "cancel" button. Once the order is canceled, I then add a message "order canceled + orderNumber". With <s:button> I get the correct response. With <a:commandButton> I only get "order canceled" and no order number.

      <s:button action="#{orderList.cancel}" value="Cancel"/>
      <a:commandButton type="submit" value="Cancel" reRender="orders" action="#{orderList.cancel}"/>

      I also have:

      <a:outputPanel ajaxRendered="true">
       <h:messages styleClass="message" globalOnly="true"/>

      and in my class I have:

      private Order order;
      public void cancel() {
       log.info("Cancel order: #{order.orderNumber}");
       Order cancelled = em.find(Order.class, order.getId());
       if (cancelled!=null) {
       em.remove( cancelled );
       FacesMessages.instance().add("Order cancelled for order number #{order.orderNumber}");

      Ive even set break points in the method and the order.orderNumber isnt getting dropped. Maybe it is getting lost in one of jsf phases?