cancel
Showing results for 
Search instead for 
Did you mean: 

How to assign a confirmation dialog to workflow button

rudyanto
Champ in-the-making
Champ in-the-making
I need to assign a confirmation dialog to every button clicked in a workflow node. The purpose is anticipating misclicking (click a wrong button). Can anyone show the way?

I just need to show "Are you sure?" and show YES button and NO button. The dialog show up when users click a workflow button.
2 REPLIES 2

ganeshkolhe
Champ in-the-making
Champ in-the-making
Hi,
If your transition name in Process definition is like below.

<transition name="Edit" to="end" />


You can have alert in Javascript as below

<script type="text/javascript">
function load()
{
    var allInputs=document.getElementsByTagName("input");
    for (var ind=0;ind<allInputs.length;ind++)
                {
                        if(allInputs[ind].value=="Edit")
                        {
                                allInputs[ind].onclick = openToEdit;   //register the function for onclick
                        }
                }
}

function openToEdit()
{
   var answer = confirm("Your are going to edit the workflow Are you sure?");
   if(answer==false)
   {
       //do your action
    }else{
            //do your action
        }
}
</script>
<script type="text/javascript">
window.onload = load;
</script>

If you find this post useful to you please do click post rating comment ->>>>

georgosn
Champ in-the-making
Champ in-the-making
I guess the question is, where do you put this CLIENT SIDE javascript? you surely can't use it in the JBPM workflow (it would have to be server side). So where does it go?