Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Set Session Variable Based on Selected Grid Row

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Set Session Variable Based on Selected Grid Row

    I have a grid linker containing five grids:

    Department
    Zone
    Dealer
    Customer
    Order

    I am trying to set some session variables based on one of the selected row values in the grid.

    I have tried using the code:
    Code:
    <%A5 session.grid_department = {ParentGrid:Department} %>
    in the zone grid 'above grid' 'freeform edit region' which does resolve the selected department correctly except with the error:
    Code:
    Error:Script:EVALUATE_A5W line:4 session.grid_department = 10 Invalid date constant
    I know it does not make much sense assigning a session variable from the 'freeform edit region' but grids do not have an appropriate static HTML area required by 'ParentGrid'.

    Anyone have any idea what this error means. I am at at loss since there are no dates involved. Or better yet, is there are better way to set session variables based on a selected grid row within a grid linker?

    Any/all help is greatly appreciated.
    Happy holidays everyone :)
    Rick

    #2
    Re: Set Session Variable Based on Selected Grid Row

    This thread might help you:
    http://msgboard.alphasoftware.com/al...ad.php?t=64593

    Look at Pat's post at the bottom for method to capture multiple fields.
    Peter
    AlphaBase Solutions, LLC

    [email protected]
    https://www.alphabasesolutions.com


    Comment


      #3
      Re: Set Session Variable Based on Selected Grid Row

      Thanks for the suggestion Peter,

      I read the thread and I don't think I can use the method suggested since I have multiple grids and am not able to use links in place of labels.

      Basically, I am planning to put a button below all the grids with the title 'place an order' or something like that. This button would redirect the user to the order page, at which point, I will need to have stored somewhere the current:

      department
      zone
      dealer
      customer

      Agreed that I could pass these in the URL of the page re-direct, however, I will still need to keep track of these values as the user selects records in the various grids.

      Any other suggestions? Anyone.
      Rick

      Comment


        #4
        Re: Set Session Variable Based on Selected Grid Row

        Rick,

        OK, I think I get what you are trying to do. You want the user to select rows on each of the grids, then assign the resulting values to session variables with one button press. So, perhaps you should consider a different way to do the same thing.

        If it was me, I'd use a dialog component and put each of the four choices either in a dropdown or a lookup grid. That way, if any of the "lower" choices are dependent on the prior choice (say different dealers in different zones) you can make the list of choices change when the prior selection is made.

        Then you can easily assign the session variables with Xbasic in the AfterValidate event.

        Another advantage...gridlinkers are slow and dialogs are fast(er).

        Pat
        Pat Bremkamp
        MindKicks Consulting

        Comment


          #5
          Re: Set Session Variable Based on Selected Grid Row

          Pat,

          Thanks for the suggestion.

          I think I understand what your idea is although I have a couple of questions if you don't mind.

          Firstly, what is a 'lookup grid'? Second, the users have said that they need to see more than one piece of information in order to make a selection. For example, in the case of selecting a dealer, I must display the dealer number, full name and company name. If I use a drop-down, can I concatenate all of this into one entry? Or maybe there is another way of presenting more than one piece of information.

          Rick

          Comment


            #6
            Re: Set Session Variable Based on Selected Grid Row

            Rick,

            Sure. Here are some examples from an application I'm working on.

            A lookup grid is just a grid component. You make this first with whatever info you want to display. In screen1, this is the grid in the lower right. This component displays fields that you want to copy into your main component. You do not create a page for this component. I usually make it read only for speed and compactness and add a quick search for long lists. Then, in the field definitions for the field in your dialog is a property called "Lookup". Check that box and it will guide you through specifying the lookup grid name and mapping the fields from the lookup grid to corresponding fields in your dialog. The little spyglass is the icon that triggers the lookup.

            Screen2 shows a dropdown with more than one field displayed. In this case, I made the display and expression equal to ID_Code+" "+Name. You can then save those or entirely different fields from the record.

            Pat
            Pat Bremkamp
            MindKicks Consulting

            Comment


              #7
              Re: Set Session Variable Based on Selected Grid Row

              Pat,

              Great explaination, thanks Pat.

              I think I'll proceed with the lookup method which bring me to another question. Can I do multiple look-up prompts? For example, each one of these would be a lookup that qualifies the previous ones:

              Department: --- Select one ---
              Zone : --- Select one ---
              Dealer : --- Select one ---
              Customer : --- Select one ---

              Obviously, the lookup lists would have to be dynamically loaded based on the previous selection. Any thoughts?

              Rick

              Comment


                #8
                Re: Set Session Variable Based on Selected Grid Row

                I assume you've moved forward on this but if you haven't, just some thoughts on what you could do.

                I'm doing something very similar to what you're doing. I created a dialog with 7 drop down lists each of which references a different table.

                Yours is different because you've got a dependency relationship between the choices. Basically choice #1 filters choice #2, etc. assuming I understand it correctly. What you do will be dependent, possibly, on the amount of data being filtered. If it's going to be a lot, you probably don't want to send it all out there and let a javascript modify the dropdown lists (assuming that is even possible).

                What would really be cool is if you could make choice # 2 visible only after choice #1 was made, and at the same time trigger a request to the server for just the data that you'll show in choice #2, etc. That would keep the traffic down and you wouldn't be regenerating the entire page.

                Of course, you could just go to a new page which picked up the filtered data for choice#2 but I seem to remember you saying that the user wanted to see or have the ability to see, the previous stuff too.

                what did you end up doing?

                Comment


                  #9
                  Re: Set Session Variable Based on Selected Grid Row

                  Steve,

                  Yes I did move forward based on Pat's original suggestion of using drop-down's. And as Pat said, they are so much faster than grid's. I have this whole page just about done. There are four drop-downs that depend on the previous one and the final component which shows the detail is a read-only grid. I am using parameters in each drop-down based on session variables. I choose session variables because I will also be placing another button on the main dialog that allows the user to place an order (which will be redirected to another page) based on all the current relationships.

                  Funny, I was just thinking that it would be great to make one or more drop-downs invisible based on a previous selection. For example, I have departments where there are no zones and/or no dealers. I still have to figure out how I am going to accomplish that. My current idea is to use some kind of 'all' flag for the session variable and cause the DB filtering not to ocurr. But it would be much cleaner if I could just remove one or more of the drop-downs from the dialog.

                  Rick

                  Comment


                    #10
                    Re: Set Session Variable Based on Selected Grid Row

                    You could make the subsequent selections invisible until a prerequisite selection is made. Javascript might be able to accomplish that through the onclick event.
                    Here's a place to check that out: http://www.w3schools.com

                    Comment


                      #11
                      Re: Set Session Variable Based on Selected Grid Row

                      Steve,

                      Thanks for the tip. I'll check it out. I have used W3schools before to brush up on HTML and CSS.

                      Rick

                      Comment

                      Working...
                      X