Я пытаюсь добавить ap: подтверждение внутри составной команды commandButton, но выдается следующая ошибка:
<p:confirm> Composite component does not support event null
Когда я переключаюсь на обычный p: commandButton, он работает.
Кроме того, при использовании непосредственно внутри составного commandLink (точно с теми же атрибутами), используя тот же p: verifyDialog (global), он работает.
Пример использования:
<myCompositeSuite:commandButton id="buttonId"
action="#{beanController.action}">
<p:confirm
header="Confirm"
message="Do you confirm this action?"
icon="ui-icon-alert" />
</myCompositeSuite:commandButton>
Составной компонент пример (что я пробовал в комментариях):
<cc:interface name="commandButton">
<cc:attribute name="rendered" default="true" />
<cc:attribute name="value" default="Button" />
<cc:attribute name="title" />
<cc:attribute name="style" />
<cc:attribute name="styleClass" />
<cc:attribute name="disabled" default="false" />
<cc:attribute name="ajax" default="false" />
<cc:attribute name="process" />
<cc:attribute name="onclick" />
<cc:attribute name="action" targets="myCompositeButton" />
<cc:attribute name="immediate" default="false" />
<cc:attribute name="oncomplete" />
<cc:attribute name="update" />
<cc:actionSource name="command" targets="myCompositeButton" />
<cc:clientBehavior name="click" targets="myCompositeButton" event="click" />
<!-- <cc:clientBehavior name="confirm" targets="myCompositeButton" event="null" /> -->
<!-- <cc:clientBehavior name="null" targets="myCompositeButton" event="null" /> -->
</cc:interface>
<cc:implementation>
<p:commandButton id="myCompositeButton"
rendered="#{cc.attrs.rendered}"
value="#{cc.attrs.value}"
title="#{cc.attrs.title}"
immediate="#{cc.attrs.immediate}"
styleClass="#{cc.attrs.styleClass}"
style="#{cc.attrs.style}"
disabled="#{cc.attrs.disabled}"
onclick="#{cc.attrs.onclick};"
oncomplete="#{cc.attrs.oncomplete};"
ajax="#{cc.attrs.ajax}"
process="#{cc.attrs.process}"
update="#{cc.attrs.update}">
<cc:insertChildren />
</p:commandButton>
</cc:implementation>
Я использую JSF версии 2.3 и Primefaces версии 6.2.