Skip to content

Usage Show toast

Ryo Tsunoda edited this page Jan 27, 2021 · 3 revisions

Show toast

Ex. If the page has an IziToastBehavior.

IziToastBehavior converts the feedback message to the toast and display it.

Success toast

  • org.apache.wicket.Component#success(Serializable)
  • org.apache.wicket.Session#success(Serializable)

Information toast

  • org.apache.wicket.Component#info(Serializable)
  • org.apache.wicket.Session#info(Serializable)

Warning toast

  • org.apache.wicket.Component#warn(Serializable)
  • org.apache.wicket.Session#warn(Serializable)

Error toast

  • org.apache.wicket.Component#error(Serializable)
  • org.apache.wicket.Session#error(Serializable)
  • org.apache.wicket.Component#fatal(Serializable)
  • org.apache.wicket.Session#fatal(Serializable)

Ex. Create toast instance yourself.

In your page.

@Override
public void renderHead(IHeaderResponse response) {
	super.renderHead(response);
	
	Toast.create(ToastType.WARNING, "message").show(response);
}

Ex. Wicket Ajax Component.

add(new AjaxLink<Void>("btnShowToast") {

	@Override
	public void onClick(AjaxRequestTarget target) {
		Toast.info("message").show(target);
	}
});