Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

nuHasBeenSaved() Topic is solved

Questions related to using nuBuilder Forte.
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: nuHasBeenSaved()

Unread post by admin »

toms

Its commit b8e0602943fa1778cb2cf047ff96c878b1272c7d.

Steven
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: nuHasBeenSaved()

Unread post 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;
}
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: nuHasBeenSaved()

Unread post 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
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: nuHasBeenSaved()

Unread post 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
You do not have the required permissions to view the files attached to this post.
Last edited by Anonymous on Wed Aug 29, 2018 9:02 pm, edited 8 times in total.
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: nuHasBeenSaved()

Unread post 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)
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: nuHasBeenSaved()

Unread post 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
You do not have the required permissions to view the files attached to this post.
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: nuHasBeenSaved()

Unread post by admin »

toms,

I believe its fixed now.

Steven
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: nuHasBeenSaved()

Unread post 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)
marc
Posts: 92
Joined: Mon May 14, 2018 3:26 pm

Re: nuHasBeenSaved()

Unread post 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
Post Reply