Here are the two classes. What I was thinking was i would overide 
createLabelModel and create table with the tag like below.
    

import java.math.BigDecimal;

import 
org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.markup.html.basic.Label
;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.link.PopupSettings;
import org.apache.wicket.markup.html.panel.Panel; 
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;

public class TablePropertyColumn extends PropertyColumn {


    
    public TablePropertyColumn(IModel displayModel,
            final String sortProperty, final String propertyExpression) {
        super(displayModel, sortProperty, propertyExpression);
        // TODO Auto-generated constructor stub
    }
    


    protected IModel createLabelModel(final IModel rowModel) {
        final IModel prop = super.createLabelModel(rowModel);
        return new AbstractReadOnlyModel() {
            public Object getObject() {
                String data = (String) prop.getObject();
            // will get it from the object and create table
                    dataString = "<wicket:panel> 
<table><tbody><tr><td>fads</td></tr><tr><td>fdsafas</td></tr></tbody></table><table>
 </table></wicket:panel>";
               
                return dataString;
            
            }
        };
    }

}



import java.util.ArrayList;
import java.util.List;

import org.apache.wicket.markup.html.panel.Panel;
import 
org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn; 
import 
org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn; 
import org.apache.wicket.model.Model;

import com.swishmark.tugboat.util.ReportTemplateListProvider;
import com.swishmark.tugboat.util.TablePropertyColumn;

// http://cwiki.apache.org/WICKET/simple-sortable-datatable-example.html
// AJAX: 
http://www.wicket-library.com/wicket-examples/repeater/?wicket:bookmarkablePage=:org.apache.wicket.examples.repeater.AjaxDataTablePage

public class RelatedProductListPanel extends Panel {

    public RelatedProductListPanel(String id, int transNodeId) {
        super(id);

        List<IColumn<?>> columns = new ArrayList<IColumn<?>>();
        columns.add(new PropertyColumn(new Model("product_id"), "product_id", 
"product_id"));
        columns.add(new PropertyColumn(new Model("Name"), "name", "name"));
        columns.add(new PropertyColumn(new Model("Status"), "status", 
"status"));
        columns.add(new PropertyColumn(new Model("vertical"), "vertical", 
"vertical"));
        columns.add(new TablePropertyColumn(new Model("transname"), 
"transname", "transname"));
        add(new AjaxFallbackDefaultDataTable("relatedProductListTable", 
columns, new RelatedProductListProvider(transNodeId), 8));
    }
}
-------------------------
Even though I use a panel and write my own and populate my panel i
think  it will put everything inside <wicket:cell> . I'm looking
for a way so that it doesn't write the tag.

public void populateItem(Item item, String componentId, IModel model) {

        item.add(new TablePanel(item, componentId, model));



<wicket:panel>

<table>

 <tr wicket:id="tablerow">                    

   <td wicket:id="tabletd"></td>

 </tr>

 </table>

</wicket:panel>


> From: igor.vaynb...@gmail.com
> Date: Wed, 4 Nov 2009 17:37:59 -0800
> Subject: Re: table inside a td in wicket table
> To: users@wicket.apache.org
> 
> show us some code.
> 
> -igor
> 
> On Wed, Nov 4, 2009 at 5:06 PM, Swarnim Ranjitkar <swarn...@hotmail.com> 
> wrote:
> >
> >  I'm trying put a table inside a <td> in datatable so that my column can 
> > have more than one row I overode  the createLableModel method and tried to 
> > but html tag like this
> > <wicket:panel> 
> > <table><tbody><tr><td>fads</td></tr><tr><td>fdsafas</td></tr></tbody></table><table>
> >  </table></wicket:panel>
> > look like it everything in a cell is put under
> > <td wicket:id="cells">  <span wicket:id="cell">
> >
> > because it of  <span wicket:id="cell"> it gets displayed as text. Is there 
> > anyway you could overide this or any better way of doing this
> > thank you
> >
> >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
                                          

Reply via email to