I think this is a bug in the released product.Will need to confirm this, but the way to do this would be very similar to how you would di it 7. In the click event of the submit button, you need to test if AWS_CHOICE.rawValue = "Reject" then perform whatever logic you want to perform. Will post more info on this tomorrow
"Does anyone know if there is a way to trap the button clicked at the form level in LC ES ?"
There is not way to trap which button is clicked from the workspace interface. When the button is clicked, a message is sent to the PDF but it unfortunately doesn't contain which button was clicked. There's already an enhancement request to put that information in there. Hopefully it'll make it to into the next release.
Having said that, they only way to know what action was selected (by the PDF)is by having the user select the action on the PDF and not from the WorkSpace interface. Then when they change the drop down, you can fire some code to check some validation.
If you want to check the logic just before they submit, you'll have to add a regular button and a hidden submit button on your form. The regular button (which will look like the submit button for the user) will check your business logic and if everything is fine, will submit the form by executing the click event of the hidden submit button (hiddenButton.exeEvent("click")).
You can't leverage the presubmit event of the submit button since it'll still submit the form if the validation fail.
So to summarize, you'll need the submit button on the PDF and front it with a regular button to verify your validation before it submits.
sorry it is aws_ACTION.rawValue =="Decline", but this will only work in sp2 release
You're right. I should have mentioned that what I just explained is basically already built with the AWS_* fields from Form Designer.
But you can still built you're own if you want.
Many thanks to you both for the very quick and helpful responses.
We have found a kludge solution by putting a check box on the form to to indicate if they wish to approve or reject (similar to drop down idea) and use the hidden button concept Jasmin describes to validate data accordingly.
However if you do this the two Approve / Reject buttons still show on the wrapper and if the user then clicks the wrong one the workflow routing is then of course wrong for the validations and pre-submit actions that have been done at the form level - and there is no way for us to trap for this error as we can't tell which button was clicked of course :-(
If we only have one 'route' out of the user, and hide the wrapper button, and then have a Decision Point after the user to decide the route of some item in the XPath data e.g. the check box value or AWS_Action, then the Audit Trail (Tracking) does not show if the user approved or rejected the form - which makes the tracking pretty useless for the users :-(
Just an thought / question - if we hide both Wrapper Buttons, then set AWS_Action to say the same value as one of the hidden wrapper buttons, would the AWS_Action selection / value then decide which of the hidden wrapper buttons get activated (e.g. clicked) ?
Failing this does anyone know when the next release is expected and if it will include the enhancement to be able to do this ?
Make sure the "Workspace enable Form" which really is the Insert Form Bridge operation is not in your render service. This way the button won't show up in WorkSpace.
should be in sp2 coming early next year?
I have the same requirement. I have looked at the contents of the
AWS_ACTION and AWS_CHOICE fields, but they are always null. I would
prefer not to have to add my own buttons to the form as fronts to the
real submit buttons.
Is there a way to tell if I have SP2 installed or not? I started by
downloading the trial version from the adobe website. Since I
downloaded it after SP2 was released, I'm assuming I have it.
If you login to Workspace and click Help->About LiveCycle Workspace ES what build number do you see?
Is there any way to know which route is selected when using document forms and version 188.8.131.52? THE AWS_ACTION field seems to contain the route information when submitting as XDP but not PDF. I have to do conditional validation based on which route was selected and it's a critical requirement.