I have a problem I really don't understand.
I'm using the last version of primefaces ( downloaded today ), JSF2.0 with Mojarra-2.0.2 , Glassfish 3.01.
I used the code I found in another topic
http://primefaces.prime.com.tr/forum/vi ... t=p%3Aajax
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
</h:head>
<h:body>
<h:form>
<h:outputLabel value="Zip:"/>
<p:inputMask id="zip" mask="99999-999" value="#{dataBean.zip}" required="true" requiredMessage="Required field">
<p:ajax event="blur" update="message" actionListener="#{dataBean.onZipBlur}" />
</p:inputMask>
<h:message for="zip" />
<br />
<h:outputLabel value="Message:"/>
<h:outputText id="message" value="#{dataBean.message}" />
<br />
<h:commandButton value="Do It" />
</h:form>
</h:body>
</html>
Code: Select all
package controller;
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.event.ActionEvent;
@ManagedBean
@ViewScoped
public class DataBean implements Serializable {
private String _zip;
private String _message;
public DataBean() {
}
public String getZip() {
return _zip;
}
public void setZip(String zip) {
_zip = zip;
}
public String getMessage() {
return _message;
}
public void setMessage(String message) {
_message = message;
}
public void onZipBlur(ActionEvent ev) {
setMessage("Zip set to: " + " - " + getZip());
}
}
Code: Select all
<h:form>
<p:panel header="Ajaxify">
<h:panelGrid columns="3" cellpadding="5">
<h:outputText value="KeyUp: " />
<h:inputText id="firstname" value="#{pprBean.firstname}">
<p:ajax event="keyup" update="out1" />
</h:inputText>
<h:outputText id="out1" value="#{pprBean.firstname}" />
<h:outputText value="Blur: " />
<h:inputText id="surname" value="#{pprBean.surname}">
<p:ajax event="blur" update="out2" />
</h:inputText>
<h:outputText id="out2" value="#{pprBean.surname}" />
</h:panelGrid>
</p:panel>
<p:ajaxStatus style="width:16px;height:16px;">
<f:facet name="start">
<h:graphicImage value="../design/ajaxloading.gif" />
</f:facet>
<f:facet name="complete">
<h:outputText value="" />
</f:facet>
</p:ajaxStatus>
</h:form>
I'm completely blocked on that.
Do you have any idea ?
Thanks