Condition on view-profile-panel

Hi there,

I’m trying to set a condition that only shows a Profile Tab if a Java method returns true.

To do that I have:

<view-profile-panel key="user-profile-templates-panel"
                        i18n-name-key="user.templatemanagement.title" name="My Templates Management"
                        class="com.action.IndividualTemplatesPanel">
        <resource type="velocity" name="view"
                  location="templates/user-templates-management.vm"/>
        <condition class="com.condition.UserTemplatesCondition"/>
    </view-profile-panel>

UserTemplatesCondition implements Condition and the boolean value is returned on shouldDisplay method.

However, the profile tab is always shown.
My question is: Can I use condition on “< view-profile-panel >”?

2 Likes

@filipe.ribeiro,

Take a look at the last comment of this issue: JRASERVER-25641

You might be achieve your solution by implementing OptionalUserProfilePanel which is :

" An optional interface for ViewProfilePanel modules that allows the panel to only be show when a criteria is met."

Cheers,
Italo Qualisoni

2 Likes

@italo.qualisoni

That is it. Thank you for your help!

Cheers,
Filipe Ribeiro

1 Like