My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for

Button  
Render a Link or a Submit Button as jQuery UI Button
Updated Jul 12, 2010 by johgep

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.
Comment by ican...@gmail.com, Jan 25, 2011

<%@ 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>

Comment by yueki...@gmail.com, May 17, 2011

FormResult? doesn't open the new page in the parent, is open a div target, not?

Comment by ashishab...@gmail.com, Jul 15, 2011

how to add List? as I want to display data from database.

Comment by christop...@gmail.com, Oct 25, 2011

UI is OK, but no icon is displayed with this tag, is there a bug ? <sj:submit button="true" buttonIcon="ui-icon-gear"/>

It's OK with this tag : <sj:a href="#" button="true" buttonIcon="ui-icon-gear">Search</sj:a>

Same problem with buttonIconSecondary attribute.

Comment by jokog...@verifynigeria.com, Dec 30, 2011

gfngdngd

Comment by chifor.c...@yahoo.com, Mar 19, 2012

how do we use the regular jquery-ui functions ? i mean, i want : $("img").button(); or $("input").button();

Comment by joaquin....@gmail.com, May 24 (5 days ago)

we


Sign in to add a comment
Powered by Google Project Hosting