Ajax alert taglib ver. 1.2

    Custom JSP taglib lets you provide Ajax-based alarm popups. Tag asynchronously requests your server side (JSP, servlet) and outputs response as a JavaScript alarm. For example:
 


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

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

<script language="JavaScript">
<a:AjaxAlert url="/cj/test.jsp"/>
</script>

No alarms will be provided for the empty responses.

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

Attribute prefix lets you include taglib into your HTML controls. For example, the following code may provide alarm when input filed gets a focus:
 


<input type="text" name="amount" <a:AjaxAlert url="/servlet/MVC" prefix="onFocus"/> >

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.

Tags are:

AjaxAlert

Body tag defines Ajax-based alarm popup. Parameters are:

1) url Optional parameter. Describes an URL for your requests.
2) urlFunction Optional parameter. Describes a function that will return an url.
3) prefix Optional parameter. Describes an event for the alarm requests (e.g. onClick, onMouseOver etc.)
4) error Optional parameter. Describes a name for your own JavaScript function that will be called in case of errors. By default is empty.
5) cond Optional parameter. Describes a boolean attribute tag's behavior depends on. Default value is true (display alert).
 

for downloading:

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

 © Coldbeans      Comments?

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

Also in Coldtags: