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

Seam Validator raises "property cannot be resolved" warnings when single value is used instead of List

XMLWordPrintable

      Jboss Tools does not recognize correctly the "var" property in list iterators (e.g. rich:dataTable, h:dataTable) if the "value" property is a single value (but works if the "value" property is a List.
      This problem occurs for XHTML pages generated by seam-gen where the value is "#

      {myEntityHome.instance.singleValue}

      " (see https://jira.jboss.org/jira/browse/JBIDE-4048).

      Effects:
      1. add a lot of warnings "variableName cannot be resolved" that should be there
      2. makes "Seam Validator" task to be very slow when there is a lot of pages (because the Seam Validator task is run on each XHTML file with at least one unresolved EL, see https://jira.jboss.org/jira/browse/JBIDE-3336)

      Expected:
      As the rich:dataTable displays one row when the "value" property is a single value and not a list, Jboss Tools is expected to recognize list AND single value.

      How to reproduce:
      EXECUTE: Create seam project.
      EXECUTE: Create MyBean component (see attached java file)
      EXECUTE: Open home.xhtml
      EXECUTE: Add:
      <h:dataTable var="myVar" value="#

      {myBean.values}

      ">
      <h:column><h:outputText value="#

      {myVar.myProperty}"/></h:column>
      </h:dataTable>
      <h:dataTable var="myVar" value="#{myBean.singleValue}">
      <h:column><h:outputText value="#{myVar.myProperty}

      "/></h:column>
      </h:dataTable>
      <h:dataTable var="myVar" value="#

      {myBean.singleValueAsList}

      ">
      <h:column><h:outputText value="#

      {myVar.myProperty}

      "/></h:column>
      </h:dataTable>
      ASSERT: no warning "myVar cannot be resolved" appear

      Workaround:
      Use a "value" property as List and not as single value (maybe wrapping the single value to a List should do the trick).

        1. edit.xhtml.ftl
          9 kB
        2. EntityHome.java.ftl
          6 kB
        3. MyBean.java
          0.6 kB
        4. singleValuedVarCannotBeResolved.png
          singleValuedVarCannotBeResolved.png
          17 kB
        5. view.xhtml.ftl
          9 kB

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

              Created:
              Updated:
              Resolved: