Search in sources :

Example 1 with RecommendationItemListPanel

use of io.github.zutherb.appstash.shop.ui.panel.product.RecommendationItemListPanel in project the-app by devops-dojo.

the class HomePage method topSellerPanel.

private Component topSellerPanel() {
    boolean userAuthorized = isUserAuthorized();
    String ressourceKey = userAuthorized ? "your.favorite.products.topic" : "category.top.seller.topic";
    String recommenderType = userAuthorized ? "FAVORITE_PRODUCTS" : "STARTPAGE_TOPSELLER";
    return new RecommendationItemListPanel("topSellerProductsContainer", feedback, recommenderType, new ResourceModel(ressourceKey), new LoadableDetachableModel<List<ProductInfo>>() {

        @Override
        protected List<ProductInfo> load() {
            return recommendationService.getTopsellerRecommendations(4);
        }
    }) {
    };
}
Also used : RecommendationItemListPanel(io.github.zutherb.appstash.shop.ui.panel.product.RecommendationItemListPanel) ResourceModel(org.apache.wicket.model.ResourceModel) List(java.util.List)

Aggregations

RecommendationItemListPanel (io.github.zutherb.appstash.shop.ui.panel.product.RecommendationItemListPanel)1 List (java.util.List)1 ResourceModel (org.apache.wicket.model.ResourceModel)1