我正在尝试使用这个 jQuery 插件http://www.eyecon.ro/colorpicker/创建一个自定义复合组件 colorPicker 。
我希望能够附加一个 jsf 标签 f:ajax , and when a color is selected, perform an ajax call to the server. 我一直在测试这个功能,看起来一切都是正确的,但显然我错过了一些东西,因为从未调用过监听器。
这是我的组件代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:composite="http://java.sun.com/jsf/composite">
<composite:interface>
<composite:attribute name="label" />
<composite:clientBehavior name="customEvent" event="change" targets="#{cc.clientId}"/>
</composite:interface>
<composite:implementation>
<h:outputStylesheet library="css" name="colorpicker/colorpicker.css" />
<h:outputStylesheet library="css" name="colorpicker/layout.css" />
<h:outputScript library="js" name="colorpicker/jquery.js" target="head"/>
<h:outputScript library="js" name="colorpicker/colorpicker.js" target="head"/>
<h:outputScript library="js" name="colorpicker/eye.js" target="head"/>
<h:outputScript library="js" name="colorpicker/utils.js" target="head"/>
<h:outputScript library="js" name="colorpicker/layout.js" target="head"/>
<h:outputScript library="js" …Run Code Online (Sandbox Code Playgroud) ajax event-handling custom-component composite-component jsf-2