wicketstuff

wicket date range (From-To) validation

蓝咒 提交于 2020-01-13 19:42:29
问题 I have a form where I need to validate DateFrom and DateTo. I have done like this: // start date RequiredTextField<Date> startdateField = new RequiredTextField<Date>("startDate", Date.class); startdateField.add(new DatePicker(){ @Override protected CharSequence getIconUrl() { return RequestCycle.get().getUrlRenderer().renderContextPathRelativeUrl("/image/date-picker.png"); } }); Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE,-1); startdateField.add(DateValidator.minimum(cal

wicket date range (From-To) validation

余生颓废 提交于 2020-01-13 19:42:07
问题 I have a form where I need to validate DateFrom and DateTo. I have done like this: // start date RequiredTextField<Date> startdateField = new RequiredTextField<Date>("startDate", Date.class); startdateField.add(new DatePicker(){ @Override protected CharSequence getIconUrl() { return RequestCycle.get().getUrlRenderer().renderContextPathRelativeUrl("/image/date-picker.png"); } }); Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE,-1); startdateField.add(DateValidator.minimum(cal

wicket download output stream

感情迁移 提交于 2019-12-11 18:52:37
问题 I want to download csv file , i take the response content and write to it , apprently wicket write after me and the content iam getting is the page html where it should be my csv I have seen in the example the usage of throw new AbortException(); I am using version 6.7 , do you know if my version wicket has somthing instead of it ? or rather I am doing somthing wrong .... can you please help me ... add(new Link<Void>("export") { @Override public void onClick() { WebResponse response =

How to redirect to another page while keeping the original url?

风流意气都作罢 提交于 2019-12-07 23:51:01
问题 In my Wicket 1.5 web application, I want to redirect to another bookmarkable page, whilst the URL of the originating page should remain . @MountPath(value="page1") public class WebPage1 extends WebPage { public WebPage1() { ... if (!isDisplayable()) { setResponsePage(WebPage2.class); // throw new RestartResponseException(Error404WebPage.class); // throw new RestartResponseAtInterceptPageException(Error404WebPage.class); } } private boolean isDisplayable() { boolean flag = ... ... return flag;

How to redirect to another page while keeping the original url?

时光怂恿深爱的人放手 提交于 2019-12-06 12:00:27
In my Wicket 1.5 web application, I want to redirect to another bookmarkable page, whilst the URL of the originating page should remain . @MountPath(value="page1") public class WebPage1 extends WebPage { public WebPage1() { ... if (!isDisplayable()) { setResponsePage(WebPage2.class); // throw new RestartResponseException(Error404WebPage.class); // throw new RestartResponseAtInterceptPageException(Error404WebPage.class); } } private boolean isDisplayable() { boolean flag = ... ... return flag; } } @MountPath(value="page2") public class WebPage2 extends WebPage { public WebPage2() { } public