JSF2, reloading a page from a ViewScoped bean without destroying the bean?

StackOverflow https://stackoverflow.com/questions/7078312

  •  23-12-2020
  •  | 
  •  

سؤال

I've got a little problem I'd like to solve. I use Apache Myface 2 with Tomahawk and Trinidad. Trinidad delivers its Dialog Framework to create Modal Dialogs... My problem is that after the Dialog is closed, I want to refresh (re-render) the caller page. As a solution I handle the ReturnListener, update the data of my bean, and send an ExternalContext.redirect to reload my page... but my ViewScoped bean is destroyed and a new one is create ! It is quite logical, but is there a way to reload a page from a Viewscoped bean without sending a redirect (that will destroy the bean...) ? Is the only solution to use partial redering ?

To have it work I changed the scope to Session, but it's uggly in my case.

Thanks for your answers.

هل كانت مفيدة؟

المحلول

If you want to stick to view scope then yes only ppr can be of help, its not actually hard to set partialTrigger on the top level element which will refresh everything inside.

On the other had if you are ok to go with session or application scope i think you already are able to do that.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top