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

Matthias Weßendorf commented on MYFACES-2480:
---------------------------------------------

Ingo,

I know: http://svn.apache.org/viewvc?view=revision&revision=903221
needed a quick fix...

Thanks for the patch, will review it.

> @ResourceDependencies does not work on custom behaviors
> -------------------------------------------------------
>
>                 Key: MYFACES-2480
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2480
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.0.0-alpha
>            Reporter: Matthias Weßendorf
>         Attachments: BehaviorResources.patch
>
>
> I created a simple custom behavior, that requires (more ships :-) ) a simple 
> JS file. On the RI (run-time testing) it works. Not so on myfaces2 trunk
> My class:
> package net.wessendorf;
> import java.util.EnumSet;
> import java.util.Set;
> import javax.faces.application.ResourceDependencies;
> import javax.faces.application.ResourceDependency;
> import javax.faces.component.behavior.ClientBehaviorBase;
> import javax.faces.component.behavior.ClientBehaviorContext;
> import javax.faces.component.behavior.ClientBehaviorHint;
> import javax.faces.component.behavior.FacesBehavior;
> @FacesBehavior("net.wessendorf.Confirm")
> @ResourceDependencies({
>   @ResourceDependency(name="tester.js", library="wessi", target="head")
> })
> public class TestConfirmBehavior extends ClientBehaviorBase
> {
>   @Override
>   public String getScript(ClientBehaviorContext behaviorContext)
>   {
>     return "return confirm('Really')";
>   }
>   
>   @Override
>   public Set<ClientBehaviorHint> getHints() {
>       return EnumSet.of(ClientBehaviorHint.SUBMITTING);
>   }
> }
> taglib.xml file:
> <facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee";
>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
> http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd";
>    version="2.0">
>   <namespace>http://wessendorf.net/behavior</namespace>   
>   <tag>
>     <tag-name>confirm</tag-name>
>     <behavior>
>       <behavior-id>net.wessendorf.Confirm</behavior-id>
>     </behavior>
>   </tag>
> </facelet-taglib>
> tester.js file:
> test = function()
> {
>   alert('HALLO JSF2');
> }

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

Reply via email to