0
我對primefaces日曆組件有問題。 在託管bean的postconstruct方法中,我爲日曆組件設置了默認值。該默認值不會顯示在我的頁面中,並且顯示的字段爲空。初始化日曆日期的默認值
實現使用Mojarra 2.1.7-jboss和primefaces 3.2。
例如:
@ManagedBean(name = "dashboardController")
@ViewScoped
public class DashboardController implements Serializable {
/**
* selected date To
*/
private Date selectedDateTo;
@PostConstruct
public void postconstruct() {
selectedDateTo = Calendar.getInstance().getTime();
}
// getter setter
嘗試'selectedDateTo = new Date();'而不是... – Daniel
它不起作用。 – ciavaldini
然後顯示xhtml代碼 – Daniel