NetTalk Central

Author Topic: Refresh whole Browse after Server Code Runs  (Read 4117 times)

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Refresh whole Browse after Server Code Runs
« on: September 17, 2012, 05:26:19 AM »
Hi all,

I've noticed something odd.

I have a Browse that calls a pop-up Memory Form and on this Form I have conditions which will result in the data either being modified, changed, etc. Upon returning on 'Save' I have the 'Refresh the whole Browse after Server Code Runs' tick box on.

Problem is,

(a) when I was testing this "slowly" behaviour was as expected. When I try it like a typical user would do, ie running, one item after the other in "fast" mode.
It seems as if the "Browse" has not refreshed yet by the time I press the Action button (on the Browse row),
resulting in the wrong RowID being sent to the server mucking things up.

or (b) When I press the Button without selecting the row it contains the wrong RowID. The button is an 'Other' Button on the Browse Row that include RowID. I checked the box send new value to server but I do not have any code in there.

or (c) a combination of the above

Please, how can I solve this?

Thanks a lot.
Charl

c8.8973 and NT6.38
« Last Edit: September 17, 2012, 06:36:24 AM by charl99 »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Refresh whole Browse after Server Code Runs
« Reply #1 on: September 17, 2012, 10:40:49 PM »
>> Please, how can I solve this?

grab the latest release.

cheers
Bruce

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Refresh whole Browse after Server Code Runs
« Reply #2 on: September 18, 2012, 02:56:12 AM »
Hi Bruce,

Maybe it is the way I do it or the data is too much on that Browse (something I can do little about).

The behaviour is much better, but I still manage to 'break' it.

I've pin-pointed the problem to the RowID field, which if I quickly go and tap the Other Button on another row has a Value of 0 (which should be impossible).  Is there a way to override this that the button will not fire if the unique unchanging value is 0?

Thanks
Charl

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Refresh whole Browse after Server Code Runs
« Reply #3 on: September 18, 2012, 04:56:46 AM »
do you see the button disable a bit after the form completes, then get re-enabled?

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Refresh whole Browse after Server Code Runs
« Reply #4 on: September 18, 2012, 05:52:32 AM »
Nope, it appears to be instantaneous.  I do exactly the following:

a) Call the Pop-Up Memory Form with Other Button in Row, Include RowID, (No Action. I tried Change but it doesn't work either and it stuff me around in the Form)
b) In PreUpdate Routine-End, I get all related files, FileToSQ, etc and decide what options are available on the Mem Form
c) In the Validate All, I decide whether to Delete, Insert or Change record. I tried to set _ans_ here as per recent post I saw, eg
ans = net:DeleteRecord but no effect

So I do not have anything in the ValidateUpdate Routines, if that is potentially a problem?

Thanks


 

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Refresh whole Browse after Server Code Runs
« Reply #5 on: September 18, 2012, 07:41:06 AM »
I think you will probably need to post a small example of your setup - as far as I can tell you have a whole bunch of procedures in play here, so the setup is quite complex. It's easiest to comment specifically if there's some example to work from.

cheers
Bruce

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Refresh whole Browse after Server Code Runs
« Reply #6 on: September 19, 2012, 04:46:29 AM »
Hi Bruce,

I cannot produce the same effect, but then, I have loads of files and data in play.

Attached find an example of what I am doing.  I included the code for my app in the embeds (commented out, ok there is other embeds as well on a field level), from this you can see there is a lot of action in the background.

I used the Products file, there is 'Click This' Button on the Browse, and the new procedure is TryThis.

This is exactly what I am doing in my app.

Thanks
Charl

PS. I still think if I can trap the unique unchanging key in the Browse when it is empty is the way to go.


[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Refresh whole Browse after Server Code Runs
« Reply #7 on: September 19, 2012, 06:15:43 AM »
um - Charl, if the example you posted works, then I'm not gonna learn much from that. the key I guess would be figuring out where your program differs (in setup) from the example you posted. If you can't figure that out we can go online to try figure it out remotely...

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Refresh whole Browse after Server Code Runs
« Reply #8 on: September 21, 2012, 01:00:19 AM »
Bruce,

Please look at the example, it is exactly what I do but with obviously much more serious files and stuff.  Then we can do the on-line thing.

>> PS. I still think if I can trap the unique unchanging key in the Browse when it is empty is the way to go.

Cheers

Charl