Please show the code.

On Wednesday, March 27, 2019 at 6:40:26 AM UTC-4, João Matos wrote:
>
> I have a SQLFORM.factory where I edit a record from a grid (the record is 
> selected in the grid and the user presses a button created with the grid's 
> selectable).
> At the start of the edit function I read the record in question from the 
> database to fill the SQLFORM.factory fields.
> If the user tries to save the record and the record was changed while he 
> was editing, I show a form.errors message.
> At this point I have 2 options:
> 1. The user is informed to press F5 to see the changes. This is great to 
> view the changes but if the user tries to save the record, and because the 
> db record is read at the start of the edit function, my function was 
> "thinks" the record has been changed while editing and doesn't allows him 
> to save. This is because I'm comparing the current db record modified_on 
> with the original (grid's row) modified_on.
> 2. The user is informed to go back to grid and re-select the record to see 
> the changes and continue editing. This works but is a bad user experience.
>
> What I would like is to differentiate between an F5 page refresh and a 
> form check (call back).
>
>
> quarta-feira, 27 de Março de 2019 às 02:21:07 UTC, Anthony escreveu:
>>
>> What are you really trying to do?
>>
>> On Tuesday, March 26, 2019 at 5:55:50 PM UTC-4, João Matos wrote:
>>>
>>> Is there a way to differentiate between a form refresh (F5) and a submit 
>>> that calls back the form?
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to