You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2013/02/07 04:03:12 UTC

[jira] [Comment Edited] (MYFACES-3610) Dynamically created ClientBehaviors do not call addComponentResource

    [ https://issues.apache.org/jira/browse/MYFACES-3610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13573129#comment-13573129 ] 

Leonardo Uribe edited comment on MYFACES-3610 at 2/7/13 3:01 AM:
-----------------------------------------------------------------

Hi Richard

Yes, any change in that part must be done at spec level, because once the spec is out, we can't do any changes without break binary compatibility.

The code in place in Application.createBehavior() works just like the one in createComponent(), so if the @ResourceDependency annotation is there, it should work.

regards,

Leonardo
                
      was (Author: lu4242):
    Hi Richard

Yes, any change in that part must be done at spec level, because once the spec is out, we can't do any changes without break binary compatibility.

regards,

Leonardo
                  
> Dynamically created ClientBehaviors do not call addComponentResource
> --------------------------------------------------------------------
>
>                 Key: MYFACES-3610
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3610
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.1.7
>            Reporter: Kennard Consulting
>         Attachments: DynamicBehaviourTest.zip
>
>
> I'm creating this as a JIRA issue so that I can attach a test case. However it behaves the same on Mojarra as on MyFaces so possibly it is 'by design'?
> My question is this:
> * If I dynamically create UIComponents using Application.createComponent, I find they automatically add any dependent resources (JS/CSS) to the h:head. This is fantastic.
> * If I dynamically create ClientBehaviours using Application.createBehavior, no dependent resources get added.
> Am I supposed to add such resources manually? For example:
>    UIOutput js = new UIOutput();
>    js.setRendererType("javax.faces.resource.Script");
>    js.getAttributes().put("library", "mylibrary");
>    js.getAttributes().put("name", "bar.js");
>    FacesContext context = FacesContext.getCurrentInstance();
>    context.getViewRoot().addComponentResource(context, js, "head");
> If so, how am I supposed to know what they are? For example, if I am dynamically adding an AjaxBehavior the exact name of the JavaScript file depends on which JSF implementation I am using.

--
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