NetTalk Central

Author Topic: GetVAlue to unhide columns  (Read 4498 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
GetVAlue to unhide columns
« on: June 30, 2009, 02:15:28 PM »
Hi,

I have a browse which has some columna with a condition like:
p_web.GetVAlue('Admin')=1

I´m calling the browse from the menu like:
MyBrowse?Admin=1

The browse shows the columns but when I click on Next they disapears.

I´ve added:

If p_web.GetValue('Admin') = 1
  p_Web.SetValue('Admin','1')
End

in After setting browse behaviour setings

but they only appears the frst time I entre the browse.

Any Idea please?

Alberto

In the browse
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: GetVAlue to unhide columns
« Reply #1 on: July 01, 2009, 03:01:33 AM »
you should use GetSessionValue NOT getValue.

Store the value to the session queue using StoreValue.

Cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: GetVAlue to unhide columns
« Reply #2 on: July 01, 2009, 03:08:59 AM »
Thanks Bruce but I dont understand,

Calling the brrowse  'MyBrowse?Admin=1'

I have to use GetValue to read the Admin param.

What's the difference between ssv and setvalue?

THanks
-----------
Regards
Alberto

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: GetVAlue to unhide columns
« Reply #3 on: July 02, 2009, 11:28:17 AM »
Hi,
Imho GetValue only refers to the parameters in the URL.
GSV refers to "global" values in your session.
Every time a request goes to the server, the "old" values cease to exist.
The session values remain there for the duration of the session or untill you change the values.
Rene

Rene Simons
NT14.14

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: GetVAlue to unhide columns
« Reply #4 on: July 03, 2009, 04:42:32 AM »
Thanks Rene, I know this but my doubt is whtich is the difference between SetValue and SSV

The problem I see with GV and GSV is the following:

Suppouse you call the same form from a browse to change/delete and from the menu to add, then the form needs to know from where it is called to hide/unhide some fields and to know where to go back on save/cancel.
Then I call the form from the menu adding a parameter to the URL.
In the form I need to GV and SSV to remember that situation because the form calls itself for pre and post without maintaining the GV value.(*)

Doubt: its ok to save so much volatile values to the session queue? what about the memory space? is there any garbage collector method to get rid of this?

Lets continue, then with the GV/SSV/GSV I can use the form adding and go back to the menu.

Then I enter the browse, the browse does not send the URL parameter to the form.
In this case, you cant use GV to check from where its called because there allways be a time when the parameter is blancked (see * above)
Then if you call the form from the browse, without the param and it has been calle by the menu first it will behave the same a s called by the menu.
To solve this may be you have to set the SSV value at the beggining of the browse, but in the form, how do you know who was first?

Suppouse the session value is called SOA and a param value callet OA

Calling the form from the menu
-Menu call the form adding OA=1 to the URL
-The form checks the SSV value to see if its called by the browse
 if gsv('SOA')='browse'
 ...
 else
-The form checks the GV
 if gv('OA')=1
    ssv('SOA')='menu'
 end
then all continues ok

Calling the form from the browse
-You need to set the ssv to 'browse'
-The form checks the SSV value to see if its called by the browse
 if gsv('SOA')='browse'
then all continues ok

Calling the form again from the menu
-Menu call the form adding OA=1 to the URL
-The form checks the SSV value to see if its called by the browse
 if gsv('SOA')='browse'
PROBLEM!
-The form checks the GV
 if gv('OA')=1
    ssv('SOA')='menu'
 end
REMEMBER you cant check for gv('OA')<>1!!

Then theres no way to go back to the menu way of accesing the form.

I found it like the dog who want to catch its tail.

Is there another way to do it ?

Regards
Alberto


-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: GetVAlue to unhide columns
« Reply #5 on: July 03, 2009, 07:52:51 AM »
I referred to StoreValue, not SetValue.

StoreValue copies the parameter to the Session Queue if it exists.

You cannot use the GetValue because the dynamic update to the browse (Next etc) does not include the parameter. Since the parameter is not included your test is failing.

So, Use GetSessionValue in all your tests.

Use StoreValue to copy the parameter to the Session Queue.

Cheers
Bruce