I’m building a web application using struts2 and the jquery plugin. I’m trying to use the “indicator” functionality included in the jquery plugin. Indeed I would like to fire a popup saying “loading…” when the user performs some actions (button clicks, list selection…).
So I have this master page MasterPage.jsp:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<head>
<s:url id="customTheme" value="/template/themes" ></s:url>
<sj:head defaultIndicator="indictor" jqueryui="true" jquerytheme="warrtheme" customBasepath="%{customTheme}" />
</head>
<body>
<sj:dialog id="indicator"
title="Loading"
autoOpen="false"
modal="true"
resizable="false">
<table>
<tr>
<td> </td>
<td><img src="<s:url value="/images/indicator.gif" />" /></td>
<td>Loading...</td>
</tr>
</table>
</sj:dialog>
</body>
</html>
And I have this regular page User.jsp:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<div class="content">
<s:url var="openViewUser" namespace="/administration" action="administration_utilisateur_open" />
<sj:a href="%{openViewUser}" id="divUserLink" targets="divUser" indicator="indicator">
<div id="divUser"></div>
</div>
When I click the link in the above code, the popup doesn’t show up.
Any clue guys ?
Thanks in advance.
you have to subscribe the open topics or you have to trap the onclick event .Suppose you want to show dialog on click
and once the ajax is loaded successfully ,close the dialog box using this