This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 268231

Summary: Attributes for facelet custom component tag not recognized dynamically according to spec
Product: javaee Reporter: d_maidaniuk
Component: JSF EditorAssignee: Martin Fousek <marfous>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Dynamic attributes not recognized properly by JSF editor

Description d_maidaniuk 2016-09-27 11:45:27 UTC
Created attachment 162238 [details]
Dynamic attributes not recognized properly by JSF editor

Hi,

According to spec for JSF 2.1 (located at http://download.oracle.com/otndocs/jcp/jsf-2_1-mrel2-oth-JSpec/) facelets tag attributes should be recognized basing on reflection for component class. See TABLE 10-1 "Comparison of Facelets and JSP" in chapter 10.1.1 "Differences between JSP and Facelets":

"Handling of tag attributes
Tag attributes are completely dynamic and automatically map to properties,
attributes and ValueExpressions on UIComponent instances."

However JSF editor rely on rules defined for JSP:

"All tag attributes must be declared in a TLD file. Conformance instances of
components in a page with the expected attributes can be enforced with a taglibrary validator."

I added screenshot with our custom component <ct:jodaCalendar /> which extends PrimeFaces org.primefaces.component.calendar.Calendar and defined in taglib in next way:

  <tag>
    <description><![CDATA[
        CRX extension of PF Calendar component to work with Joda date and time.
        Extended attributes are listed here. See PF Calendar for all available attributes.
    ]]>
    </description>
    <tag-name>jodaCalendar</tag-name>
    <component>
      <component-type>lu.crx.faces.component.JodaCalendar</component-type>
      <renderer-type>lu.crx.faces.component.JodaCalendarRenderer</renderer-type>
    </component>
    <attribute>
      <description><![CDATA[
          Expects a 'date' value (default), a 'time' value, or 'both'.
          The corresponding converter strategy will target jodatime object DateMidnight, LocalTime or DateTime.]]>
      </description>
      <name>type</name>
      <required>false</required>
      <type>java.lang.String</type>
    </attribute>
  </tag>

Attributes "value" and "required" should be recognized basing on properties of lu.crx.faces.component.JodaCalendar class. But errors says that those attributes not defined for component jodaCalendar.

Regards,
Dmytro