wicketstuff - Customised Error Message for default DateValidator in Wicket -


I am using DateValidator class to validate the date entered by the user. I'm getting a general error message for this, but I can customize the error message without creating a separate validator class.

"itemprop =" text ">

Yes, for example if you have the following type of page.

MyPage.html & lt; Wicket: Pages & gt; & Lt; Form wicket: id = "form" & gt; & Lt; Input type = "text" wicket: id = "start date" /> & Lt; Input type = "text" wk: id = "end date" /> & Lt; / Form & gt; & Lt; / Wicket: p. & Gt;

Then you add your Java class properties MyPage.properties which next to the file name to add the following entries.

MyPage.properties

  form.startDate.DateValidator.minimum = & lt; Messages for the minimum STARTDATE & gt; Form.startDate.DateValidator.maximum = & lt; Messages for maximum start-up & gt; Form.endDate.DateValidator.minimum = & lt; At least message for enddate & gt; Form.endDate.DateValidator.maximum = & lt; Message for maximum enddates & gt;  to be replaced  

You can use variables like you $ {input} or $ {label} response messages for.

A good place to start is in the wiki of Apache wicket

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -