Primefaces : Confirmation dialog with javascript

It works in the situation that you want to ask something for user before really do it. For example, we can think about the situation when the user will delete all clients. It’s better ask him before do that, like as “Are you sure?”.

<h:commandLink onclick="if (! confirm('Are you sure?)) return false"
    <i class="glyphicon glyphicon-check"></i> Remove All Clients

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s