NetTalk Central

Author Topic: Setting Hot Fields to SessionValues  (Read 6770 times)

mpetitjean

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • Nola Ridge
    • Email
Setting Hot Fields to SessionValues
« on: September 19, 2007, 07:24:26 AM »
    I am using several drop lists to allow the user to make a choices for a new reservation.  In some instances two reservations may need to be made when the user clicks the save reservation button, one for the aircraft and one for the instructor.  If the user selects to display both aircraft and instructors in the same In-Memory web browse a new drop list appears on screen with the list of available instructors.  The drop list displays the instructor's  name and the identification column is in the Hot Fields list.

     Where can I set a SessionValue to hold the value of the ID column when an instructor is selected in the drop list?  I am not using Insert, Change or Delete buttons on the form because we are viewing and In-Memory table so the SaveMem Routine never fires.  I've looked at the current value of the ID column in the Value (before and after) for the drop list.  I tried firing the SaveMem routine manually in the embed point just before "return Ans" but the value is always zero there.  I'm running out of ideas because I can't seem to find an embed point where this value is set based on the selection made in the drop list.


Alan Telford

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
Re: Setting Hot Fields to SessionValues
« Reply #1 on: September 19, 2007, 05:09:01 PM »
This may help?

Tick the checkbox for "Send Value to Server".
Checkbox is on the "Client-side" tab in field properties on the netwebform.

You can also add "Server-side Code" here.
eg. call a routine, and in the routine use the primaryid from the droplist to lookup your hot field.

I don't think a droplist has hot fields, but whenever the droplist changes, you can send the value to the server, run some server side code, fetch any hot fields you need, save to session values.

Hope this helps,
Alan

mpetitjean

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • Nola Ridge
    • Email
Re: Setting Hot Fields to SessionValues
« Reply #2 on: September 20, 2007, 02:47:35 AM »
     Thanks!

     Unfortunately the drop list is a list of instructor names and the hot field I want to retrieve is the primary ID column for the table.  This will allow a lookup of the field to get other information from it for the reservation.  Although it makes sense to have each name in the table be unique it is not required by the database or the program.  Therefore I can't guarantee that a look up by the name will produce a unique row.

      I placed code in the "Server Side Code" to check the value of the hot field from the table row.  It is always zero at that point.  My intent was to set a session value to pass to the reservation procedure.

      There are two drop lists that I am using that need this hot field capability but I am unable to find an embed in which the value of the hot field is correct.

Alan Telford

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
Re: Setting Hot Fields to SessionValues
« Reply #3 on: September 20, 2007, 01:30:28 PM »
Why don't you try changing your droplist.
Keep display as your non-unique name that you have.
But change the VALUE to be the unique ID that you need.
Then it doesn't need to be a hot field.

Give it a try,
Alan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Setting Hot Fields to SessionValues
« Reply #4 on: September 25, 2007, 12:16:30 AM »
Hi Mike,

Alan is right - the drop list has 2 components. The bit you see (the Description) and the bit the page sends to the server (the Value). In your case it seems you want to set the description field to be the instructor name, and the value field to be the instructor ID.

Cheers
Bruce

mpetitjean

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • Nola Ridge
    • Email
Re: Setting Hot Fields to SessionValues
« Reply #5 on: September 25, 2007, 06:47:46 AM »
      Thank you, Alan and Bruce!  This took care of the problem.

      Little by little I am understanding this system.  <g>

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: Setting Hot Fields to SessionValues
« Reply #6 on: May 17, 2010, 03:05:19 AM »
Hallo,


But if I have a drop and I need both the name and the value ?  I have ID_Cars and NameCars , the drop is set for ID_Cars and Description is NameCars. After validate I got only the ID_Cars and never NameCars ... How can I get both ?

Thank you,

Regards,
Robert

Poul

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: Setting Hot Fields to SessionValues
« Reply #7 on: May 17, 2010, 08:45:42 AM »
if hot fields are not working for you can alway send the ID to server and
with some server code -   

  p_web._OpenFile(yourfile)
   !  code to get you record - even other related things
   !  set some sessionvalues or  whatever,,,
   p_Web._CloseFile(yourfile)


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Setting Hot Fields to SessionValues
« Reply #8 on: May 17, 2010, 10:28:30 PM »
Hi Robert,

Given that you have the ID, you can load the record to get the name yourself.
The HTML drop can only return 1 value.

cheers
Bruce


Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: Setting Hot Fields to SessionValues
« Reply #9 on: May 18, 2010, 02:03:31 AM »
Hallo Bruce,

Noted. This way is working .

Thank you,
Robert