NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Matthew51 on July 08, 2009, 02:31:11 PM
-
I want to have multiple menu items that all call the same browse, but filter it differently. My idea was to store the filter in a session value, but I can not find the correct place to set the value. If I set it in an embed point for the menu item then all embed point look to get executed in the order of the menu items. Meaning only the last filter will ever be used regardless of which menu item the user clicked on. Setting the value with the "onClick" field seems to have the same result.
I'm using NetTalk 4.31 by the way.
-
Hi Matt,
Call the browse from the menu adding a paremeter value to the URL like:
MyBrowse?Filter=IdFilter
IdFilter is anythig you want to identify the filter.
In the Browse itself, Embed Before Browse Loop/ After setting browse....
save the Parameter to a session value like:
p_web.ssv('IdFilter',p_web.GetValue('Filter')
Then in the SetFilter Embed you can check for the session value and decide what filter to use, like:
if p_web.gsv('IdFilter')='whatever'
loc:FilterWas = 'your filter'
end
Hope this helps
Alberto
-
Almost correct.
this bit is wrong;
In the Browse itself, Embed Before Browse Loop/ After setting browse....
save the Parameter to a session value like:
p_web.ssv('IdFilter',p_web.GetValue('Filter')
Because it will clear the SessionValue if the parameter does not exist. And since the parameter does not exist for any of the async class it will quickly break your filter.
The correct way to store a parameter in the session queue is to use the StoreValue method.
p_web.StoreValue('IdFilter')
And of course your parameter should then match the Value name- ie
MyBrowse?IdFilter=whatever
Cheers
Bruce
-
I did all that, and the filter looks to work for about a half second, then the browse is displayed without a filter. I checked the values of loc:FilterWas and IdFilter and they are always correct.
-
have you got a timer on the browse?
If you do, remove it for testing. You can "refresh" the browse page by clicking a header, or next button or something like that.
let me know what happens with that test.
-
I had already removed it for testing.
-
I think you'll need to post an example of what you are doing here Matthew.
Cheers
Bruce