[
https://issues.apache.org/struts/browse/SHALE-431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40698
]
Richard W. Eggert II commented on SHALE-431:
--------------------------------------------
Note that this specifically affects components that implement Tomahawk's
UserRoleAware interface, which, according to the Tomahawk Javadocs, include the
following:
Div, HtmlCommandButton, HtmlCommandJSCookMenu, HtmlCommandLink,
HtmlCommandNavigation, HtmlCommandNavigationItem, HtmlCommandSortHeader,
HtmlDataScroller, HtmlDataTable, HtmlGraphicImage, HtmlHeaderLink,
HtmlInputCalendar, HtmlInputDate, HtmlInputFileUpload, HtmlInputSecret,
HtmlInputText, HtmlInputTextarea, HtmlInputTextHelp, HtmlMessage, HtmlMessages,
HtmlOutputLabel, HtmlOutputText, HtmlPanelGrid, HtmlPanelGroup,
HtmlPanelNavigation, HtmlPanelNavigationMenu, HtmlSchedule,
HtmlSelectBooleanCheckbox, HtmlSelectManyCheckbox, HtmlSelectManyListbox,
HtmlSelectManyMenu, HtmlSelectOneListbox, HtmlSelectOneMenu,
HtmlSelectOneRadio, HtmlTag, InputHtml, SelectOneCountry, SelectOneLanguage,
UINavigationMenuItem
Thanks go to Gary VanMatre for diagnosing the problem.
> Tomahawk's enabledOnUserRole property doesn't work with Clay
> ------------------------------------------------------------
>
> Key: SHALE-431
> URL: https://issues.apache.org/struts/browse/SHALE-431
> Project: Shale
> Issue Type: Bug
> Components: Clay
> Affects Versions: 1.0.4
> Reporter: Richard W. Eggert II
>
> The "enabledOnUserRole" attribute accepted by most Tomahawk components
> (t:selectBooleanCheckbox, t:inputTextArea, etc.) does not have an effect when
> the components are instantiated using Clay. The "visibleOnUserRole"
> attribute does seem to work properly, however. Extending the components to
> explicitly set the "rendererType" attribute fixes the problem.
> Example:
> <input
> type="checkbox"
> jsfid="t:selectBooleanCheckbox"
> value="#{mybean.myflag}"
> enabledOnUserRole="myrole"
> />
> When logged in as a user that does not have the role "myrole", the checkbox
> above still renders normally (in read/write mode).
> Example workaround:
> <component jsfid="mySelectBooleanCheckbox" extends="t:selectBooleanCheckbox">
> <attributes>
> <set name="rendererType" value="org.apache.myfaces.Checkbox"
> bindingType="VB" />
> </attributes>
> </component>
> <input
> type="checkbox"
> jsfid="mySelectBooleanCheckbox"
> value="#{mybean.myflag}"
> enabledOnUserRole="myrole"
> />
> With the "rendererType" attribute set as above, the checkbox renders as
> expected (in read-only mode for users that do not have the specified role).
> This issue affects many if not all Tomahawk components that use the
> "enabledOnUserRole" attribute (which is pretty much all of them).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.