a4j:jsFunction: can't get oncomplete work.
vadboss May 6, 2010 4:36 PMI have this code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
<head>
<link type="text/css" rel="stylesheet" href="css/clock.css" />
<link type="text/css" rel="stylesheet" href="../common/javascript/jquery.keypad.package-1.2.2/jquery.keypad.css" />
<a4j:loadScript src="resource:///org/richfaces/renderkit/html/scripts/jquery/jquery.js" />
<script type="text/javascript" src="../common/javascript/jquery.keypad.package-1.2.2/jquery.keypad.js"></script>
<script type="text/javascript" src="javascript/clock.js"></script>
</head>
<body>
<div id="clockContainer">
<img src="" name="hra" /><img src="" name="hrb" />
<img src="../common/images/clockCyphers/y.gif"/>
<img src="" name="mina" /><img src="" name="minb" />
<img src="../common/images/clockCyphers/y.gif"/>
<img src="" name="seca" /><img src="" name="secb" />
</div>
<f:view>
<h:form>
<div id="clockFormContainer">
<h:outputLabel styleClass="usernameLabel" value="Username:" for="username" />
<h:inputText styleClass="usernameField" id="username" value="#{clockUser.username}" />
<rich:spacer style="display:block" height="10px"/>
<h:outputLabel styleClass="passwordLabel" value="Password:" for="password" />
<h:inputSecret styleClass="passwordField" id="password" value="#{clockUser.password}" />
<a4j:jsFunction name="checkUser" action="#{clockUser.checkUser}" oncomplete="alert('good');" />
</div>
<rich:spacer style="display:block" height="5px"/>
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<rich:spacer width="5px"/>
<img src="../common/images/restart.png" />
</td>
<td>
Clean
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" onclick="checkUser();">
<tr>
<td>
<rich:spacer width="5px"/>
<img src="../common/images/apply.png" />
</td>
<td>
Clock it
</td>
</tr>
</table>
</h:form>
<rich:modalPanel id="systemMessagesPanel"
width="300"
height="100"
showWhenRendered="false"
onbeforeshow="hideSystemMessagesPanelIn2Seconds()">
<h:panelGroup id="messagesPanelGroup">
<h:messages />
</h:panelGroup>
</rich:modalPanel>
</f:view>
</body>
</html>
I debugged and action from <a4j:jsFunction name="checkUser" action="#{clockUser.checkUser}" oncomplete="alert('good');" /> happens, but after it completes i can't get the alert.