I've been testing out the Perspective form component and it seems that the formContext, sessionContext and timestamp properties are missing from the event object.
onSubmitActionPerformed returns just the form data dictionary and onCancelActionPerformed returns an empty object.
Hi Amy.
onSubmitActionPerformed
and onCancelActionPerformed
are component events that—if configured—are triggered when the form’s submit or cancel action is activated. The action event includes the form data object, so it’s expected that properties like formContext
, sessionContext
, and timestamp
are not included in the event object. This could be a feature request to add those properties to those events.
Could you please share the configuration you have for onCancelActionPerformed
? I’d like to replicate the scenario where it returns an empty object.
For reference: A form submission event is an object containing properties such as the data
, formContext
, and sessionContext
. This is located under Perspective/Gateway Events.
2 Likes
That's not clear from the
documentation, which lists those properties under the onSubmitActionPerformed and onCancelActionPerformed events.
I tested with onCancelActionPerformed the same way that I tested onSubmitActionPerformed - I passed the event object to a custom property on the view.
1 Like
This is a bug. Having only the form data, none of the user data, utterly cripples form processing.
Thank you so much for bringing this to our attention. An internal ticket has now been created to add these properties to the event
object for onSubmitActionPerformed
and onCancelActionPerformed
.
1 Like
The description in the manual is a mistake, as we only intended to provide the form data object, and not what constitutes an entire form submission event. It's easy enough to create these additional properties, if you really need them in an onSubmitActionPerformed script. Unless I'm missing something obvious, to say that it "utterly cripples form processing" is misleading.
We can certainly consider adding these properties, but why not use the form submission event handler (fireSubmissionEvent) for form processing? Is it because you need access to properties of the page?
1 Like
I haven't fleshed out this control yet. I see this in the documentation:
I also see this fireSubmissionEvent property that defaults to false
From that I think I need to point the "submissionHandler" property to a method call but I'm not sure where that lives.
I tried adding a message handler on the control and referencing it in the "submissionEventHandler" property but that didn't work. I know it's doing something because it's flicking a "submission failed" error message in the upper right corner of my browser.
What am I doing wrong?
Form submissions are intended to be handled by the Form Submission gateway event type, because form submissions have to be able to live 'outside' the component to support offline mode.
My educated guess is that submissionHandler
should point to the name of the 'Form Submission' event handler you create separately.
1 Like
That worked. Not sure if it's supposed to be spamming the message but it is.
This
Yielded this
I see the response information displays on the "form submitted popup". Nice.
Oops. That's what I was thinking of.
I figured this out.
I had an "onSubmitActionPerformed" event running this code:
self.getSibling("Form").submit(preventInvalid=True)
I then checked the property "submit.fireSubmissionEvent" and had it run a form submission.
The end result is it endlessly executes the form submission. The solution was to take out the "onSubmitActionPerformed" code because that event was endlessly causing it to trigger the form submission event.
1 Like