I have a PDF form with several required fields and script in Validation event. I assigned a task to an user with this form, but noticed a very strange behavior:
When the user clicks in the Card and the task start rendering within Workspace, before the form completes the rendering process he clicks the Complete button, the activity is submitted without validating the form!
How can I prevent that from happening?
Thanks in advance.
I've hidden the Submit button in the form design, but I'm still able to hit the Complete button before it disappears after rendering process.
Hide the submit button (like you did), but then add a regular button that calls the hidden submit button when the validation returns true.
Something like this (from memory):
if(yourvalidation == true)
That way the hidden submit button should only be called when the statement is true.
See if that helps.
I did exactly that, in fact the Complete button hides after the rendering process is finished - as expected. However, right in the begining when it starts rendering, the button is shown and if I click very quickly I'm able to submit the task.
If you wish to make the form's complete button invisible right from the beginning of its rendering in Workspace, you may set presence = "invisible" for the button while designing the form.
I did exactly that, however the Complete button "blinks" very quickly in the beginning of the rendering process. This is enough so the user can press and submit the task.
Any other ideas?
Please make sure your changes in the PDF/XDP are deployed in the application before opening the start task. You may check that by looking at the network trace when opening Workspace. The PDF form fetched by workspace on opening the task should have presence="invisible" (you may open the form saved from network trace in LC designer and check the value).
Thanks for the info, however even though I don't add any Submit buttons in the form I am able to submit the task within Workspace.
I recorded the steps I performed, creating a simple application from scratch. Please check below.
Hope that can help.
Your original problem was for forms having one submit button, that submit button is visible before rendering completes in workspace. I hope that is resolved after setting the button invisible in the form.
As for forms having no submit button, your recording shows that task disappears on closing the form. I verified that this was not the case on a ES2 SP2 livecycle server: https://my.adobeconnect.com/p6gwun6tmlf/
Please share your complete livecycle version and network logs at the time of closing the form. Does the task appear completed in tracking after closing the form?
yep, my original problem was the Complete Button bypass validation. The form may have 1 or N, either direct or indirect submit buttons, or even NOT having submit buttons, when the task is rendered the end-user is able to submit it if he clicks in the lower-right section of the screen (where the submit button is located). You can notice in my recording that the Complete button appears for a few seconds. After the rendering process is finished the Complete button disappears as expected. The problem is the moment before that.
My recording shows that the task disappears because was submitted, not closed. When I check the JBoss server log, I can see:
2013-09-05 09:30:27,071 INFO [com.adobe.livecycle.reviewandcommenting.dsc.impl.ReviewAndCommentingServiceImpl] ALC-CSV-001-000-ON ASYNC EVENT : Asynchronous : TaskCompleted
2013-09-05 09:30:32,066 INFO [com.adobe.livecycle.reviewandcommenting.dsc.impl.ReviewAndCommentingServiceImpl] ALC-CSV-001-000-ON ASYNC EVENT : Asynchronous : TaskCreated
Therefore, it follows the route and the following task is created. Obviously if there is a conditional route based in some data from the form, the process would stall.
It's LiveCycle ES2.5, JBoss and MySql (turnkey version).
Not that's very weird... I've just watched your recording and it doesn't happen.
Perhaps it's related to the Form Bridge placed automatically when creating the XDP?
Or the flash version?
I noticed that your Save button doesn't show either.
For PDF forms, this 'complete' button (or the route buttons) appears if task supports data submission (by reader submit or a unique submit button in Form). Now, submit buttons are determined using FormBridge just after the PDF has loaded. If the submit button is not unique, route buttons are hidden else the button is bound to the 'Complete' button in the bottom bar. The click of the 'Complete' button performs submit button action defined inside form and then completes the task.
If you click on the 'Complete' button before the submit button is bound to the 'Complete' button, it would only complete the task as you observed and validations will be skipped as they are linked to the Form submit button. To avoid this from happening, please wait for form rendering to complete (which would take a few seconds at most).