Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to pass a parameter via `confirmDialog`?
    primarykey
    data
    text
    <p>I used to use javascript confirmation box, and would like to switch to PrimeFaces <code>&lt;p:confirmDialog&gt;</code>. </p> <p>This is how it works now:</p> <pre><code>&lt;p:commandLink id="deleteFGLinkId" action="#FilterPresetGroupMgmtBean.delete}" onclick="if( !confirm('Preset Group will be removed. Are you sure you want to continue?') ){return false;}" onstart="bui.show();" oncomplete="bui.hide();" update=":pmForm:filterPresetTable :pmForm:messagePanel"&gt; &lt;f:param value="#{item.value.ID}" name="deleteID"&gt;&lt;/f:param&gt; &lt;h:graphicImage alt="Delete Image" style="border: none" value="./images/x.png"/&gt; &lt;/p:commandLink&gt; </code></pre> <p>How would I pass a <code>deleteID</code> parameter in case I use <code>confirmDialog</code>? This doesn't work:</p> <pre><code>&lt;p:commandLink onclick="confirmPGDeletePopup.show()"&gt; &lt;f:param value="#{item.value.ID}" name="deleteID"&gt;&lt;/f:param&gt; &lt;h:graphicImage alt="Delete Image" style="border: none" value="./images/x.png"/&gt; &lt;/p:commandLink&gt; </code></pre> <p>I also tried putting <code>&lt;f:param&gt;</code> into confirmation dialog OK button, but that didn't work too. Here is the dialog:</p> <pre><code>&lt;p:confirmDialog widgetVar="confirmPGDeletePopup" header="Confirm delete" message="Preset Group will be removed. Are you sure you want to continue?" severity="alert"&gt; &lt;p:commandButton id="confirm" value="Yes" oncomplete="confirmPGDeletePopup.hide()" action="#{PresetGroupMgmtBean.delete}" update=":pmForm:presetPanel :pmForm:messagePanel"/&gt; &lt;p:commandButton id="decline" value="No" onclick="confirmPGDeletePopup.hide()" type="button" /&gt; &lt;/p:confirmDialog&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload