Description
When two client behaviors are provided and one uses default event while second has event provided
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
xmlns:fryc="http://fryc.eu/behavior">
<h:body>
<h:inputText>
<f:ajax event="change" />
<fryc:behavior1 />
</h:inputText>
</h:body>
</html>
these scripts are chained wrong:
<input id="j_id_3" name="j_id_3" type="text" value="" onchange="jsf.util.chain(document.getElementById('j_id_3'), event,'jsf.ajax.request(\'j_id_3\',event,
{\'javax.faces.behavior.event\':\'change\'})''alert(\'xyz\')'); return false;" />
Note there is no space between quotes before alert: ...''alert(\'xyz\')'); return false;" />
-------------------------
There is source code for additional behavior:
@FacesBehavior("eu.fryc.Behavior1")
public class Behavior1 extends ClientBehaviorBase {
@Override
public String getScript(ClientBehaviorContext behaviorContext)
}
<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://fryc.eu/behavior</namespace>
<tag>
<tag-name>behavior1</tag-name>
<behavior>
<behavior-id>eu.fryc.Behavior1</behavior-id>
</behavior>
</tag>
</facelet-taglib>
-------------------------
Note that if you provide events explicitly for both behaviors (or not provide events at all), chaining works as expected.