"edit" in a button process and autosave

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

"edit" in a button process and autosave

bwallis42
I have an edit button on my form views to edit the form, defined like so.

    <property as="xs:string" name="oxf.fr.resource.cpf.*.en.buttons.edit" value="Edit" />
    <property as="xs:string" name="oxf.fr.detail.buttons.view.cpf.*" value="edit" />
    <property as="xs:string" name="oxf.fr.detail.process.edit.cpf.*">
        edit
    </property>

So, to view the form I go to

http://localhost:8080/orbeon/fr/cpf/fredd/view/2015061136

When I click on the edit button the form is switched to edit mode. But, if after making some changes and seeing (in the logging) that a draft has been auto saved, I reload the view URL and then click my edit button again I am not prompted to use the autosaved draft.

If I go directly to the edit url

http://localhost:8080/orbeon/fr/cpf/fredd/edit/2015061136

then I am prompted to select the saved or draft version for editing.

Shouldn't I be prompted to select which version to edit in the edit button case?

thanks

Reply | Threaded
Open this post in threaded view
|

Re: "edit" in a button process and autosave

Alessandro  Vernet
Administrator
Hi Brian,

Are you saying that if you make and edit, wait for the autosave, click on the review button, then click on the edit button, you'd expect to be asked which version you want to edit?

When you go back and forth between the edit and view this way, data isn't reloaded from the database. In fact if autosave was off, the data could have never been saved, so asking which version to load wouldn't make sense. Or am I misunderstanding your question?

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

Re: "edit" in a button process and autosave

bwallis42
Alessandro Vernet wrote
Are you saying that if you make and edit, wait for the autosave, click on the review button, then click on the edit button, you'd expect to be asked which version you want to edit?

No, the scenario is that I view the form, click the edit button and make some changes (don't save them), wait to see that the autosave has happened and then navigate to some other page (clicking on "Leave Page" when prompted) or even exit the browser simulating a crash or disconnection.

Then I go back to viewing the form, it shows the original unchanged version as it should. I then click on the edit button and despite there being an autosaved version it doesn't tell me about it and puts me into the editor with the old data. This effectively looses the draft version. I can see that when I click on the edit button it doesn't even check with a search whether or not there are any draft versions.

brian...
Reply | Threaded
Open this post in threaded view
|

Re: "edit" in a button process and autosave

Alessandro  Vernet
Administrator
Brian, got it! That's a tricky one. As you suggest, it's not unreasonable to expect that you get the "manually-saved" data when going to the view page, but then get asked what data you want when you go back to the edit page. We'll have to give some thought to this one, and I'll then post a follow-up here.

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

Re: "edit" in a button process and autosave

Alessandro  Vernet
Administrator
Brian,

We gave some thought to this one, and should do what you suggested. For now, I've created this RFE:
https://github.com/orbeon/orbeon-forms/issues/2266

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