I'm trying to switch from a DataView component to a GridView component 
as per the GridView example at [1]. Everything worked fine with the 
DataView but with the GridView (after adding a <div wicket:id="cols"> 
element) I get:

"WicketMessage: Couldn't find the markup of the component 'name' in 
parent productList:2"

(possibly off topic, what is the ":2" part in this message?)

It's very late here, I may be making a very stupid mistake but I just 
can't see it. Here's the relevant code snippets:

ProductList.html
================

<div wicket:id="productList">
   <div class="product1">
     <div wicket:id="cols">
       <p class="product_name">
         <span wicket:id="name" class="label">[Name]</span>
       </p>
       <img wicket:id="image" class="product_picture" />
       <p class="product_details">
         <a wicket:id="view" href="ProductView.html">[Details]</a>
       </p>
       <p class="product_price">
         <span wicket:id="price">[Price]</span>
       </p>
       <img src="images/buy_button.gif" class="buy_button" />
     </div>
   </div>
</div>

ProductList.java
================

GridView dataView = new ProductDataView(this, this, "productList",
   new ProductDataProvider());
dataView.setColumns(ITEM_COLUMNS);
dataView.setRows(ITEM_ROWS);

ProductDataView.java (extends GridView.java)
============================================

protected void populateItem(final Item item) {
   Product product = (Product) item.getModelObject();

   ProductDescription desc = ProductDescriptionService.getDescription(
                                product.getId(),
                        
   ProductDescriptionService.LANG_ID_DEFAULT);
   if (desc == null)
     desc = new ProductDescription();
                
   new Label(item, "name", desc.getName());
                
   new Label(item, "price", product.getPrice().toString());
                
   new Image(item, "image", ImageUtil
        .getThumbnailImageResource(product));
                
   ProductView.link(item, "view", product.getId());
        
   item.add(new AttributeModifier("class", true,
     new AbstractReadOnlyModel<String>() {
        @Override
        public String getObject() {
         return (item.getIndex() % 2 == 1) ? "right_products"                   
                                : 
"left_products";
        }
    }));
}

What on earth am I doing wrong?

Ross

[1] 
http://www.wicket-library.com/wicket-examples/repeater?wicket:bookmarkablePage=:wicket.examples.repeater.GridViewPage

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to