I got it working:)

I coded a new PropertyEditableColumn, which I use instead of column. There
is used my Panel EditablePanel, it is only wraper for TextField, because
DataTable is trying to put TextField into the  instead of <input> and it
causes an exception. So I wrap TextFiels into the Panel, which can be in 
tag.  

*********PropertyEditableColumn.java***********************************

public class PropertyEditableColumn extends AbstractColumn {

        private String propertyExpression;
        
        private int size = 100;

        public PropertyEditableColumn(IModel displayModel, String
propertyExpression, int size) {
                super(displayModel);
                this.size = size;
                this.propertyExpression = propertyExpression;
        }

        public PropertyEditableColumn(IModel displayModel, String sortProperty,
String propertyExpression, int size) {
                super(displayModel,sortProperty);
                this.size = size;
                this.propertyExpression = propertyExpression;
        }

        public int getSize() {
                return size;
        }

        public void setSize(int size) {
                this.size = size;
        }
        
        
        public void populateItem(Item item, String componentId, IModel 
rowModel) {
                item.add(new EditablePanel(componentId,new 
PropertyModel(rowModel,
propertyExpression) ));
                item.add(new SimpleAttributeModifier("style", "width:" + size + 
"px"));
        }    

}

****************EditablePanel.java**************************************

public class EditablePanel extends Panel {

        public EditablePanel(String id, IModel  model) {
                super(id);
                add(new TextField("textfield",model));
        }
}

*****************EditablePanel.html*******************************

<wicket:panel>
    <input type="text" wicket:id="textfield"/>
</wicket:panel>




Eelco Hillenius wrote:
> 
>> Thanks gumnaam! Without the tree I would be exactly what I need. I gonna
>> try
>> it.
> 
> Try adding columns to your datatable with EditableLabel components.
> 
> Eelco
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Editable-DataTeble-tf4293939.html#a12225811
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to