Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Wicket DatePicker

 
Preity Raj
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am trying to use wicket extensions datepicker but i am getting following problem-

The date picker shows a different behaviour when deploying the application on Liferay.
After initial loading of the page, it is not possible to open the date pickers, but after issuing a page refresh, it is possible to open the date pickers.

Please help me if you have any solution about this problem or if anyone knows how to use locale from wicket in javascript datepicker.

 
rajeev yadav
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please post sample code that you are trying with the issue details
 
Preity Raj
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have just added wicket extension datepicker component to textfield.
 
rajeev yadav
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which wicket version are you using. I checked on 1.3 and 1.4.15 and it works fine for me.
 
Preity Raj
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi.. I am using wicket 1.4.9
 
rajeev yadav
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would be great if you can upload source code so that I can see what is causing the issue. Also try using 1.4.15 as this is stable version in 1.4
 
rajeev yadav
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Priety,
try this:

HTML:
<input wicket:id="date" type="text" maxlength="10" /><span
wicket:id="datePicker" />

Java:
DateTextField dateField = new DateTextField("date", "d-M-yyyy");
dateField.setRequired(true);
add(dateField);

DatePicker dp = new DatePicker("datePicker", dateField);
dp.setDateConverter(new DateConverter() {
public DateFormat getDateFormat(Locale locale) {
return new SimpleDateFormat("d-M-yyyy");
}
});
add(dp);
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic