NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: terryd on May 09, 2014, 01:34:59 AM

Title: Calling a source procedure from a button on a memory form and going to another p
Post by: terryd on May 09, 2014, 01:34:59 AM
Hi Bruce
Following up from the question I asked in the webinar last night.
I have placed the call to the TagTransfer source procedure in the Validate::TagTransferButton Routine Add serverside code here and the procedure gets called correctly.
The serverside code is called 3 times, once when the form generates the button and twice when the button is clicked.
I can live with this but it would be preferable to be able to control when the TagTransfer(p_web) is called.
Secondly I would like to close the form and return to the menu.
In the On Click URL I have entered 'index.htm' which returns me to the menu but doesn't reset the session variable that I would like to reset to 0 i.e. p_web.SSV('StatusID',0). I can't set this in the tagTransfer procedure because of the three calls, the first two of which should not change this variable. Is there a location where I can set this to 0 just before or after the Index.htm operation?
Title: Re: Calling a source procedure from a button on a memory form and going to another p
Post by: Bruce on May 09, 2014, 08:00:58 AM
Hi Terry,

>> The serverside code is called 3 times, once when the form generates the button and twice when the button is clicked.

then you've done something wrong. The Validate:: routines only get called when the field is completed.

>> Secondly I would like to close the form and return to the menu.

On the same button? On the same click?

Cheers
Bruce
Title: Re: Calling a source procedure from a button on a memory form and going to another p
Post by: terryd on May 10, 2014, 02:45:10 AM
>> The serverside code is called 3 times, once when the form generates the button and twice when the button is clicked.

then you've done something wrong. The Validate:: routines only get called when the field is completed.

Yes I had the call to the source procedure in 2 different places.

>> Secondly I would like to close the form and return to the menu.

On the same button? On the same click?
Yes on the same button, same OnClick

With the On Click url of 'index.htm' the procedure does go to the menu. I would like to set a session value just before the 'index.htm' is called
Title: Re: Calling a source procedure from a button on a memory form and going to another p
Post by: Bruce on May 11, 2014, 06:04:14 AM
Terry,

you can't do both.
Probably your best option is to pass a parameter as part of the URL call. Note that the call to index.htm, and the server-side-code can run in either order - you can't predict which one will happen first, because they're running on different threads.

So add a parameter, and do a p_web.StoreValue in the destination procedure.

cheers
Bruce