Since today the latest Version 3.2.0 of Struts2 jQuery Plugin is available. The main change is the switch from jQuery 1.5.2 to the latest version 1.6.4 of the jQuery 1.6.x releases. You can now benefit from all the improvements and performance optimizations from the jQuery 1.6.x versions.
If you are using third party jQuery plugins, be sure the are working well with this jQuery version.
Except the library updates there are over 20 solved Issues with this release. Especially the Datepicker, the Dialog and the Tree Tag are improved.
The new Version 3.1.0 of Struts2 jQuery Plugin is now available with an improved Tree and Autocompleter Tag and a new Timepicker Addon for the Datepicker Tag.
A improved Tree Tag
The Tree Tag provides now support for different Node Types and support for Context Menus. Two new Tree Tag examples in the Showcase explain how to use this new Features.
An other offen requested feature the Timepicker is now available. This is an enhancment of the existing Datepicker Tag.
<sj:datepickerid="time0"label="Select a Date/Time"value="%{new java.util.Date()}"timepicker="true"/><sj:datepickerid="time1"label="Select a Time"value="%{new java.util.Date()}"timepicker="true"timepickerOnly="true"/>
A improved Autocompleter Tag
It is now possible to display the List Value instead of the List Key. See Issue 395 for detailed informations. Also you can now specify a List Label which is displayed during the search.
3.) Create a new Action YourNameAction.java inside of the com.jgeppert.examples.actions Package
packagecom.jgeppert.examples.actions;importcom.opensymphony.xwork2.ActionSupport;publicclass YourNameAction extends ActionSupport {privateString name;publicString execute()throwsException{if(name ==null|| name.length()<3){
addActionError("Please enter valid name with more the 2 characters!");return ERROR;}return SUCCESS;}publicString getName(){return name;}publicvoid setName(String name){this.name= name;}}
4.) Replace the Content of hello.jsp
<%@ page contentType="text/html; charset=UTF-8" %><%@ taglib prefix="s"uri="/struts-tags" %><%@ taglib prefix="sj"uri="/struts-jquery-tags"%><html><head><title>My App</title><sj:headjquerytheme="start"/><style>
body {
font-family: Arial,sans-serif;
font-size: 9pt;
}
</style></head><body><h2>Please enter a Name</h2><s:formaction="your-name"theme="xhtml"><s:textfieldname="name"label="Enter your Name"/><sj:submittargets="result"effect="highlight"value="Submit"button="true"/></s:form><h3>AJAX Result</h3><divid="result"></div></body></html>
5.) Create a new JSP inside of your WEB-INF/content folder called your-name.jsp
I'am happy to inform you that Version 3.0.0 of Struts2 jQuery Plugin is now available with a lot of new features an improvments.
A new Tree Tag
With this version there is an offen requested feature available. The new Tree Tag allows you to create easy Trees in your templates. This Tree Tag is based on the great jQuery jsTree Plugin.
For an better support of mobile development with Java and the popular MVC Framework Struts2, this version of Struts2 jQuery Plugin brings a new Module based on jQuery mobile to you. This includes an easy AJAX support and a jQuery mobile theme for form elements. The new Struts2 jQuery Mobile Showcase gives you an introduction how to use this new module.
Grid Module
This version provides an enhanced Subgrid Feature. Now it is possible to create Multilevel Subgrids. Please take a look at the new 3-Level Subgrid Example in the Grid Showcase.
Richtext Editor
With this version it is easy to enable Uploads for Images and Flash files for your Ckeditor instance.
Enable File Uploads in your struts2.xml:
<!-- Settings for CKEditor Image Upload --><constantname="struts.ckeditor.allowUploads"value="true"/><!-- default is false --><constantname="struts.ckeditor.allowedFileExtensions"value="jpg,jpeg,png"/><constantname="struts.ckeditor.uploadFolder"value="/image-uploads"/>
For an better support of mobile development with Java and the popular MVC Framework Struts2, I include in the next version of Struts2 jQuery Plugin a new Module based on jQuery mobile. Planned Features of the Struts2 Mobile Plugin are an easy AJAX support and a jQuery mobile theme for form elements. I just upload the current development showcase for the new Struts2 jQuery Mobile Showcase.
The current module and showcase is based on the jQuery mobile alpha 3 release.
I'm always open to suggestions.
You want to enhance a default handler, fix a bug or just use an other jquery plugin as the default in Struts2 jQuery Plugin?
Here is a short example hot to overwrite the handler function for the autocompleter in Struts2 jQuery Plugin.
<sj:head/><scripttype="text/javascript">
$.struts2_jquery.autocompleter = function($elem, options) {
alert("my own autocompleter handler for "+options.id);
};
</script>