olha como estou fazendo:
página jsf:
bean:
public String start() {
EntityManager em = Context.getEntityManager();
Date d = new Date();
Task t = (Task) Context.getSession().getAttribute(“task”);
if (t == null) {
t = new Task();
}
t.setStartTime(d);
TaskDetail taskDetail = (TaskDetail) Context.getSession().getAttribute("taskDetail");
t.setTaskDetail(taskDetail);
Account account = (Account) Context.getSession().getAttribute("account");
t.setAccount(account);
em.persist(t);
Context.getSession().setMaxInactiveInterval(28800);
this.task = t;
return "task";
}
public boolean getStartStatus() {
HtmlAjaxCommandButton btnStart = new HtmlAjaxCommandButton();
if (Context.getSession().getAttribute(“task”) == null) {
btnStart.setDisabled(false);
} else {
btnStart.setDisabled(true);
}
return (btnStart.isDisabled());
}
faces-config:
/public/task.xhtml
task
/public/task.xhtml
e nao aparece msg nenhuma, a pagina retorna normal, o alert aparece. Só q o botao de iniciar não está desabilitado! O mais estranho é q quando eu dou um refresh (f5), ela desabilita o botao só q aparece aquela msg de q estou reenviando dados via post… ai tenho q dar um ok(confirm).
alguem pode me ajudar ? valeus!