Alpha DevCon 2018
Results 1 to 4 of 4

Thread: Session variable through Grid component

  1. #1
    Dannie Mogensen
    Guest

    Default Session variable through Grid component

    Me and my collegue in Denmark have tried to pass session variable to a .dbf through a grid component.

    We have by everyone been informed that this was not possible.

    However I would like to have your opinion about some testing that I have done, whereby I have managed to pass a session variable throug a grid component.

    Before changing all of my application I would like to hear if there are any underlying problems in having this to work.

    What I do is the following:

    I have a field in my .dbf with a userId, that I want to be updated with the actual user, identified as session.user_Id.

    The field that has to contain the value, I then define as a dropdownbox.

    Then on the sourcecode on my a5w page, I define the value of the dropdownbox to be the value of the session.user_Id.

    The height of the box is defined to=0.

    When submitting the form the .dbf is updated with the session variable.

    What would be nice, is if it is possible to have a field "Updateable" even though the field is hidden in the grid??

    Regards
    Dannie

  2. #2
    Alpha Software Employee Selwyn Rabins's Avatar
    Real Name
    Selwyn Rabins
    Join Date
    Mar 2000
    Location
    Boston, MA
    Posts
    5,222

    Default RE: Session variable through Grid component

    this is very clever.

    of course it would be nice if a5 did not make you work so hard to do this in the first place.

    we are going to be adding 'events' to the Grid Component.

    once we have events, then the solution to this would be:

    1. put the field you want to update on the Grid (say the field is called UserName), and set its control type to 'Hidden' (we will need to add a 'hidden' control type to the Grid - the Dialog currently does support this).

    2. in the BeforeUpdate event, your xbasic would do this:

    v.Username = session.user_name

    ('v' is a dot-variable that contains all of the variables that were submitted back by the form)

  3. #3
    VAR Howard G. Cornett's Avatar
    Real Name
    Howard Cornett
    Join Date
    Feb 2003
    Location
    Lexington, MA
    Posts
    666

    Default Can't get it to work

    Dannie,

    Can you provide a little more detail. I cannot seem to get this to work following your instructions. For example, do you define the dropdown as static or dynamic?

    Howard
    Howard G. Cornett, Independent Consultant

  4. #4
    Member
    Real Name
    Thenmozhi
    Join Date
    Jun 2007
    Posts
    41

    Default Re: Session variable through Grid component

    Quote Originally Posted by Selwyn Rabins View Post
    this is very clever.

    of course it would be nice if a5 did not make you work so hard to do this in the first place.

    we are going to be adding 'events' to the Grid Component.

    once we have events, then the solution to this would be:

    1. put the field you want to update on the Grid (say the field is called UserName), and set its control type to 'Hidden' (we will need to add a 'hidden' control type to the Grid - the Dialog currently does support this).

    2. in the BeforeUpdate event, your xbasic would do this:

    v.Username = session.user_name

    ('v' is a dot-variable that contains all of the variables that were submitted back by the form)

    Dear Selwyn,

    Just now i read your suggestion. Is it possible to store or update in the dbf file,in hidden field value? If it Possible, I have two doubts,

    1. Can i update the session variables through update the dbf file using hidden field?

    2. In my dbf. i have a flag field, in this filed when i entered a new record it sets "N" variable and while i updating or modifying the records the flag variable changed "N" into "U". How can i changed the flag variable? In this issue can i used the hidden control?

    Best Regards,
    Thenmozhi.

Similar Threads

  1. Session variable displayed in Grid
    By Steve Bovino in forum Web Application Server v6
    Replies: 1
    Last Post: 09-17-2005, 05:20 AM
  2. fill field in grid with session variable
    By René Stout in forum Web Application Server v6
    Replies: 2
    Last Post: 08-18-2005, 12:14 PM
  3. Grid component search part?
    By David Brown in forum Web Application Server v6
    Replies: 1
    Last Post: 06-01-2005, 06:43 PM
  4. Grid component
    By Dannie Mogensen in forum Web Application Server v6
    Replies: 7
    Last Post: 02-02-2005, 11:43 AM
  5. Set session variable from grid selection
    By Pat Bremkamp in forum Web Application Server v6
    Replies: 2
    Last Post: 09-27-2004, 07:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •