Hi All,
I am trying to implement a confirm/alertbox to check before submitting a form. This button is a Bonita submit button. I have very little knowledge of JS/jquery but can understand and implement through trial and error.
Is there an existing out of the box solution for this ? Or if you have any pointers please let me know.
I have referred this : http://community.bonitasoft.com/groups/usage-operation-5x/resolved-confirmbox-submit-button , but it is for an older version and is not working for me.
The html page looks like this :
…
...
Details of this button class in bonita:
div id="Submit1" class="bonita_form_button_entry"> Submit Documents
I tried this:
This shows a dialog but continues the operation without waiting for my response.
Thank you
1 Like
Hello,
I had the same problems: customizing the confirm just does not work.
However, you can customize the process template and check for a task list. This is rather tricky though because the tasks are added by script and you cannot ensure your scripts runs last! So you have to set a time out on your script.
E.g. my script for automatically running the next user task involves
var delay = 2000;
history.navigationMode = 'compatible';
$(document).ready(function () {setTimeout(function(){ActivateNextTask();}, delay);});
function ActivateNextTask() {
if (window.console) console.log('Checking for presence of user tasks ...');
var taskElement = $('div.bonita_form_task_link');
if (taskElement.length == 0)
{
if (window.console) console.log('No user task found');
}
else
{
if (window.console) console.log('Automatically activating task ' + taskElement.text());
taskElement.click();
}
}
</script>
However this code does not work if the user is returned to this page after a gateway, because the script isn’t rerun.
Using other events (pageshow, load, …) does not work either,and the caching cannot be modified because of how the template injection works …
Anyway, this may help you move ahead
Hi,
One solution could be to implement 2 forms in the same tasks :
- to input data/info
- to confirm the data/info with displayed info in readonly.
User can go back to input form to change information.
Hopefully it helps
regards,
LL
Thank you very much LL. That should definitely be a patch work for now. However I wish there was a one line solution like I am trying. I mean the above feature works in any html but just not in the bonita portal.
Finally, maybe having a look to this chapter in the blog :
How to add custom Javascript in your Bonita BPM Forms
http://community.bonitasoft.com/blog/how-add-custom-javascript-your-bonita-bpm-forms
Good luck for the implementation.
Hi bos2013 . No that was not helpful , I have already gone through that.
I appreciate your help though.