Naveen Sampra wrote:When I use the rendered attribute, the action listener method does NOT get invoked :
Any ideas why this might happen ?
Remember that because you are invoking an action, the
JSF lifecycle must execute first. Therefore the view is reconstructed, validations fire, values injected etc... it sounds to me like your commandLink is not being rendered because pageBean1.hasSavePrivilege evaluates to something other than true after the view has been reconstructed.
You can prove this one way or the other by hardcoding the pageBean1.hasSavePrivilege method to always return true and leaving the rendered property 'as is' rather than removing it. If clicking on the link causes the action to be invoked, then this is definitely your problem. A simple fix is to add a hidden field to the page and a set method to your bean, so that the previously calculated value of hasSavePrivilege is restored:
and:
Now when you click the link the property will be restored by JSF for you, rendered will evaluate to true and the action will be invoked.
Hope that helped.