Hi Stephanus,
I think in your scenario what you need to do is add a button in your item
detail screen passing the item id to an action method in your ItemAction
class that will call CartManager's API to add the selected item.
Sure you may need to declare your new action in struts.xml something like
the example below:
<action name="addItemToCart" class="itemAction"
method="addItemToCart">
<result name="input">/WEB-INF/pages/itemForm.jsp</result>
<result name="success"
type="redirect-action">/WEB-INF/pages/cartList.jsp</result>
</action>
(note: I worked with Struts long time ago and I quickly looked up on
AppFuse's struts code for reference to answer this post, so I apologize if
something is not 100% accurate)
happy coding,
Pedro Burglin
Stephanus Astorizkhy wrote:
>
> Hi all,
> I am using appfuse to build a simple shopping cart application. I am using
> Struts2 + Hibernate + Spring + MySQL in my application.
> Let's say, I have created 2 classes, "item" and "cart".
> In appfuse,
> when i created with AppGen, the 2 classes (item and cart) have a detail page of themselves.
> But I want to add some button in item list and i
> name it "Add To Cart". Every time I click "Add to Cart" button in "item"
> list, I want to add that item to my
> cart, but somehow i can't do that. What should I need to know and then what should I do?
>
>
> Thanks,
> Regards,
>
> Stephanus Astorizkhy
>
>
>
> __________________________________________________________
> Sent from Yahoo! Mail.
> A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html
>
--
View this message in context:
http://www.nabble.com/How-to-make-a-simple-shopping-cart-tp18069261s2369p18071596.html
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]