richface rendered
songjinglim Apr 10, 2012 1:17 AMI'm using richface 4.2.1.CR, don't know is the problem with richface or jsf, I face a very unexplained problem where when EL (expression language) for component rendered attribute return true, the El will exec 5 time!
[test.xhtml]
<!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:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j">
<h:outputText rendered="#{userProfileBean.testBoolean}"></h:outputText>
</html>
[UserProfileBean.java]
@ManagedBean(name = "userProfileBean")
@SessionScoped
@SuppressWarnings("serial")
public class UserProfileBean implements Cloneable, Serializable{
private boolean testBoolean = true;
public boolean isTestBoolean() {
String methodName = "isAutoGeneratePwd";
logger.logp(Level.SEVERE, className, methodName, ">>>testBoolean=" +testBoolean);
return testBoolean;
}
public void setTestBoolean(boolean testBoolean) {
this.testBoolean = testBoolean;
}
}
Output from log:
10/04/2012 3:04:39 PM com.cea.apps.common.faces.bean.UserProfileBean isAutoGeneratePwd SEVERE: >>>testBoolean=true
10/04/2012 3:04:39 PM com.cea.apps.common.faces.bean.UserProfileBean isAutoGeneratePwd SEVERE: >>>testBoolean=true
10/04/2012 3:04:39 PM com.cea.apps.common.faces.bean.UserProfileBean isAutoGeneratePwd SEVERE: >>>testBoolean=true
10/04/2012 3:04:39 PM com.cea.apps.common.faces.bean.UserProfileBean isAutoGeneratePwd SEVERE: >>>testBoolean=true
10/04/2012 3:04:39 PM com.cea.apps.common.faces.bean.UserProfileBean isAutoGeneratePwd SEVERE: >>>testBoolean=true
And if I change the condition to false:
<h:outputText rendered="#{not userProfileBean.testBoolean}"></h:outputText>
EL only exec once where is correct, here the log:
10/04/2012 3:05:21 PM com.cea.apps.common.faces.bean.UserProfileBean isAutoGeneratePwd SEVERE: >>>testBoolean=true
Any help on this?
p/s: The component I mention include <rich:panel> <h:panelGrid>