1

I try to get a confirmation dialog when i deselect an item from a mutli-select p:selectManyMenu.

<p:outputLabel for="ccs" value="CS" styleClass="toplabel"/>
<p:selectManyMenu id="ccs" value="#{ccView.selectedCSs}"
                  var="cs" filter="true" filterMatchMode="contains" showCheckbox="true">
    <p:ajax event="change" listener="#{ccView.onCSChanged}" />
    <f:selectItems value="#{ccView.CSs}" var="source" itemLabel="#{source.name}" itemValue="#{source}"  /> 
    <p:column>
        <h:outputText value="#{cs.name}" />
    </p:column>
</p:selectManyMenu>

now, if an item is deselected (checkbox change to unchecked) i want to show a confirmation dialog.

<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
    <p:commandButton value="Yes" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
    <p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
</p:confirmDialog>

I tried it with ajax events like "unselect", "deselect", "rowUnselect".. any idea?

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
Kevin Busch
  • 191
  • 1
  • 4
  • 17
  • 1
    Two of the events you listed `unselect` and `deselect` are not supported. You will probably have to live only with the default `valueChange` event. – Tiny Aug 27 '15 at 11:36
  • and i can stop the deselecting inside that event? Because i want to ask the user if he realy want's to deselect. – Kevin Busch Aug 27 '15 at 11:39

0 Answers0