cancel
Showing results for 
Search instead for 
Did you mean: 

booleanEvaluator <ELSE> tag

mesa2e
Champ in-the-making
Champ in-the-making
I need the application load an actions menu depending if he is administrator or not.
I've alreday created a custom menu actions in web-client-config-actions.xml
I'm using the following code to check if the user is admin:


a:booleanEvaluator value="#{NavigationBean.currentUser.admin == true}" id="evalA">
<td style="padding-left:4px" width=80>
<%– More actions menu –%>
<a:menu id="actionsMenu" itemSpacing="4" label="#{msg.more_actions}" image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu" style="white-space:nowrap">
<r:actions id="acts_browse" value="browse_actions_menu" context="#{NavigationBean.currentNode}" />
</a:menu>
</td>
</a:booleanEvaluator>

I need to include an ELSE tag or something like that, so in case the user is not admin, the application load a custom actions menu.

Thanks in advance,
Elena.
4 REPLIES 4

mikeh
Star Contributor
Star Contributor
value="#{NavigationBean.currentUser.admin == false}"

should do the trick!  Smiley Happy

Thanks,
Mike

mesa2e
Champ in-the-making
Champ in-the-making
Thanks Mike. That was clear for me. But, how/where include that in my code?

Thanks in advance,
Elena.

mikeh
Star Contributor
Star Contributor
Well, depends what you mean by "custom actions menu" but you'd have something like:

<a:booleanEvaluator value="#{NavigationBean.currentUser.admin == true}" id="evalA">
<td style="padding-left:4px" width=80>
<%– More actions menu –%>
<a:menu id="actionsMenu" itemSpacing="4" label="#{msg.more_actions}" image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu" style="white-space:nowrap">
<r:actions id="acts_browse" value="browse_actions_menu" context="#{NavigationBean.currentNode}" />
</a:menu>
</td>
</a:booleanEvaluator>
<a:booleanEvaluator value="#{NavigationBean.currentUser.admin == false}" id="evalB">
<td style="padding-left:4px" width=80>
*** Custom non-admin menu goes in here ***
</td>
</a:booleanEvaluator>

Mike

mesa2e
Champ in-the-making
Champ in-the-making
Thanks Mike.

It works! I also had to change the ids, because if not the application returned duplicates.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.