Ajax link taglib ver. 1.4


    Custom JSP taglib lets you provide Ajax-based hyperlinks. This tag mimics HTML hyperlinks for Ajax based requests. Tag asynchronously requests your server side (JSP, servlet) and replaces document's body (or some div/span area) with the response. For example:
 


<script language="JavaScript" src="cjajax.js"></script>

<%@ taglib uri="taglib.tld" prefix="a" %>

<a:AjaxLink href="/cj/testLink.jsp" title="link">Ajax Link</a:AjaxLink>

In order to use this tag you have to describe an external JavaScript file cjajax.js on your page.

Url used for the server side request could be calculated in some JavaScript function. It is described in the attribute urlFunction. See JavaScript link taglib also.

By default tag replaces document's body. An optional attribute targetId lets you provide a CSS/DHTML id for the area that will be updated. An optional attribute handler lets you provide your own JavaScript function that will accept the requested data. This function will get two parameters: obtained text and obtained XML document:
 


<script language="JavaScript">
function myHandler(txt, xmlDoc)
{
  your own processing for the requested content
}
</script>

Tags are:

AjaxLink

Body tag defines Ajax-based hyperlink. Parameters are:

1) href Optional parameter. Describes an URL for your requests.
2) urlFunction Optional parameter. Describes a function that will return an url.
3) targetId Optional parameter. Describes a CSS/DHTML id for the updated area.
4) handler Optional parameter. Describes a function for the customized processing.
5) error Optional parameter. Describes a name for your own JavaScript function that will be called in case of errors. By default is empty.
6) beforeAction Optional parameter. Describes a name for your own JavaScript function that will be called at the beginning of request. By default is empty.
7) afterAction Optional parameter. Describes a name for your own JavaScript function that will be called at the end of request. By default is empty.
8) title Optional parameter. Describes a title (tooltip).
9) rel Optional parameter. Describes a rel attribute.
10) className Optional parameter. Describes a CSS class.
11) style Optional parameter. Describes a CSS style.
 

for downloading:

 Library: ajaxlinktag.jar     Description: taglib.tld  JavaScript library: cjajax.js

 © Coldbeans      Comments?

See also Coldtags suite - the largest collection of custom JSP tags.

Also in Coldtags: