Page 2 of 2

Re: nuHasBeenSaved()

Posted: Tue Aug 28, 2018 11:27 pm
by admin
toms

Its commit b8e0602943fa1778cb2cf047ff96c878b1272c7d.

Steven

Re: nuHasBeenSaved()

Posted: Tue Aug 28, 2018 11:35 pm
by toms
Steven,

I've seen that commit. But the changed nuHasBeenSaved() is not included in the latest commit anymore.

Also, this did not work for me either. I've tested it several times.
if(nuIsNewRecord()){
window.nuTimesSaved = 0;
}

Re: nuHasBeenSaved()

Posted: Wed Aug 29, 2018 12:58 am
by admin
toms,

What can I say, it works for me.

If it doesn't for you, make one yourself that does what you want.

Steven

Re: nuHasBeenSaved()

Posted: Wed Aug 29, 2018 4:20 am
by toms
Steven,

I've made a quick video to demonstrate the problem, as it's easier to show what I mean (with a brand new installation of nuBuilder Forte using the latest from Github, commit 13bf7ee2b4f0185923ba526e2980f56b1775efdc):

In addition, I run some tests with 2 other nuBuilder instances with Linux/Windows, MySQL/MariaDB.
All show the same results.

In the First Video:, I do the following steps:

1. Open a browse form: nuHasBeenSaved() returns -1 (correct!)
2. Add a new record
3. nuHasBeenSaved() returns 0 (correct!)
4. Refresh the record
5. nuHasBeenSaved() returns 1 (wrong!)
6. Refresh the record
7. nuHasBeenSaved() returns 0 (correct again!)
8. Refresh the record
9. 5. nuHasBeenSaved() returns 1 (wrong again!)


And this video shows what happens with the variable window.nuTimesSaved (console view):
debug.JPG

Re: nuHasBeenSaved()

Posted: Wed Aug 29, 2018 4:35 am
by toms
And here comes the 2nd video:

The form uses PHP AS nuReturnNewRecord()

1. Add a new record
2. Save
3. nuHasBeenSaved() returns 1 instead of 0 (because nuReturnNewRecord() has opened a new record)
4. Save again
5. nuHasBeenSaved() returns 2 instead of 0 (because nuReturnNewRecord() has opened a new record)

Re: nuHasBeenSaved()

Posted: Wed Aug 29, 2018 8:22 am
by toms
admin wrote:toms

Its commit b8e0602943fa1778cb2cf047ff96c878b1272c7d.

Steven
With commit b8e0602943fa1778cb2cf047ff96c878b1272c7d nuHasBeenSaved() looked like this
c1.JPG
A few days later, with commit 339abd815844fd394ae36fb8582c68f462e25c55, nuHasBeenSaved() looks now like this (again)
nuHasBeenSaved2.png

Re: nuHasBeenSaved()

Posted: Wed Aug 29, 2018 10:03 pm
by admin
toms,

I believe its fixed now.

Steven

Re: nuHasBeenSaved()

Posted: Thu Aug 30, 2018 6:58 am
by toms
Steven,

I pulled the latest commit (d2a29084e3e27377c2e02a99d2ade5c5fdb73188) and run update. There are no changes where window.nuTimesSaved() / nuHasBeenSaved() is used.

I do the following steps (Video)

1. Open a browse form: nuHasBeenSaved() returns -1 (correct!)
2. Add a new record
3. nuHasBeenSaved() returns 0 (correct!)
4. Refresh the record
5. nuHasBeenSaved() returns 1 (wrong!)
6. Refresh the record
7. nuHasBeenSaved() returns 0 (correct again!)
8. Refresh the record
9. 5. nuHasBeenSaved() returns 1 (wrong again!)

And this video shows what happens with the variable window.nuTimesSaved (console view)

Re: nuHasBeenSaved()

Posted: Wed Oct 31, 2018 6:33 am
by marc
toms wrote:Steven,

I pulled the latest commit (d2a29084e3e27377c2e02a99d2ade5c5fdb73188) and run update. There are no changes where window.nuTimesSaved() / nuHasBeenSaved() is used.

I do the following steps (Video)

1. Open a browse form: nuHasBeenSaved() returns -1 (correct!)
2. Add a new record
3. nuHasBeenSaved() returns 0 (correct!)
4. Refresh the record
5. nuHasBeenSaved() returns 1 (wrong!)
6. Refresh the record
7. nuHasBeenSaved() returns 0 (correct again!)
8. Refresh the record
9. 5. nuHasBeenSaved() returns 1 (wrong again!)

And this video shows what happens with the variable window.nuTimesSaved (console view)
Same issue here