[richfaces-issues] [JBoss JIRA] Resolved: (RF-3674) Cannot prevent node selection in rich:tree via onselected
Nick Belaevski (JIRA)
jira-events at lists.jboss.org
Mon Jan 26 07:03:44 EST 2009
[ https://jira.jboss.org/jira/browse/RF-3674?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nick Belaevski resolved RF-3674.
--------------------------------
Fix Version/s: 3.3.1
(was: Future)
Resolution: Out of Date
Assignee: Tsikhon Kuprevich (was: Nick Belaevski)
Works fine with 3.3.1-snapshot:
<style type="text/css">
.tree-selected {
color: red;
}
</style>
<h:form>
<rich:tree selectedClass="tree-selected" switchType="client" style="width:300px" value="#{library.data}" var="item" nodeFace="#{item.type}">
<rich:treeNode type="artist" iconLeaf="/images/tree/singer.gif" icon="/images/tree/singer.gif">
<h:outputText value="#{item.name}" />
</rich:treeNode>
<rich:treeNode type="album" iconLeaf="/images/tree/disc.gif" icon="/images/tree/disc.gif">
<h:outputText value="#{item.title}" />
</rich:treeNode>
<rich:treeNode onselected="return false;" type="song" iconLeaf="/images/tree/song.gif" icon="/images/tree/song.gif">
<h:outputText value="#{item.title}" />
</rich:treeNode>
</rich:tree>
</h:form>
> Cannot prevent node selection in rich:tree via onselected
> ---------------------------------------------------------
>
> Key: RF-3674
> URL: https://jira.jboss.org/jira/browse/RF-3674
> Project: RichFaces
> Issue Type: Bug
> Affects Versions: 3.2.1
> Reporter: Bjoern Eickvonder
> Assignee: Tsikhon Kuprevich
> Fix For: 3.3.1
>
>
> Since RF 3.2.1 it is longer possible to prevent node selection by setting "onselected='return false;'".
> To be more precise if a node A is selected and the user tries to select a node B whose onselected method returns false, node A is toggled, then node B and again node A (see tree.js and tree-item.js). So far it works, the problem is that the selectedTextClassNames of B are not reset, such that visually A and B seem to be selected afterwards.
> Reason for this is that selectedTextClassNames are added to previousTextClassNames on selection but not removed from this string on deselect, such that if the user moves out from the node B appears to be selected as well.
> This could be fixed quite simple by adjusting the deselect method in tree-item.js as follows:
> deselect: function() {
> var eText = this.elements.textElement;
> if (this.selectedTextClassNames) {
> var classNames = this.selectedTextClassNames.split(' ')
> for (var i = 0; i < classNames.length; i++) {
> Element.removeClassName(eText, classNames[i]);
> }
> if (this.previousTextClassNames && this.previousTextClassNames.indexOf(this.selectedTextClassNames)!=-1) {
> this.previousTextClassNames = this.previousTextClassNames.substring(0,this.previousTextClassNames.indexOf(this.selectedTextClassNames));
> }
> }
> },
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the richfaces-issues
mailing list