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

Another session.variable -> dialog thread

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

    Another session.variable -> dialog thread

    I'm having a problem passing a session variable from an a5w page to a dialog control.

    An overview of what I'm trying to accomplish: The user is accessing a "thank you" page on the site via a link in an email. The link is a filtered/personalized URL and is bascally formatted as: mywebsite.com?Tom1234. The page is linked to a table with three field in it; the filter, the person's first name and a filename. The user reads the thank you note and clicks a dialog button to download/open a specific personalized brochure.

    I have declared the session variable at the top of the a5w page. I successfuly performed a lookup to get the values I need from the table; the person's first name shows up just like it's supposed to. When I click the button, the download control/dialog shows up but the file name isn't there, just the .pdf. If I "hard" code the filenames in the control, it works perfectly. I've passed info from grids to dialogs in this same manner several times without any problems; the only difference was that I was passing info between controls and now it's from an a5w page to a control.

    I have spent way more time on this than I care to admit and I'm guessing (hoping) that there is a simple solution.

    Thanks,
    Tom
    Last edited by tdietrich; 07-30-2009, 10:08 PM. Reason: Clarification

    #2
    Re: Another session.variable -> dialog thread

    You'd have to provide the code you are using to make all this work else we have have nothing to go on. In the URL "mywebsite.com?Tom1234" you have not set a value for any variable because your query string does not meet the format var=value, although maybe you are parsing the string in the target A5W page.
    Steve Wood
    See my profile on IADN

    Comment


      #3
      Re: Another session.variable -> dialog thread

      isn't there, just the .pdf.
      I believe this is the smoking gun of your post.
      It would appear that the session variable has either been blanked out or is actually out of scope.
      So, Do you have anywhere where the session variable is re"initiated" back to ""Blank,
      If its a scope type issue, the best way would be a quick redesign,
      Remember the session variables are on the server not the client, which only has images of them.
      Post the variables via a URL, Send them back to a server page and then read them from there.

      Comment


        #4
        Re: Another session.variable -> dialog thread

        To be clear, you don't "pass a session variable" at all. Once you create a session variable, it exists until deleted. Once you populate a session variable with a value, that value persists until changed, or the variable is deleted. You don't "pass it" in a URL or by any other means, it just exists across all pages, all components, everywhere without any additional effort.

        So if, when you want to use the value in the session variable, the value is blank, then either you blanked it out or did not set a value in the first place.

        If you try to use a session variable and the variable does not exist (was not created or was deleted, or perhaps is of the wrong type) then the xbasic script will produce an error visible in the browser as a 500 error.

        So whatever method you are using to create and populate your session variable needs to be tested. Test - is the method actually doing what you expect? Test - isolate the method you are using to create and populate your session variable. Take everything else out of play, is that method working? If not, determine if your method is flawed and change the method. Or, if it is a bug, isolate and provide a test case HERE for evaluation and/or for a bug report to Alpha.
        Steve Wood
        See my profile on IADN

        Comment


          #5
          Re: Another session.variable -> dialog thread

          :o:o:o

          I had posted that I had it solved but I was mistaken. I'll get back with more detail and code.
          Last edited by tdietrich; 07-31-2009, 11:04 AM. Reason: I'm a moron.

          Comment


            #6
            Re: Another session.variable -> dialog thread

            I'm going to start with baby steps because I'm having more than just variable issues. I am trying to download a pdf from the download directory which is inside my webroot directory. I am using pre-determined values at this point and will add variables later. I am trying to download a file named Stacey6051.pdf, which appears to download, but it is not a the correct file and won't open with acrobat. When I open it with a text editor, it is the html source for the page I am on. I'm guessing that it has to do with my path but I'm not sure about anything at this point.

            I am using the following code:

            Code:
            dim vFilename as c
            dim vPath as C
            
            'Determine which file to send.
            'vFilename = session.NewPurl + ".pdf" '<--Not using yet
            vFilename = "Stacey6051.pdf"
            vPath  = "[PathAlias.ADB_Path]\download"
            
            'Tell the browser what type of file is being sent.
            response.mime_type = resolve_mime_type("PDF")
            
            'Prompt the user to save the file.
            response.add_header("Content-disposition: attachment; filename=" + vFilename)
            
            'Send the file.
            '  a5_default_path + fn would look for the specified file in the same folder as this A5W page.
            '  You would adjust this to match your path as needed.
            
            ?file.to_blob(vPath + chr(92) + vFilename)

            Comment


              #7
              Re: Another session.variable -&gt; dialog thread

              When I open it with a text editor, it is the html source for the page I am on.
              You don't have the code showing which generates the PDF.
              -
              Just as a check I suggest going with windows explorer where you believe the PDF is being saved and check, a.) is the PDF there. b.) is it actually a PDF.
              - Reason you can actually generate a HTML report similar to a PDF.
              -
              Can you please post a dollop of the code where you declare and initiate session.NewPurl

              Comment


                #8
                Re: Another session.variable -&gt; dialog thread

                The PDF is created offline. It is an actual PDF; I can open it on the web server. I have a copy of it in the root as well as the download folder. The variable doesn't seem to be the issue; I put a text box on the dialog and initialized the value as session.NewPurl and it shows up.

                Here is the code where I declare the session variable; it is on the a5w page where the dialog resides.

                Code:
                <%a5
                dim SHARED t1 as P
                dim qry as P
                dim nrecs as N
                
                dim session.NewPurl as C 
                
                dim  session.First as C
                dim session.ID as C
                
                session.NewPurl = Request.Query_String
                
                t1=table.open("[PathAlias.ADB_Path]\inquiry")
                	query.description = ""
                	query.order = ""
                	query.filter = "Purl='"+session.NewPurl+"'"
                	query.options = ""
                	qry = t1.query_create()
                	nrecs = qry.records_get()
                	if nrecs >0 Then
                		session.First = t1.First
                		session.ID = t1.Id_no
                	end if	
                t1.close()
                %>

                Comment


                  #9
                  Re: Another session.variable -&gt; dialog thread

                  Code:
                  dim session.NewPurl as C 
                  
                  dim  session.First as C
                  dim session.ID as C
                  I'm not 100% sure about this,
                  But I believe as the session already exists, you cannot redeclare the session or the dot.session variables.
                  -
                  You initialize the variable simply by doing this

                  session.NewPurl = ""
                  session.First = ""
                  session.ID = ""

                  thus the initialization also works as an informal declaration to the session.

                  I don't know if this will solve your problem.

                  Comment


                    #10
                    Re: Another session.variable -&gt; dialog thread

                    That makes sense but I have to declare the variables because the user is accessing the page by clicking on a link in an email; this is a new session. The URL is something like mywebsite.com?Tom1234; I am using the request.query_string function to parse the URL and place it in the variable session.NewPurl.

                    Code:
                    dim session.NewPurl as C 
                    
                    dim session.First as C
                    dim session.ID as C
                    
                    [COLOR="red"]session.NewPurl = Request.Query_String[/COLOR]

                    Comment


                      #11
                      Re: Another session.variable -&gt; dialog thread

                      Just Clarifying
                      Ok The Request.Query_String should be holding the GET string
                      eg user=foo&file=bar&foobaa=fish or whatever
                      This is generataed when the user makes the request from the email to the server... Next the client/browser downloads the ApplicationServer generated content from the host/Server.
                      So if you placed this at the top of your page

                      <%a5
                      session.NewPurl = Request.Query_String
                      ?session.NewPurl
                      %>

                      Probably right at the top of your page the applicationServer will write
                      foo&file=bar&foobaa=fish

                      followed by the rest of your page.
                      --
                      If this is the case then session.NewPurl will retain that value until the session expires or the session variable is given a new value.
                      --

                      Comment


                        #12
                        Re: Another session.variable -&gt; dialog thread

                        Thanks for all of your help! I have no idea what was causing my problem but I did get it fixed... sort of*. I ended up putting a submit button right on the a5w page and bypassed the dialog altogether. My guess is that that really had nothing to do with solving the problem but I did learn some new tricks because of it. I'm guessing I had some syntax issue that I didn't see before.

                        *The "sort of" that I was referring to is that while I can download the PDF, it is damaged. When I opened it with a text editor, it had an HTML tag on the first line. I'll start another thread on that issue unless I can find something in the forums.

                        Thanks again!

                        Tom
                        Last edited by tdietrich; 08-01-2009, 06:24 PM. Reason: Grammar

                        Comment


                          #13
                          Re: Another session.variable -&gt; dialog thread

                          OK... when trying to figure out my PDF error issue, I came across this helpful little nugget in the help files.
                          Code:
                          [SIZE="4"]RESOLVE_MIME_TYPE()[/SIZE]
                          
                          Supported By
                          
                          Alpha Five Version 7 and Above
                          
                          Limitations
                          
                          [COLOR="red"][SIZE="4"]RESOLVE_MIME_TYPE() can only be used in an A5W page.[/SIZE][/COLOR]
                          That might have been good information to know. If only I'd stumbled across that three days ago...

                          Comment

                          Working...
                          X