Skip to content
Johannes Geppert edited this page Jun 26, 2015 · 1 revision

Introduction

This function allows you to use the jQuery UI button widget for links and submit buttons.

Samples

A Link as jQuery UI Button with Icon

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<html>
	<head>
		<sj:head jqueryui="true"/>
	</head>
	<body>
		<sj:a id="ajaxlink" 
			href="%{ajaxurl}" 
			targets="result" 
			indicator="indicator" 
			button="true" 
			buttonIcon="ui-icon-refresh"
		>
		  	Run AJAX Action
		</sj:a>
	</body>
</html>

A Submit Button as jQuery UI Button

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<html>
	<head>
		<sj:head jqueryui="true"/>
	</head>
	<body>
	    <sj:submit 
	    	targets="formResult" 
	    	value="AJAX Submit" 
	    	indicator="indicator"
	    	button="true"
	    	/>
	</body>
</html>

Attributes in anchor and submit tag

Name

Required

Default

Evaluated

Type

Description

button false false false Boolean jQuery UI Button
buttonIcon false false String Icons to display. The primary icon is displayed on the left of the label text. Value must be a classname (String), eg. ui-icon-gear.
buttonIconSecondary false false String Icons to display. The secondary icon is displayed on the right of the label text. Value must be a classname (String), eg. ui-icon-gear.