NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: sukhendu on April 04, 2012, 01:19:21 PM
-
I have one browse shown on two separate tabs on a webform procedure. Where do I put the code to pass a parameter to the browse from each tab on the form? I think I will be using SetSeesionValue on the form and GetSessionValue on the browse.
Thanks,
Sukhendu
-
Hi Sukhendu,
What is the embed going to do? I.e. is it going to be part of the browse filter or the browse heading or something else?
Regards,
Trent
-
Hard to say as I'm not sure either what you are trying to do but if you have a browse on a form just under where you set the procedure name (your browse) you can set parameters.
-
I don't think you can have the same browse on 2 separate tabs. ie the same browse multiple times on the same page. My suspicion is that you'll get really weird behavior.
That's because the session values for a browse would be "shared" with the session values for the other browse.
In this situation you may be better off with 2 separate browse procedures.
cheers
Bruce
-
Tab1 - BrowseClients with ClientTypeFlag = 1 (client type Customer)
Tab2 - BrowseClients with ClientTypeFlag = 2 (client type Supplier)
It seems from Bruce's comment that I should create two separate browses.
How about if I put two buttons on the webform: one for Customer and the other for supplier. And have only one browse procedure: Is this do-able? If yes then where do I embed the ClientTypeFlag on the form?
Kevin - I'm looking for an example on parameter passing between procedures.
Thanks,
Sukhendu
-
Hi Sukhendu,
You can do this with either Buttons or a Dropdown:
In the 'Client-Side' tab of the Buttons/Dropdown, insert a Reset Prompt/Value for the Browse, check 'Send new value to server' and in the 'Server Code' set the Session Value. If you use Buttons then set the Session Value on form load. If you use a Dropdown then prime the Dropdown in the Form 'Priming' tab.
In the Browse do the GSV in the 'Set Filter' embed i.e.
ThisView{prop:filter} = 'table:field = '& p_web.GSV('ClientType')
Regards,
Trent
-
exactly right Trent!
-
Thanks Bruce :)
-
Hi Trent,
Thanks for your reply. I'm using buttons on the form. You mentioned to set the session value on: 'Send new value to server' and in the 'Server Code' set the Session Value. And set the session value again on form load: If you use Buttons then set the Session Value on form load
Does this mean that I have to set the session value twice?
When I set the session value in the 'Server Code' embed, it goes under validate routine '5 Add Server side code here' , it does not work. I'm still struggling with finding the correct embed point on the form that has multiple buttons. Example: Button1: p_web.SetSessionValue('pCliType',1) and Button2: p_web.SetSessionValue('pCliType',2)
Thanks - Sukhendu
-
Hi Sukhendu,
Yes you will be setting the Session Value twice, once when the Form loads so that the Browse has a filter to start with, and the second time when the user clicks one of the buttons to change the browse filter.
The Form Load embed could be 'Before Heading' or 'Before SubHeading' because these happen before the Browse is loaded.
You could put 'p_web._Trace(ThisView{prop:Filter})' code in the Browse Set Filter embed under the filter code to see what the Browse is filtering on and if the SSV is working at both embed points.
Regards,
Trent
-
Hi trent,
just 1 tip:
>> You could put 'p_web._Trace(ThisView{prop:Filter})' code in the Browse Set Filter embed under the filter code to see what the Browse is filtering on
There's now a template option (checkbox) to turn this on. I do it a lot, so it was easier to make it a template option than write the line of code each time.
cheers
Bruce
-
Good idea :) I might start using that too instead of my 'debug' statements.
-
Thank you Trent and Bruce for your help.
I find passing simple flags using procedure name with ?myFlag=value much easier.
Sukhendu