-
1. Re: FacesMessages are not getting displayed
nbelaevski Sep 9, 2009 6:52 PM (in response to snowhite)Hi,
Have you checked whether action listener method is really called? -
2. Re: FacesMessages are not getting displayed
snowhite Sep 9, 2009 7:10 PM (in response to snowhite)When user has access to the hyperlink, actionlistener is being called. But when user has no access, it seems that actionlistener is not called. This happens only when I set the "isValid" variable to the result coming from database.
However, if I hard code the variable to "false", now action listener is called and error message is shown on the page. -
3. Re: FacesMessages are not getting displayed
nbelaevski Sep 9, 2009 7:43 PM (in response to snowhite)How does #{module1Manager.renderEditLink} look like?
-
4. Re: FacesMessages are not getting displayed
snowhite Sep 9, 2009 8:02 PM (in response to snowhite)Thanks for your reply.
Below is the code:public boolean isRenderEditLink() { renderEditLink = AccessManager.checkElementIdAccess("editId", identity.getUsername()); return renderEditLink; }
I am doing the same access check while rendering the link. I am doing an additional check to see whether the user's role is been changed while his session exists and so whether he have the access to the link(once he clicks the link). I hope I am clear in explaining my problem. -
5. Re: FacesMessages are not getting displayed
nbelaevski Sep 9, 2009 8:06 PM (in response to snowhite)Action is not triggered for components that are not rendered, because they aren't processed at all. I think that's causing the problem in your case.
-
6. Re: FacesMessages are not getting displayed
snowhite Sep 10, 2009 12:15 PM (in response to snowhite)But, action is called when I simply put "isValid" to false. I can see the error message then. Can you suggest me any workaround for this issue.
Thanks -
7. Re: FacesMessages are not getting displayed
nbelaevski Sep 10, 2009 1:43 PM (in response to snowhite)Remove "rendered" expression and check whether it's the real cause first.
-
8. Re: FacesMessages are not getting displayed
snowhite Sep 10, 2009 2:31 PM (in response to snowhite)Yes, when I removed "rendered" expression it works just fine. But, I need to render the UI elements conditionally so I need to use "rendered" expression. Is there any other way to do this?
Thanks -
9. Re: FacesMessages are not getting displayed
nbelaevski Sep 10, 2009 2:55 PM (in response to snowhite)You should make this condition be stable across requests, in the sense that it evaluates to the same value when the view is rendered and when the submitted view is processed on the subsequent request.
-
10. Re: FacesMessages are not getting displayed
snowhite Sep 10, 2009 5:13 PM (in response to snowhite)Thank you very much.
I am able to render UI element conditionally using JSTL tags and still checking the access permissions in actionlistener method. Everything works fine. Thanks for your valuable information.