[richfaces-issues] [JBoss JIRA] (RF-13162) Add support for the default-behavior faces-config property-extension to the CDK @Attribute annotation

Brian Leathem (JIRA) jira-events at lists.jboss.org
Tue Sep 3 14:14:03 EDT 2013


    [ https://issues.jboss.org/browse/RF-13162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801288#comment-12801288 ] 

Brian Leathem commented on RF-13162:
------------------------------------

There is some confusion about the overlap of the _<cdk:event-name default="true">_ element, the _<default-behavior>_, and the _[ClientBehaviorHolder.html#getDefaultEventName()|https://github.com/richfaces/richfaces-cdk/blob/master/annotations/src/main/java/org/richfaces/cdk/annotations/Attribute.java#L146]_.

Some insight can be gained by comparing the CDK property definition above (from this issue's description) with this one for the [command-button-props.xml|https://github.com/jboss/mojarra/blob/2.1.21-jbossorg-1/jsf-api/doc/command-button-props.xml#L75] configuration from the Mojarra project:
{code}
    <property>
        <description>
          Javascript code executed when a pointer button is
          clicked over this element.
        </description>
        <display-name>Button Click Script</display-name>
        <icon></icon>
        <property-name>onclick</property-name>
        <property-class>java.lang.String</property-class>
        <property-extension>
            <pass-through>false</pass-through>
            <behavior/>
            <behavior>action</behavior>
            <default-behavior>true</default-behavior>
        </property-extension>
    </property>
{code}

Here the _<default-behavior>true<default-behavior>_ element makes sense, as it is accompanied by the _<behavior>action</behavior>_ element identifying which behavior is the default.  Contrast this with the CDK configuration where the _<default-behavior>_ element does not have an accompanying _<behavior>_ element. What purpose does the _<default-behavior>true</default-behavior>_ element serve in the CDK faces-config snippet?

In a conversation with [~edburns] in IRC, he suggested that the _<default-behavior>_ faces-config.xml property configuration is present for consumption by tooling.

So it would seem that a better resolution of this issue would be for the CDK _ at Attribute_ annotation to use the existing [events attribute + default|https://github.com/richfaces/richfaces-cdk/blob/master/annotations/src/main/java/org/richfaces/cdk/annotations/Attribute.java#L146] property to render the appropriate _<behavior>_ and _<default-behavior>_ elements.
                
> Add support for the default-behavior faces-config property-extension to the CDK @Attribute annotation
> -----------------------------------------------------------------------------------------------------
>
>                 Key: RF-13162
>                 URL: https://issues.jboss.org/browse/RF-13162
>             Project: RichFaces
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>          Components: cdk
>            Reporter: Brian Leathem
>            Assignee: Brian Leathem
>             Fix For: cdk-4.5.0.Alpha2
>
>
> Consider the xml component property definition:
> {code:title=From command-button-props.xml}
>     <property>
>         <description>
>             Javascript code executed when a pointer button is clicked over this element.
>         </description>
>         <display-name>Button Click Script</display-name>
>         <icon />
>         <property-name>onclick</property-name>
>         <property-class>java.lang.String</property-class>
>         <property-extension>
>             <cdk:pass-through>false</cdk:pass-through>
>             <cdk:event-name default="true">click</cdk:event-name>
>             <cdk:event-name>action</cdk:event-name>
>             <default-behavior>true</default-behavior>
>         </property-extension>
>     </property>
> {code}
> There is currently no way to define this using the CDK @Attribute annotation - the _<default-behavior>_ annotation property is absent.
> To resolve this issue (blocking RF-12952) we need to add support for specifying the _default-behavior_ to the @Attribute annotation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the richfaces-issues mailing list