Is there a way to update the preRenderView components with ajax?
Some example:
<html>
<f:event type="preRenderView" listener="#{bean1.load}" />
<f:event type="preRenderView" listener="#{bean2.load}" />
<body>
<div jsf:rendered="#{bean1.enabled}" >
// some code here
</div>
</div jsf:rendered="#{bean2.enabled}" >
// some code here
</div>
</body>
</html>
In this example, i want the preRenderView of case 1 only be fired if bean1 is enabled. Adding a check in java code is not a good idea, because the session will be invoked everytime and i have a way more complex thing than the simple sample above.
Can i wrap the f:events in any component? Add a rendered attribute to the component and update them with an ajax call?
As far as i know, it's not allowed to add any other components as head or body as children of the html tag. Is it allowed to pack the preRenderView inside the body element and wrap it with a simple jsf:div?