Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-13235

Tree - Row key conversion fails (UITree should not have generated @rowKeyConverter, since it is fully implemented in AbstractTree)

    Details

    • Sprint:
      5.0.0.Alpha2 - Sprint 2

      Description

      The row key generation for Tree stopped to work:
      got: <div id="j_idt106:tree:org.richfaces.model.SequenceRowKey[0, 0, 0]:j_idt111" class="rf-tr-nd rf-tr-nd-lf">
      expected: <div id="j_idt106:tree:0.0.0:j_idt111" class="rf-tr-nd rf-tr-nd-lf">


      The cause was that rowKeyConverter resolves to null, so plain toString on rowKey is used.

      I was wondering why rowKeyConverter isn't resolved for Tree in Showcase - the problem is that CDK generates this attribute and thus its implementation in AbstractTree (which is the correct way of rowKeyResolution) isn't used at all.

      I'm pretty sure this is caused by refactoring from tree-model-props.xml to use Java interfaces TreeProps and TreeCommonProps:
      https://github.com/richfaces/richfaces/commit/62ab0fe3f00b44a166b522ecb71e1733897aeebe

      However it's not clear why the rowKeyConverter wasn't generated in RF 4.3 when it wasn't marked as generate=false:
      https://github.com/richfaces4/components/blob/master/iteration/ui/src/main/resources/META-INF/cdk/attributes/tree-model-props.xml#L48

      Note that in RF 5 it is generated because UIAdaptor has @Attribute which defaults to generate=true:
      https://github.com/richfaces/richfaces/blob/master/framework/src/main/java/org/richfaces/ui/iteration/UIDataAdaptor.java#L612

      Workaround is marking rowKeyConverter as generate=false in AbstracTree (or maybe RowKeyConverter), but we should rather investigate why this issue happens.


      This issue has bigger potential since during refactoring of properties, Brian Leathem could work with the same assumption as I did ^.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  lfryc Lukáš Fryč (Inactive)
                  Reporter:
                  lfryc Lukáš Fryč (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: