Search in sources :

Example 1 with AddToCartEvent

use of io.github.zutherb.appstash.shop.ui.event.cart.AddToCartEvent in project the-app by devops-dojo.

the class ProductDetailPage method addToCartLink.

private AbstractLink addToCartLink() {
    return new IndicatingAjaxLink<Void>("addToCart") {

        @Override
        public void onClick(AjaxRequestTarget target) {
            target.add(feedback);
            send(getPage(), Broadcast.BREADTH, new AddToCartEvent(target, getPage(), productInfoModel.getObject(), getTags()));
        }
    };
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AddToCartEvent(io.github.zutherb.appstash.shop.ui.event.cart.AddToCartEvent) IndicatingAjaxLink(org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink)

Example 2 with AddToCartEvent

use of io.github.zutherb.appstash.shop.ui.event.cart.AddToCartEvent in project the-app by devops-dojo.

the class ProductItemPanel method addToCartLink.

private IndicatingAjaxLink<Void> addToCartLink() {
    IndicatingAjaxLink<Void> result = new IndicatingAjaxLink<Void>("addToCartIcon") {

        @Override
        public void onClick(AjaxRequestTarget target) {
            // send wicket event for add to cart
            target.add(feedback);
            send(getPage(), Broadcast.BREADTH, new AddToCartEvent(target, getPage(), productInfoModel.getObject(), getTags()));
        }
    };
    result.setVisible(showAddToCartLink());
    return result;
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AddToCartEvent(io.github.zutherb.appstash.shop.ui.event.cart.AddToCartEvent) IndicatingAjaxLink(org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink)

Aggregations

AddToCartEvent (io.github.zutherb.appstash.shop.ui.event.cart.AddToCartEvent)2 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)2 IndicatingAjaxLink (org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink)2