recently we needed to add confirmation dialogs on some of the user events of our Icefaces application. Luckily, since version 1.8, Icefaces comes with a new component called PanelConfirmation which does the job pretty well and easy.
As I could not find any straight example I decided to write here a little code snippet.
To define the confirmation panel in the very page you need to write the following:
<ice:panelConfirmation id="confirmDeletion"
acceptLabel="OK"
cancelLabel="Cancel"
message="You are about to delete. Are you sure?"
title="Confirm delete"
draggable="false"
/>
Now you need to bind the dialog with the actions you want to confirm. To do so there is a new property in commandButton and commandLink components. Note the id in the above declaration, it is important to further bind the component. As usual, you will need this id to be unique in the scope.
<ice:commandButton actionListener="#{myActionListener}" value="Remove" panelConfirmation="confirmDeletion" />
In the panelConfirmation property you need to put the id of the dialog.
Regrettably there is still not support for this on the rest of the components that trigger user events, such us menuItems. I don't know if this is coming next or there is any implementation reason that prevents the rest of the components to bind to confirmation dialogs.
I still haven't checked whether you can change the dialog properties binding it to it's Java component when the action fires, as it is delayed until the user accepts in the very panel, nor if the dialog properties can be calculated values as in the rest of the components.
In theory you can define the panel anyway in the application as far as it is defined in the context with the proper id.
Hope this helps!