我想知道是否有办法将所有可能的附加属性定位到给定组件,比如通配符。在以下示例中,我想将所有属性定位到组件btn
。通常,我希望定位所有 JavaScript 属性(onclick、onsubmit 等),并且我不想复制整个属性列表。有没有办法简化它?
<composite:interface>
<composite:attribute name="action" targets="btn" required="false" />
<composite:attribute name="onkeydown" targets="btn" required="false" />
<composite:attribute name="onkeyup" targets="btn" required="false" />
<composite:attribute name="onclick" targets="btn" required="false" />
<!-- Here other attributes with targets="btn" -->
</composite:interface>
<composite:implementation>
<p:commandButton id="btn" />
<!-- additional code (not relevant for the question) -->
</composite:implementation>