NetTalk Central

Author Topic: Form - NetWebSource procedure duplicated  (Read 3058 times)

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Form - NetWebSource procedure duplicated
« on: July 23, 2012, 01:56:47 PM »
Hi,

I am trying to use a Form with user edited parameters on one Tab and on a second Tab with different NetWebSource procedures that display the data based on the parameters.   Looks good except that the NetWebSource procedures are called a second time (after the form footer has been generated)  so the user gets duplicate displays.

The problem appears to be in the Popups Routine on the Form (the NWSource procedures are not called as popups).  After the form footer is generated   p_web.GetPreCall('MyProcedure') returns 0 in the Popups Routine so the MyProcedure is generated again.

The temporary workaround is to add:

p_web._PreCallQueue.Name = lower('MyProcedure')
ADD(p_web._PreCallQueue,p_web._PreCallQueue.Name)

to the "Popups routine start" embed.  That solves the immediate problem, but there are probably consequences elsewhere.

Any advice would definitely be appreciated.   Thanks.

Using 6.37

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: Form - NetWebSource procedure duplicated
« Reply #1 on: July 23, 2012, 04:14:51 PM »
Hi,

In your NetWebSource wrap all your code in a condition that checks GetValue('_silent_') ~= 1 and GetValue('_CallPopups') = ''.

_silent_ is used when a child procedure is called from a parent, but a condition precludes its display.

_CallPoups is prep code looking for any popups and inserting the correct divs to receive the popup in the parent (this is an educated guess, because I haven't debugged it all the way through to check), but it makes sense.

In your case you need to not generate your normal code under these conditions.

Regards
Bill


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Form - NetWebSource procedure duplicated
« Reply #2 on: July 23, 2012, 09:41:17 PM »
Bill is right on all counts.

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Re: Form - NetWebSource procedure duplicated
« Reply #3 on: July 25, 2012, 01:50:46 PM »
Works great.  Thanks, Bill and for the confirmation, Bruce.