2015年11月30日 | Leave a comment 问题: 点组合控件中的按钮会提示 Unable to resolve composite component from using page using EL expression '#{cc.attrs.deleteAction}' 1 Unable to resolve composite component from using page using EL expression '#{cc.attrs.deleteAction}' xhtml中使用 Ele1: <ezcomp:Ele1 value="aaa" index="0" deleteAction="#{index2.removeEle(0)}" /> 1 <ezcomp:Ele1 value="aaa" index="0" deleteAction="#{index2.removeEle(0)}" /> Ele: <?xml version='1.0' encoding='UTF-8' ?> <!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:cc="http://xmlns.jcp.org/jsf/composite" xmlns:h="http://xmlns.jcp.org/jsf/html"> <!-- INTERFACE --> <cc:interface> <cc:attribute name="value" /> <cc:attribute name="index" /> <cc:attribute name="deleteAction" /> </cc:interface> <!-- IMPLEMENTATION --> <cc:implementation> #{cc.attrs.index} <br /> <h:inputText value="#{cc.attrs.value}" /><br /> <h:commandButton action="#{cc.attrs.deleteAction}" value="删除" /> </cc:implementation> </html> 1234567891011121314151617181920 <?xml version='1.0' encoding='UTF-8' ?><!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:cc="http://xmlns.jcp.org/jsf/composite" xmlns:h="http://xmlns.jcp.org/jsf/html"> <!-- INTERFACE --> <cc:interface> <cc:attribute name="value" /> <cc:attribute name="index" /> <cc:attribute name="deleteAction" /> </cc:interface> <!-- IMPLEMENTATION --> <cc:implementation> #{cc.attrs.index} <br /> <h:inputText value="#{cc.attrs.value}" /><br /> <h:commandButton action="#{cc.attrs.deleteAction}" value="删除" /> </cc:implementation></html> 解决: ele1 增加method-signature <cc:attribute name="deleteAction" method-signature="void action(int)" /> 1 <cc:attribute name="deleteAction" method-signature="void action(int)" />