0

I'am using primefaces in a jsf application. I make an update to datalist. That's fine but on persisting data on database the list does not refresh after updating. I have used @post construct to initially data. But it seems that it is not called.

 <p:commandButton value="Validate" action="#{manageUrlSiteTestBean.validate()}" />

This is the backing bean:

@ManagedBean
@SessionScoped
public class ManageUrlSiteTestBean implements Serializable{
    public String validate(){
        local.updateUrlSite(siteweb);
        form=false;
        siteweb=new SiteWebImpose() ;
        init();
        return null;

    }
    @PostConstruct
    public void init(){
        setSitewebs(local.listerUrlSiteTests());
    }}
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Manel Chaabene
  • 187
  • 1
  • 3
  • 14
  • 2
    A `@PostConstruct` method in a session scoped managed bean is invoked only once when the associated session is created. If you need, "*refresh after updating*", then you will need a narrower scoped managed bean or trigger the routine performing the task of updating yourself manually whenever an update is made. – Tiny Jul 09 '16 at 14:42
  • Please add your ` – sinclair Jul 10 '16 at 20:38

0 Answers0