Open eclipse-faces-bot opened 11 years ago
@glassfishrobot Commented Reported by kennardconsulting
@glassfishrobot Commented kennardconsulting said: The MyFaces team have indicated this may be a bug in the spec:
"the reason it does not work is because javax.faces.component.behavior.AjaxBehavior does not have @ResourceDependency attached" https://issues.apache.org/jira/browse/MYFACES-3610
Could you please discuss?
@glassfishrobot Commented kennardconsulting said: I checked javax.faces.component.behavior.AjaxBehaviour.java in the latest 2.2 snapshot...
...and it doesn't appear to be annotated there either?
@glassfishrobot Commented @edburns said: Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.
@glassfishrobot Commented This issue was imported from java.net JIRA JAVASERVERFACES_SPEC_PUBLIC-1162
If I dynamically create UIComponents using the new Application.createComponent( context, componentType, rendererType ), 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( id ), 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.
Also logged as https://issues.apache.org/jira/browse/MYFACES-3610 (but got no response, so I'm trying it as a spec issue)
Environment
Both Mojarra and MyFaces 2.1.x implementations behave the same
Affected Versions
[2.1]