[richfaces-issues] [JBoss JIRA] (RF-12247) CDK: short-cuts for repetitious expressions

Lukáš Fryč (JIRA) jira-events at lists.jboss.org
Wed May 16 11:27:18 EDT 2012


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

Lukáš Fryč edited comment on RF-12247 at 5/16/12 11:25 AM:
-----------------------------------------------------------

Adding syntactic sugar is unnecessary right now, {{RenderKitUtils}} can be extened instead.

Let's revisite in the future.

----

There are two other solution then extending {{RenderKitUtils}}:

* adding stateful auxiliary object which would carry {{facesContext}} and {{component}} references to, e.g.: {{renderingContext}} or {{componentContext}}
* using auxiliary tags, like in case of {{<cdk:renderFacet proposal />}} RF-12260 (but it brings some issues as commented there)
                
      was (Author: lfryc):
    adding syntactic sugar is unnecessary right now, RenderKitUtils can be extened instead
                  
> CDK: short-cuts for repetitious expressions
> -------------------------------------------
>
>                 Key: RF-12247
>                 URL: https://issues.jboss.org/browse/RF-12247
>             Project: RichFaces
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>          Components: cdk
>    Affects Versions: 4.2.0.Final
>            Reporter: Paul Dijou
>
> h3. 1) Test if an attribute is present :
> {code:xml}
> <c:when test="#{component.attributes['brand']!= null and not component.attributes['brand'].equals('')}">
> {code}
> Can become :
> {code:xml}
> <c:when test="#{component.hasAttribute('brand')}">
> {code}
> {code:java}
> public boolean hasAttribute(String attributeName) {
>     // TODO : test if the attribute is present
> }
> {code}
> h3. 2) Test if a facet is present
> Same as before but about JSF facets
> {code:xml}
> <c:when test="#{component.getFacet('brand') != null and component.getFacet('brand').rendered}">
> {code}
> Become
> {code:xml}
> <c:when test="#{component.hasFacet('brand')}">
> {code}
> {code:java}
> public boolean hasFacet(String facetName) {
>     // TODO : test if the facet is present and rendered
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the richfaces-issues mailing list