myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe (JIRA)" <>
Subject [jira] Commented: (TOMAHAWK-1472) Add Support for new Resource API in tomahawk 2.0 module
Date Thu, 18 Feb 2010 22:16:27 GMT


Leonardo Uribe commented on TOMAHAWK-1472:

Trying to do this issue I found the following use case (all this snippets happens on renderers)

        if( tabbedPane.isClientSide() ){
                addResource.addJavaScriptAtPosition(facesContext, AddResource.HEADER_BEGIN,
HtmlTabbedPaneRenderer.class, "dynamicTabs.js");

This one is similar:

        if (schedule.isTooltip())
            addResource.addJavaScriptAtPosition(context, AddResource.HEADER_BEGIN,
                    HtmlSchedule.class, "javascript/alphaAPI.js");

Or this one:

        if (DEFAULT_THEME.equals(theme) || OUTLOOK_THEME.equals(theme)
                || EVOLUTION_THEME.equals(theme))
            addResource.addStyleSheet(context, AddResource.HEADER_BEGIN,
                    HtmlSchedule.class, CSS_RESOURCE);

The new JSF 2.0 Resource Api does not support conditional rendering for resources out of the
box. To solve this one, we need the resource has a reference or a way to find the owner resource
and check this condition when it is rendered. That means we need a custom resource renderer
that check the condition.

Note the condition originally is evaluated each time on render response time, but the new
JSF 2.0 Resource Api requires all resources were added before that. We don't have an event
that gives the chance to register it before render response.

Other option is copy the value or ValueExpression required in the condition on the resource
component, but this does not look good.

We have to try another alternative (a custom component event?), but it is not still clear
how to do that.

> Add Support for new Resource API in tomahawk 2.0 module
> -------------------------------------------------------
>                 Key: TOMAHAWK-1472
>                 URL:
>             Project: MyFaces Tomahawk
>          Issue Type: Task
>            Reporter: Leonardo Uribe

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message