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

    a4j and facesmessages

    jhedden

      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"/>
      </a:outputPanel>
      


      and in my class I have:

      @DataModelSelection
      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 );
       }
      
       getOrders();
       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?