Second Save Click for Anonymous Users

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Second Save Click for Anonymous Users

Aaron Spike
I added a comment to Issue #1619 (https://github.com/orbeon/orbeon-forms/issues/1619).

When a user without Update permissions (in my case an anonymous user) clicks the Save button a second time they receive a somewhat scary message about a database error. Scary because they may have just spent a significant amount of time filling in my form and don't want to lose data. #1619 suggests that the Save button should be hidden. I don't know how large of an effort that would require. So I'm looking for alternative solutions. I had the idea that if I added an additional control to my form I could use that control to indicate that the form had already been saved. 

Is there any xpath expression to use in the conditional that would not require adding an additional control? 

    <property as="xs:string"  name="oxf.fr.detail.process.save-final.MyApp.MyForm">
        require-uploads
        then validate-all
        then (
          save
          then (
            xf:setvalue(ref = "//form-saved", value = "'true'")
            then success-message("save-success")
          )
          recover if ("//form-saved/text()='true'")
                    then error-message(message = "This form has already been saved. Further modifications are not allowed.")
                    else error-message("database-error")
        )
    </property>

This electronic communication, including any attached documents, may contain confidential and/or legally privileged information that is intended only for use by the recipient(s) named above. If you have received this communication in error, please notify the sender immediately and delete the communication and any attachments. Views expressed by the author do not necessarily represent those of Martin Luther College.

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Second Save Click for Anonymous Users

Alessandro  Vernet
Administrator
Hi Aaron,

If you have this case, wouldn't it make more sense to only have a "send" button, where after saving the data the user is sense to another page? I.e., what would be the point of leaving the user on the current page if she can't update the data she just entered?

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Second Save Click for Anonymous Users

Aaron Spike


On Tuesday, February 10, 2015 at 6:53:47 PM UTC-6, Alessandro Vernet wrote:
Hi Aaron,

If you have this case, wouldn't it make more sense to only have a "send"
button, where after saving the data the user is sense to another page? I.e.,
what would be the point of leaving the user on the current page if she can't
update the data she just entered?

The PDF button can still be invoked after save. If a user forgets to make a PDF for their own records before save they can after. But maybe it is possible to send to the PDF? I'm afraid the process/button docs are still mostly a mystery to me. Is this possible? How? And I would still like to know if there is something testable with xpath that indicates a form has been saved. 


This electronic communication, including any attached documents, may contain confidential and/or legally privileged information that is intended only for use by the recipient(s) named above. If you have received this communication in error, please notify the sender immediately and delete the communication and any attachments. Views expressed by the author do not necessarily represent those of Martin Luther College.

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Second Save Click for Anonymous Users

Alessandro  Vernet
Administrator
Aaron,

True, the PDF button could still be used after save, but I would still not leave the form up on the page after the data has been saved, and without the possibility of saving it again. Maybe you can ask users for their email address, and send the PDF to that email as part of the send process?

About knowing whether the data has been saved, have you tried xxf:instance('fr-persistence-instance')/data-safe, which should be either "true" or "false"?

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet