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 256703 - 'targetAttributeName' not defined in the component attribute
Summary: 'targetAttributeName' not defined in the component attribute
Status: NEW
Alias: None
Product: javaee
Classification: Unclassified
Component: JSF (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Martin Fousek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-19 23:01 UTC by hink084
Modified: 2016-02-01 23:53 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Bug as shown in Netbeans (24.30 KB, image/png)
2015-11-19 23:01 UTC, hink084
Details
Attributes picked up by Intellisense (39.63 KB, image/png)
2015-11-19 23:02 UTC, hink084
Details
Composite Tag Library Changes (80.44 KB, application/xml)
2016-02-01 23:48 UTC, hink084
Details
Re-bundled JAR w/ Fixes (2.97 MB, application/octet-stream)
2016-02-01 23:53 UTC, hink084
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hink084 2015-11-19 23:01:13 UTC
Created attachment 157422 [details]
Bug as shown in Netbeans

Netbeans shows an error that "the attribute targetAttributeName is not defined in the component attribute"


Reproduced by defining a JSF Composite Component as follows:

<ui:component xmlns="http://www.w3.org/1999/xhtml"
              xmlns:cc="http://xmlns.jcp.org/jsf/composite"
              xmlns:ui="http://xmlns.jcp.org/jsf/facelets">

    <cc:interface>
        <cc:attribute name="actionListenerAlias" targets="myTarget" targetAttributeName="actionListener"/> 
    </cc:interface>

    <cc:implementation>
        ...
    </cc:implementation>
</ui:component>


According to the documentation listed by the link below, it is indeed a valid attribute.

JSF 2.2 View Declaration Language: Facelets Variant:
https://docs.oracle.com/javaee/7/javaserver-faces-2-2/vdldocs-facelets/cc/attribute.html


I am using:
Netbeans 8.1 x64 / Windows 7
Glassfish 4.1 / Java EE 7 / Mojarra 2.2.12

I believe this attribute was added in JSF 2.1.
Comment 1 hink084 2015-11-19 23:02:47 UTC
Created attachment 157423 [details]
Attributes picked up by Intellisense
Comment 2 hink084 2016-02-01 23:48:16 UTC
Created attachment 158350 [details]
Composite Tag Library Changes

This should probably be submitted as a patch, but I'm not familiar enough with the Netbeans source code or Mercurial.

The attached XML file is located within the Netbeans installation directory here: 
enterprise\modules\ext\jsf-2_2\javax.faces.jar\com\sun\faces\metadata\taglib

I've made the following additions to the attached XML file to resolve this issue.
+ Lines [1063-1099]

        <attribute>
            <description><![CDATA[
                <div class="changed_added_2_1">
                <p>This attribute allows the name of the attribute exposed to
                the using page to differ from the one actually used in the
                implementation. For example, consider a composite component that
                contains two buttons, one that means "submit" and one that
                means "cancel". It is natural to want to declare two composite
                component attributes to allow these buttons to be customized,
                for example, "submitAction" and "cancelAction". For both of
                these buttons, the method expression should be retargeted to the
                inner button's "action" attribute. This scenario would be
                expressed as follows.</p>

                <p><code>
                &lt;cc:interface&gt;<br/>
                &nbsp;&nbsp;&lt;cc:attribute name="submitAction" targetAttributeName="action"<br/>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                method-signature="java.lang.Object action()"/&gt;<br/>
                &nbsp;&nbsp;&lt;cc:attribute name="cancelAction" targetAttributeName="action"<br/>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                method-signature="java.lang.Object action()"/&gt;<br/>
                &nbsp;&nbsp;&lt;cc:actionSource name="submitAction"/&gt;<br/>
                &nbsp;&nbsp;&lt;cc:actionSource name="cancelAction"/&gt;<br/>
                &lt;/cc:interface&gt;<br/>
                &lt;cc:implementation&gt;<br/>
                &nbsp;&nbsp;&lt;h:commandButton id="submitAction" value="submit" /&gt;<br/>
                &nbsp;&nbsp;&lt;h:commandButton id="cancelAction" value="cancel" /&gt;<br/>
                &lt;/cc:implementation&gt;
                </code></p></div>
            ]]></description>
            <name>targetAttributeName</name>
            <required>false</required>
            <type>java.lang.String</type>
        </attribute>
Comment 3 hink084 2016-02-01 23:53:42 UTC
Created attachment 158351 [details]
Re-bundled JAR w/ Fixes

Attached is the re-bundled JAR file containing the Composite Tag Library Changes to be used with Netbeans 8.1.

This JAR file should replace the existing JAR file located here:
enterprise\modules\ext\jsf-2_2\javax.faces.jar

Of course...make a back up just in case.