I have an XPage that saves a data source via two links: “Save as Draft” and “Submit”.
So far I have found it impossible to dynamically turn on server-side validation when the user clicks the Submit link.
This thread touches on something similar but there does not appear to be an actual solution in place: http://www-10.lotus.com/ldd/nd85forum.nsf/5f27803bba85d8e285256bf10054620d/6c3642fe8dce60e1852575530042ebb7?OpenDocument
Anybody out there manage to successfully use server-side validation with an XPage so that fields are only required when the user clicks the “Submit” and fields are not required when the user clicks “Save as Draft”?
Subject: We’re investigating this…
And a solution maybe found in using the afterRestoreView event as this may be needed because both actions you’re doing are submit events to the server to save data. The afterRestoreView event happens just before validation is done.
Subject: Thanks…just got back to this
Paul,
Thanks. I just remembered I posted this. Heads down in a new XPage app. Based on the current inconsistencies, which I know will be worked out over time, I am now doing client-side validation via JQuery in the client script event of the Submit button before running the JavaScript on the server for all of my XPages but I will explore using that event.
Subject: this is very interesting…
… as today I tried to find some detailed info regarding those 5 XPage events. Unfortunately Designer help doesn’t really go into detail here.
The afterRestoreView event happens just before validation is done.
Just to get it right, this means, “after submitted data arrived at the server and before the server started validating them according to what’s defined in the XPage”?
Then: what about the “*RenderResponse” twin events? What’s the meaning of “Response” in this context? Help plainly states “After/Before a response is rendered”.
To start with a stupid beginner’s question:
is this “Response” as in “Response from server after something has been submitted” or is it rather “Response” as in “Response Document”?
Another on is in the datasource events:
is “computeDocument” similar to “QueryRecalc” in LotusScript? Or rather some kind of “PostRecalc”? Or am I completely wrong here?
As always, I’m counting on your patience…
-Lothar