Skip to content
Stefaan Dutry edited this page Aug 26, 2022 · 4 revisions

Introduction

The head tag renders required JavaScript code to configure jQuery and is required in order to use any of the tags included in the jQuery plugin.

Samples

Head tag for base AJAX calls

	<%@ taglib prefix="s" uri="/struts-tags"%>
	<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
	<html>
	  <head>
		<sj:head/>
	  </head>
	  <body>
	  </body>
	</html>

Head tag for AJAX calls, Effects and Widgets with Default Indicator

The locale attribute configures jQuery locale for datepicker, jqGrid and DataTables tags. Default is en you can use all locales that are bundled with jQuery. e.g. "de, "fr", "ja", ...

The default indicator is visible at every ajax request.

	<%@ taglib prefix="s" uri="/struts-tags"%>
	<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
	<html>
	  <head>
		<sj:head locale="de" jqueryui="true" defaultIndicator="myDefaultIndicator"/>
	  </head>
	  <body>
		<img id="myDefaultIndicator" src="images/ajax-loader.gif" alt="Loading..." style="display:none"/>
	  </body>
	</html>

Themes

Base Themes

Built in themes from Plugin

  • black-tie
  • blitzer
  • cupertino
  • dark-hive
  • dot-luv
  • eggplant
  • excite-bike
  • flick
  • hot-sneaks
  • humanity
  • le-frog
  • mint-choc
  • overcast
  • pepper-grinder
  • redmond
  • smoothness
  • south-street
  • start
  • sunny
  • swanky-purse
  • trontastic
  • ui-darkness
  • ui-lightness
  • vader

Sample usage:

	<%@ taglib prefix="s" uri="/struts-tags"%>
	<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
	<html>
	  <head>
		<sj:head locale="de" jqueryui="true" jquerytheme="redmond"/>
	  </head>
	  <body>
	  </body>
	</html>

Custom Themes

Create and download your own theme with jQuery ThemeRoller

  1. Create a folder in your WebRoot path template/themes/mytheme
  2. Extract downloaded theme and switch into the css folder
  3. Rename jquery-ui-x.x.x.custom.css to jquery-ui.css
  4. Copy jquery-ui.css and images folder into the template/themes/mytheme folder

Sample usage:

	<%@ taglib prefix="s" uri="/struts-tags"%>
	<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
	<html>
	  <head>
		<s:url var="context" value="/" />
		<sj:head locale="de" jqueryui="true" jquerytheme="mytheme" customBasepath="%{context}template/themes"/>
	  </head>
	  <body>
	  </body>
	</html>

Attributes

Name

Required

Default

Evaluated

Type

Description

ajaxcache false false false Boolean If set to false it will force the pages that you request to not be cached by the browser.
ajaxhistory false false false Boolean If set to true it will enable history and bookmarking for AJAX content and jQuery UI Tabs.
compressed false true false Boolean use compressed version of jquery and jquery-ui
customBasepath false false String base path for custom jQuery designs
debug false false false Boolean enable debug logging
defaultErrorText false false String The default error text for all AJAX actions
defaultIndicator false false String The default indicator for all AJAX actions
defaultLoadingText false false String The default loading text for all AJAX actions
jquerytheme false smoothness false String jQuery UI theme
jqueryui false true false Boolean enable jQuery UI Scripts
loadAtOnce false false false Boolean do not use the on demand load for jquery ui resources
loadFromCdn false false false Boolean Load JavaScript from jQuery content distribution network
locale false en or struts.local value false String import jQuery i18n scripts.
scriptPath false #your context root#/struts/ false String path to the JavaScript ressources
Clone this wiki locally