<a4j: commandLink> Not reversing
I am trying to display a recycle bin in my application (Seam / RichFaces) and have included "remove from cart" <a4j:commandLink /> next to each item to remove an item from the cart. When I click the link, it should overload the contents of the cart to show that the item has been deleted. However, when I click the link, nothing happens. The cart is supported by an ArrayList in my action, which contains items. I see a call in my action, so I know that the item has been deleted - and if I refresh the page, I see that it was deleted. Am I doing something wrong in my code below, which leads to the fact that this section of the page is redrawing incorrectly?
UPDATE: It seems that it will play correctly, but not under any circumstances. If I have more than one item in my basket and delete any item, but it plays correctly the last item added. If I have only one item in the recycle bin, or I try to delete the last item added, it will not be able to reload anything. Any thoughts on what's going on here?
<s:div styleClass="cart_bag" rendered="#{identity.loggedIn}"> <h6 class="head"><h:outputText value="Your Shopping Cart" /><a:status forceId="true" id="shoppingCartStatus"> <f:facet name="start"> <h:graphicImage value="/images/ajax-loader.gif" styleClass="right" /> </f:facet> </a:status></h6> <s:div id="shoppingCartItems"> <s:fragment rendered="#{shoppingCart.shoppingCartContents.size() le 0}"> <p><s:span styleClass="bold"> <h:outputText style="color: #FFF;" value="Your shopping cart is empty" /> <br /> <br /> <br /> </s:span></p> </s:fragment> <s:fragment rendered="#{shoppingCart.shoppingCartContents.size() gt 0}"> <h:form> <ul> <ui:repeat value="#{shoppingCart.shoppingCartContents}" var="cartItem"> <li><s:div styleClass="thumb"> <a href="detail.html"><img src="../images/cart_thumb.gif" alt="" /></a> </s:div> <s:div styleClass="desc"> <s:link view="/index.xhtml" styleClass="bold" value="#{cartItem.name}"> <f:param name="ctxid" value="#{cartItem.uniqueIdentifier}" /> </s:link> <p><span class="bold">Unit Price:</span> $629</p> </s:div><a:commandLink id="removeItemFromCartBtn" action="#{shoppingCart.removeFromShoppingCart()}" styleClass="cros" reRender="shoppingCartItems" status="shoppingCartStatus"> <f:param name="ctxid" value="#{cartItem.uniqueIdentifier}" /> <h:graphicImage value="/images/remove.png" /> </a:commandLink></li> </ui:repeat> </ul> </h:form> </s:fragment> </s:div> <s:div styleClass="clear"></s:div> <s:fragment rendered="#{shoppingCart.shoppingCartContents.size() gt 0}"> <p class="total left bold"><h:outputText value="Total: #{shoppingCart.shoppingCartTotal}" /></p> <a href="cart.html" class="crtbtn right"><span>Checkout</span></a> </s:fragment> </s:div>