You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Delange <de...@telfort.nl> on 2013/03/15 21:04:14 UTC
Datatable Filtercolumn is not reacting
I use a datatable with FilterColumn. I specially made a IntegerColumn. It
works fine, but if the user enters a blank or nothing the table is not
refreshed. I can see that the old value is used.
If a enter a zero or another integer value it works like i expected.
How can I repair this problem
My source is
@SuppressWarnings({ "unchecked", "rawtypes", "serial" })
public TextFilteredPropertyColumn getInteger(String header,String
sort,final String field,final int inputsize,final boolean formatOutput,final
String format) {
return new TextFilteredPropertyColumn<String,IModel>(
new Model<String>(header), sort, field) {
@Override public void populateItem(final Item<ICellPopulator<String>>
item, final String componentId,final IModel<String> rowModel)
{
Label label = new Label(componentId, createLabelModel(rowModel)){
public <C> IConverter<C> getConverter(Class<C> type){
IConverter converter = new
MyIntegerConverter(formatOutput,format);
return converter;
}
};
item.add(label);
}
@Override
public String getCssClass() {
return "numeric "+field;
};
@Override
public Component getFilter(final String varComponentId, final
FilterForm varForm) {
TextFilter<Integer> filter = (TextFilter<Integer>)
super.getFilter(varComponentId, varForm);
filter.getFilter().add(new AttributeModifier("size", new
Model<String>(""+inputsize)));
filter.getFilter().add(new AttributeModifier("style", new
Model<String>("text-align:right;")));
filter.getFilter().add(new AttributeModifier("class", new
Model<String>("numeric")));
return filter;
}
};
}
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Datatable-Filtercolumn-is-not-reacting-tp4657285.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Datatable Filtercolumn is not reacting
Posted by Sven Meier <sv...@meiers.net>.
What does your FilterForm's model object look like?
Sven
On 03/15/2013 09:04 PM, Delange wrote:
> I use a datatable with FilterColumn. I specially made a IntegerColumn. It
> works fine, but if the user enters a blank or nothing the table is not
> refreshed. I can see that the old value is used.
> If a enter a zero or another integer value it works like i expected.
> How can I repair this problem
>
> My source is
> @SuppressWarnings({ "unchecked", "rawtypes", "serial" })
> public TextFilteredPropertyColumn getInteger(String header,String
> sort,final String field,final int inputsize,final boolean formatOutput,final
> String format) {
> return new TextFilteredPropertyColumn<String,IModel>(
> new Model<String>(header), sort, field) {
>
> @Override public void populateItem(final Item<ICellPopulator<String>>
> item, final String componentId,final IModel<String> rowModel)
> {
> Label label = new Label(componentId, createLabelModel(rowModel)){
> public <C> IConverter<C> getConverter(Class<C> type){
> IConverter converter = new
> MyIntegerConverter(formatOutput,format);
> return converter;
> }
> };
> item.add(label);
> }
>
> @Override
> public String getCssClass() {
> return "numeric "+field;
> };
> @Override
> public Component getFilter(final String varComponentId, final
> FilterForm varForm) {
>
> TextFilter<Integer> filter = (TextFilter<Integer>)
> super.getFilter(varComponentId, varForm);
> filter.getFilter().add(new AttributeModifier("size", new
> Model<String>(""+inputsize)));
> filter.getFilter().add(new AttributeModifier("style", new
> Model<String>("text-align:right;")));
> filter.getFilter().add(new AttributeModifier("class", new
> Model<String>("numeric")));
>
> return filter;
> }
> };
> }
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Datatable-Filtercolumn-is-not-reacting-tp4657285.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org