I am trying to re-retrieve data from my database whenever the user clicks on a link (just in case any information has changed)
But I am using JSF 1.1,
In JSF 2.0 we have
<f:metadata>
<f:event type="preRenderView" listener="#{refreshDataTable}"> </f:event>
</f:metadata>
or even PhaseListeners, but in 1.1 we don’t.
Does anyone know an equivalent, or anything that can invoke an action on a bean when a link is clicked?
Thanks.
Put the bean in the request scope and do the job in its constructor.
Don’t put the bean in the session scope. That’s only bad for user experience and server memory. If you want to simulate the view scope in JSF 1.x, have a look at Tomahawk’s
<t:saveState>or RichFaces’<a4j:keepAlive>.