Ajax PopUp taglib ver. 1.3

    Custom JSP taglib for your UI development. This taglib lets you define a hyperlink that popups some window with your own HTML/JSP code. Taglib is similar to our Popup taglib but lets you define a content via Ajax request. For example:
 


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

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

What does
<ap:apopup onMouse="true" url="/servlet/MVC">it mean?</ap:apopup>
<br>Just click on the link or move your mouse over it.

and you will get this picture:

What does it mean?
Just click on the link or move your mouse over it.

Tag lets you request data from server side (attribute url) and display them in the popup window. Attribute urlFunction lets you define a JavaScript function that will construct URL for the request in dynamic.

Attributes beforeAction and afterAction lets you provide your own JavaScript code that marks start/end phase of request. For example you can show/hide here some loading image etc. So, you can describe in your HTML code some progress indicator:
 


<div style="display:none" id="loading"><img src="loading.gif"/></div>

and define two JavaScript functions:
 


function beforeAction()
{
document.getElementById("loading").style.display="block";
}

function afterAction()
{
document.getElementById("loading").style.display="none";
}

it lets you show/hide progress indicator

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

Tags are:

apopup

Body tag implements a popup window. Parameters are:

1) id Optional parameter. Describes an id for this window (if you have more than one popup element on your page). Default value is apopup.
2) onClick Optional parameter. Possible values are true or false. If this value is true new window will be up when you click on the link. Default value is true.
3) onMouse Optional parameter. Possible values are true or false. If this value is true new window will be up when you move your mouse over the link. Default value is false.
4) style Optional parameter. Describes a CSS style for your link. Default value is text-decoration:none
5) className Optional parameter. Describes a CSS class for your link.
6) windowStyle Optional parameter. Describes a CSS style for your window. Default value is position:absolute;visibility:hidden;background-color:yellow;padding:3px;border-style:solid;border-color:black;border-width:1px;margin-top:5px;
7) windowClassName Optional parameter. Describes a CSS class for your window.
8) url Optional parameter. Describes an URL for Ajax request
9) urlFunction Optional parameter. Describes a JavaScript function that returns an URL
10) beforeAction Optional parameter. Describes a name for your own JavaScript function that will be called at the beginning of request. By default is empty.
11) afterAction Optional parameter. Describes a name for your own JavaScript function that will be called at the end of request. By default is empty.
12) cond Optional parameter. Describes a boolean attribute tag's behavior depends on. Default value is true (display popup).

for downloading:

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

© Coldbeans      Comments?

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

Also in Coldtags: