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 2012/08/17 17:00:45 UTC

Dataview: need message nothing found

Hi, when my dataview (with selections) does not return any result, it doesn't
say anything.

How can i return a message that there are no results found. 



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dataview-need-message-nothing-found-tp4651337.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: Dataview: need message nothing found

Posted by Igor Vaynberg <ig...@gmail.com>.
data table has the NoRecordsToolbar

-igor

On Mon, Aug 20, 2012 at 3:01 AM, Delange <de...@telfort.nl> wrote:
> I tried this, but I can't figure out how to convert from datatable to an
> AbstractRepeater.
>
>
>
> DataTable table = new DataTable("datatable", columns, kostenOVProvider, 10){
>                         protected Item newRowItem(String id, int index, IModel model) {
>                 Item item = super.newRowItem(id, index, model);
>                 item.add(new AttributeModifier("class",  new Model(
>                                 index % 2 == 0 ? "even" : "odd")));
>                 return item;
>                         }
>                 };
>                 FilterToolbar filterToolbar = new FilterToolbar(table, form,
> kostenOVProvider);
>                 table.addTopToolbar(new HeadersToolbar(table, kostenOVProvider));
>                 table.addTopToolbar(filterToolbar);
>                 table.addBottomToolbar(new NavigationToolbar(table));
>                 form.add(table);
> form.add(new NoRecordsContainer("norecordsFound", table));
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dataview-need-message-nothing-found-tp4651337p4651369.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


Re: Dataview: need message nothing found

Posted by Delange <de...@telfort.nl>.
I tried this, but I can't figure out how to convert from datatable to an
AbstractRepeater.



DataTable table = new DataTable("datatable", columns, kostenOVProvider, 10){
			protected Item newRowItem(String id, int index, IModel model) { 
                Item item = super.newRowItem(id, index, model); 
                item.add(new AttributeModifier("class",  new Model( 
                                index % 2 == 0 ? "even" : "odd"))); 
                return item; 
			}  
		};
		FilterToolbar filterToolbar = new FilterToolbar(table, form,
kostenOVProvider);
		table.addTopToolbar(new HeadersToolbar(table, kostenOVProvider));
		table.addTopToolbar(filterToolbar);
		table.addBottomToolbar(new NavigationToolbar(table));
		form.add(table);
form.add(new NoRecordsContainer("norecordsFound", table));



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dataview-need-message-nothing-found-tp4651337p4651369.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: Dataview: need message nothing found

Posted by Igor Vaynberg <ig...@gmail.com>.
add a webmarkup container that is only visible when the dataview has no records.

public class NoRecordsContainer extends WebMarkupContainer {
	private final AbstractRepeater repeater;

	public NoRecordsContainer(String id, AbstractRepeater repeater) {
		super(id);
		this.repeater = repeater;
		setOutputMarkupPlaceholderTag(true);
	}

	@Override
	protected void onConfigure() {
		super.onConfigure();
		setVisible(repeater.size() == 0);
	}
}

-igor

On Fri, Aug 17, 2012 at 8:00 AM, Delange <de...@telfort.nl> wrote:
> Hi, when my dataview (with selections) does not return any result, it doesn't
> say anything.
>
> How can i return a message that there are no results found.
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dataview-need-message-nothing-found-tp4651337.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