NetTalk Central

Author Topic: How to pass e text-field to a session-value  (Read 4850 times)

Bram Klootwijk

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • Email
How to pass e text-field to a session-value
« on: August 25, 2007, 09:16:37 AM »
Hi,

i have a memory-form with a text-type-field for a description. I want to save this in a session-variable for use in another form.

It seems that i cannot save the value of a text-field in a session-variable?


Any help is welcome..


Greetings,
Bram

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: How to pass e text-field to a session-value
« Reply #1 on: August 27, 2007, 07:50:30 AM »
Hi Bram,

When you say Text type, do you mean a very long string?
Currently, session value can be up to 256 characters.
I think you could lengthen the Net:ValueSize but I you might be better off using an unthreaded global memory table or Queue with your session  Id as the key. You may need to make your own get and set functions for it to make it easy on yourself.

Chris
Real programmers use copy con newapp.exe

Bram Klootwijk

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • Email
Re: How to pass e text-field to a session-value
« Reply #2 on: August 29, 2007, 06:12:25 AM »
Hi Chris,

in a webform you can specify a text field (like string, display,etc). I/ve got a memory-form and want to pass the contents of that text-field to another form. Yes, it's a string of 500 chars. Trying to save that in a session-value does not work. Passing a vaulue of a type string-field dos work. I thougt it might be a bug..

Cheers,
Bram

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: How to pass e text-field to a session-value
« Reply #3 on: August 30, 2007, 11:01:29 PM »
Hi Chris,

>> When you say Text type, do you mean a very long string?
>> Currently, session value can be up to 256 characters.

This is inaccurate. Session Values can be any size. This changed quite a few versions back.

Cheers
Bruce

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: How to pass e text-field to a session-value
« Reply #4 on: August 30, 2007, 11:23:37 PM »
Hi Bram,

The best place to do it is inside the ValidateUpdate routine.
This is called just after the "Save" button is pressed.
if the local variable is called say loc:whatever, then in this routine do a

p_web.StoreValue('loc:whatever')

This copies loc:whatever from the Value queue to the SessionValue queue.

Also you could just "Send new value to server" for the text field - that seems to be working in version 4.29

Cheers
Bruce