JSF 2 allows to init URL parameter using <f:viewParam>
tag.
For example:
<f:viewParam id="name" name="name"
value="#{applicationBean.name}" required="true" />
and then use this parameter in the backing bean to load some objects using <f:event>
.
For example:
<f:event type="preRenderView"
listener="#{applicationBean.preRenderView}" />
The preRenderView()
method in applicationBean
sets some boolean variable buttonEnabled
to either true\false
When using this variable in the main page to enable\disable button it doesn't work (e.g it always evaluates to false):
<h:commandButton disabled="#{!applicationBean.buttonEnabled}">
Any suggestions?