Gabriel Jeremiah Campbell has a Bachelor of Science Honours Degree in Applied Mathematics and Computer Science from the National University of Science and Technology (NUST). I am a Sun Certified Java Programmer(SCJP) and Sun Certified Web Component Developer(SCWCD). I have worked as Junior Lecturer in Computer Science for 3 years. I have been actively developing software in Java for 4 years. I have also coded in C/C++. When not at a computer (or thinking about a computer) I enjoy sci-fi movies, cycling, nature walks and photography. Gabriel Jeremiah is a DZone MVB and is not an employee of DZone and has posted 9 posts at DZone. You can read more from them at their website. View Full User Profile

Picking Dates in Struts 2 and JQGrid

12.14.2010
| 5857 views |
  • submit to reddit

I have spent sometime analysing the power of Struts 2 and JQGrid. In a time when so many frameworks are out there, so many projects, some of which perform code generation, the question is can Struts 2 still have a place in the new world, the new era that has seen the rise of web technologies with mouth watering graphics and tantalizing visual effects?

I am happy to say that yes it can. Within the JQGrid Struts 2 is a framework that has the capability to make it through and past 2010 into the second decade of this new century that has dawned upon us.

Today I write about dates and date picking in the Struts 2 JQGrid plugin. The reason being there seems to be, to my knowledge, no clear explanation on this. In my next post I will give a full tutorial on the use of JQGrid and more comprehensive coverage on this wonderful plugin.

We want to be able to have a date picker in the Add Record screen. In the picture below confirmBy is a date field and when we click on it:

Also when we edit a record, on the Edit Record screen, we click on the date field we have:

The settings for this are as follows. First in the sjg:GridColumn we have:

Where the datePick function will be:

There we are. We have added date picking functionality in the Add Record screen and the Edit Record screen.

From http://gabrieljeremiahcampbell.wordpress.com/2010/12/12/picking-dates-in-struts-2-and-jqgrid/

Published at DZone with permission of Gabriel Jeremiah Campbell, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Tags: