NetTalk Central

Author Topic: Drop down not updating session variable  (Read 3324 times)

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Drop down not updating session variable
« on: December 16, 2011, 04:35:08 AM »
This cannot be true but I cannot understand what I have done wrong.

I have a drop down of a Contact field called Contact Type which is a string. Simple. The ContactType is defined in the dictionary as one of 6 values.

In the Field properties of the drop down I have defined this as Type = Drop

However when checking the value in code when another field has changed I am getting Null. I have tried looking at the value CON:Type and p_web.GSV('CON:Type') but in either case it is null.

However save the record and the type is clearly working.

So why can I not get that value using GSV in my embedded code?

John


Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Drop down not updating session variable
« Reply #1 on: December 16, 2011, 05:59:27 AM »
Hi John,

What you try to do is look at a session var that a) maybe doesnt exist (yet) b) hasn't been set with the value you picked in the drop.
Form fields aren't automatically stored as a session value. You have to organize that youself.

Do it as follows (and forgive me if the description of the checkbox/tab/button isn't accurate.I have no Clarion at hand here).

In the properties for the drop, click the tab Server side.
Check the box 'Send value to the server' and click the server side code button.
In the source editor type p_web.ssv('CON:Type',CON:type) .
Save the code.
After that you should see the value of CON:Type when you do a p_web.gsv('CON:Type')

Cheers,
Rene

P.s. In the reset list you can add the equates of form fields you want to reset eventually.
In this case it isn't relevant.
Rene Simons
NT14.14

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Drop down not updating session variable
« Reply #2 on: December 16, 2011, 06:51:55 AM »
Oh thank you!

I just assumed the session variables were set at the time - think I will revisit the book this weekend to read up again.

Thanks

John