I'm using convertDateTime tag in DataTable component. Connected managed bean property to timezone attribute. In this situation, every ajax requests re-creating Managed Bean.
The Managed Bean scope is View Scoped.
<h:column>
<f:facet name="header">
<h:outputLabel value="Date"/>
</f:facet>
<h:outputText value="#{item.date}">
<f:convertDateTime timeZone="#{myBean.timezone}" locale="tr" pattern="dd.MM.yyyy"/>
</h:outputText>
</h:column>
@ManagedBean(name="myBean")
@ViewScoped
public class MyBean {
@PostConstruct
public void initBeanMethod(){
System.out.println("PostConstruct method is called...");
}
private TimeZone timezone = TimeZone.getDefault();
public TimeZone getTimezone() {
return timezone;
}
public void setTimezone(TimeZone timezone) {
this.timezone = timezone;
}
Shows the following output after each ajax request: "PostConstruct method is called..."
Do you have an idea about Re-creation of beans on each request?
Note: I apologize for my bad english :)