Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-4903

CA should recognize the object type when using generics in rich:dataTable value

XMLWordPrintable

    • Documentation (Ref Guide, User Guide, etc.)
    • Medium

      When having a rich:dataTable whose value is a List of objects (saying List<User>), the suggestion completion (aka CA) is done on the var attribute and works fine:

      <rich:dataTable value="#

      {myBean.userList}

      " var="_user">
      <rich:column>
      <h:outputText value="#{_user.name}" /> <!-- CA is done correctly on the name property -->
      </rich:column>
      </rich:dataTable>

      However, when having a generic List of objects, CA does not work.

      This occurs for example when converting a Set<User> to a List<User> to provide to the dataTable (due to JSF restrictions to work on List and not on Set) if the convert function uses generics:

      @Name("jsfUtils")
      public class JsfUtils {
      public <T> List<T> asList(Set<T> set)

      { return new ArrayList<T>(set); }

      }

      <rich:dataTable value="#

      {jsfUtils.asList(myBean.userSet)}

      " var="_user">
      <rich:column>
      <h:outputText value="#{_user.name}" /> <!-- CA does not work on the name property -->
      </rich:column>
      </rich:dataTable>

      It would be nice if the type <T> is recognized as <User> by transitivity.

            alexeykazakov Alexey Kazakov
            jkronegg_jira Julien Kronegg (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 2 days
                2d
                Remaining:
                Remaining Estimate - 2 days
                2d
                Logged:
                Time Spent - Not Specified
                Not Specified