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

passing session variable in v10

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

    passing session variable in v10

    not sure if i am doing this wrong or a v10 bug.

    i have a button on a detail view popup window. the button opens an .a5w page and also puts a field value in to a session variable.

    the .a5w page opens and allows the user to upload an image, working fine so far. part of the code to upload the image also updates the value in a field in the table being worked on.

    however when the code to upload the image is run, the image loads fine but i receive an error with regards to the session variable.

    code
    Code:
    <%A5
    dim msg as c = ""
    
    if eval_valid("cmd")
    
        file.from_blob("[PathAlias.ADB_Path]\photos\\" + FileToUpload.filename, FileToUpload.data)
    
    	dta="Image =" + "[PathAlias.ADB_path]\photos\\" + FileToUpload.filename
    	record_update("[PathAlias.ADB_Path]\titems.dbf","itemid="+quote(session.__protected__itemid),dta)
    	
        msg = "<a href=\"/" + FileToUpload.filename + "\" target=\"_blank\">" + FileToUpload.filename + "</a> was uploaded<br /><br />"
    end if
    	
    %>
    error
    "Script Error
    Error:Script: /h_secure/upload.a5w line:12
    record_update("[PathAlias.ADB_Path]\titems.dbf","itemid="+quote(session.__prote
    Property not found
    session.__protected__itemid subelement not found."

    #2
    Re: passing session variavle in v10

    i think i have worked this one out.

    Comment


      #3
      Re: passing session variavle in v10

      nope i havent worked this out.

      i have

      1. a button on a detail view pop up window in v10
      2. the button opens a new a5w page in a pop up window and assigns a session variable based upon the value of the id field for that record
      Code:
      upload.a5w?v_itemid={itemid}
      3. declared the variable on the page 'upload.a5w'

      the variable doesnt appear to be set by the button - if i set the value on the 'upload.a5w' page as a static value then the 'upload.a5w' page works fine, but not if i am relying on the variable to come from the button on the detail view.

      i hope this makes sense.

      Comment


        #4
        Re: passing session variavle in v10

        I can't tell from your example, does your URL contain the session var, such as "mypage.a5w?v_itemid=session.__protected__itemid"?

        If so, can't. You can never use a protected session variable in a URL. The way your example shows, v_itemid would be a page variable on the A5W page and contain whatever value you have in your {itemid} from the grid.
        Steve Wood
        See my profile on IADN

        Comment


          #5
          Re: passing session variavle in v10

          hi steve,

          no protected in the session variable. i am just using the java scripts attached to the button to open a page and assign a variable.

          i need to pass the value of the itemid field for the current record.

          The way your example shows, v_itemid would be a page variable on the A5W page and contain whatever value you have in your {itemid} from the grid.
          this is exactly what i need to be passed from the items.a5w page which has the grid 'view_bedroom' to the page upload.a5w

          the button, opens upload.a5w page to allow the user to upload an image and then code on the upload.a5w page updates a record filtered based upon the session variable i am trying to pass.

          if anyone has the time, my app is attached.

          the page items.a5w starts the process, when the 'upload image' button in a records detail view is pressed

          the page upload.a5w has the code to update the values in the record for which i need the session variable

          you will need the v10 beta and i am working with yesterdays release.

          Comment


            #6
            Re: passing session variavle in v10

            I guess I can't see where any session variable needs to be involved. You are bringing over the item id as a page variable named v_itemid. So what's the session variable used for other than to filter your grid? How the grid was filtered does not matter once you leave the grid to go to another page. Your record_update code would be:

            record_update("[PathAlias.ADB_Path]\titems.dbf","itemid="+quote(v_itemid),dta)

            (maybe without the quote(), I can't remember right now.)
            Steve Wood
            See my profile on IADN

            Comment


              #7
              Re: passing session variavle in v10

              i believe the session variable needs to be available to the page upload.a5w so it knows which record to update.

              maybe i am confused on session and page variables, either way i need the value of the item id of the selected record to be available to the upload.a5w page.

              i thought the value would be available by assigning the value to a variable when the button is clicked.

              How the grid was filtered does not matter once you leave the grid to go to another page
              i understand this but am more concerned with having the value available to update a particular record.

              record_update("[PathAlias.ADB_Path]\titems.dbf","itemid="+quote(v_itemid),dta)
              i tried this and it wouldnt work - something i am doing maybe, but i copied word for word.

              if i set a static value for variable v_itemid in the upload.a5w, the whole thing works fine, so my problem is in getting the value of itemid from the grid/details view to the upload.a5w page. am i completely missing something?

              Comment


                #8
                Re: passing session variable in v10

                Hi Richard,

                i also experience the same thing, i think this is a bug for v10 (cannot passing the session variable), while i tried the same component and page in v9 and the session variable worked fine.

                Regards,
                Andy

                Comment


                  #9
                  Re: passing session variable in v10

                  Richard, when you click the link in the grid, what is in the URL? And what is the code you used on the grid to create that link?

                  If the value is passed in a link, it a Page Variable. If the variable takes the form session.myvar, then it is a Session Variable. Session variables are not 'passed' between pages. They are set at any point by your application using xbasic almost always defined in an A5W page. They persist until destroyed by more xbasic code, or the session times out.
                  Steve Wood
                  See my profile on IADN

                  Comment


                    #10
                    Re: passing session variable in v10

                    Hi Steve,

                    Yes you are right, it's a Page Variable because the value is passed in a link, i tested to pass the page variable in a header grid link and the target page will be child grid, on the child grid event then i use the page variable (that i pass from the header grid link) and i got error message "property (Page variable) is not found". you can see that attachment for more clear.

                    FYI: it's only happen for V10 and in V9 it works fine.

                    Regards,
                    Andy

                    Comment


                      #11
                      Re: passing session variable in v10

                      I looked at your attachment. I would never establish a URL that populates a session variable. Both because there is no need, and because you encourage visitors to play with the value to see what they can hack.

                      But that is besides the point. I guess if it worked in V9 and does not in V10, I haven't a clue. If I were you I would test to see if you can include a session variable in a URL in version 10. Run a simple test like this in V9 and V10:

                      mypage.a5w?session.name=Steve

                      and on mypage.a5w include this, see if you get an error, or "Steve" or nothing.

                      ?"Name is: " + session.name

                      Not saying its true, but if I were developing V10, I would eliminate the ability to set session variables in a URL.
                      Steve Wood
                      See my profile on IADN

                      Comment


                        #12
                        Re: passing session variable in v10

                        hi, been away for a few days

                        Richard, when you click the link in the grid, what is in the URL? And what is the code you used on the grid to create that link?
                        because the link opens an ajax window, i cant see the value being passed to the URL.

                        i wasnt sure what variable was being set, page or session as i was just setting the variable in the action scripts for the button which opens the ajax window.

                        ill update with the latest builds and see if it makes any difference.

                        Comment


                          #13
                          Re: passing session variable in v10

                          Hi Richard,

                          i just create another title for this page variable, and i also attach component, pages and DBF that are ready to test and also VIDEO in MP4 format, you can test it and please let me know the result. please see title 'v10 : page variable that passed to target page is not recognized in the target pages.'

                          regards,
                          Andy

                          Comment


                            #14
                            Re: passing session variable in v10

                            See my response at http://msgboard.alphasoftware.com/al...ad.php?t=80807.

                            I think I proved that you cannot set a session variables value in a URL in V10. Which I happen to think is a good thing.

                            because the link opens an ajax window, i cant see the value being passed to the URL.
                            Yes you can, even if the address bar is hidden, you can include this on your target page:

                            save_to_file(Request.Request_URI,"c:\test.txt") which would dump out something like: /index.html?foo=bar&this=that
                            Steve Wood
                            See my profile on IADN

                            Comment


                              #15
                              Re: passing session variable in v10

                              because the link opens an ajax window, i cant see the value being passed to the URL.
                              Yes you can, even if the address bar is hidden, you can include this on your target page:
                              what i meant was i coudnt physically see this myself, therefore can not see if the value is being added to the url

                              is there a way to check this?

                              Comment

                              Working...
                              X