If you want to use a method binding this way, you have to create a method binding as parameter for the custom control:
<xc:ccMethod>
<xc:this.codessjs>
<![CDATA[#{javascript:
var app = facesContext.getApplication();
app.createMethodBinding("#{javascript:print('HELLO!');}", null);
}]]>
</xc:this.codessjs>
</xc:ccMethod>
Then, your button inside the custom control is able to invoke the method.
In this case, the button will print HELLO! to the server console.
EDIT:
The type of the CSJS property is string. To execute CSJS code you can modify your button in your custom control to something like this:
<xp:button value="Label" id="button1">
<xp:eventHandler event="onclick" submit="false">
<xp:this.script><![CDATA[#{javascript:compositeData.codecsjs}]]></xp:this.script>
</xp:eventHandler>
</xp:button>
In your XPage, the custom control property can be filled this way:
<xc:ccCSJS>
<xc:this.codecsjs>
<![CDATA[alert("ABC");]]>
</xc:this.codecsjs>
</xc:ccCSJS>
Hope this helps
Sven
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…