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

How to pass a variable to a dialog?

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

    How to pass a variable to a dialog?

    Greetings all,

    I am trying to pass a variable from a link on a grid to a dialog. Please see the attached screenshot. I am using the variable to pass a path to the email_send() function - the variable contains what will be the path for the attachment. I have tested this by just redirecting it to an a5w page with nothing but the email_send() function properly filled out (by me) as a test. There were no fields for the user to enter any data like subject, message body etc. This all worked perfectly and the variable that I passed to the function worked great and the attachment was sent with the email as it should be. Now that I have expanded this concept to a dialog so the user can enter info, the dialog keeps telling me the variable is not found when it is trying to be used in the email_send() function. But, it works if I just send it to that original a5w test page.

    So, long prelude to a short question....How do I pass a variable from a grid "link" field to a dialog so I can use that variable in the dialog?

    Thanks,

    Jeff

    later: the variable I am referring to is vpdfpath that is defined in the link address builder line on the screenshot attached.
    Last edited by jkletrovets; 03-28-2008, 12:33 AM.

    #2
    Re: How to pass a variable to a dialog?

    When inserting a component in an A5w page you can override component properties, such as values of fields... So you can just set the value or initial value of a field to the page variable passed in from the grid.

    Although there may well be an easier way of handling this!

    Comment


      #3
      Re: How to pass a variable to a dialog?

      vpdfpath will end up being a page variable as Andrea said. But it is available to the page, and only one of the events within the dialog. The only event where it is visible is the Initialize event. So, write this in the initilize event:

      currentform.controls.vpdfpath = vpdfpath

      and that will store the value in a dialog control (that you will create) and it can be used later. Add some error checking to that code in case the value is missing.

      or session.vpdfpath = vpdfpath if you want to save it to a session variable for general use and not store it in the dialog.

      Some other options are, if the path is based on something consistent for a given user, you can set a session variable when they log in. And if it is always the same value, you can use an Alias.
      Steve Wood
      See my profile on IADN

      Comment


        #4
        Re: How to pass a variable to a dialog?

        Originally posted by Steve Wood View Post
        vpdfpath will end up being a page variable as Andrea said. But it is available to the page, and only one of the events within the dialog. The only event where it is visible is the Initialize event. So, write this in the initilize event:
        Thanks for that, I knew there had to be an easier way! I know there's stuff you can do to dialogs and grids from the a5w page but I prefer to sort everything out in the component itself!

        Comment


          #5
          Re: How to pass a variable to a dialog?

          Steve and Andrea,

          Thanks for the replies.

          Utilizing this in the initialize event did the trick

          currentform.controls.vpdfpath = vpdfpath
          Thank you Steve!!

          Is there somewhere in the help file that would have told me this? I searched there and on the board for a long time with no luck. Just wondering if it was there and I couldn't see/find it.....or if that subject knowledge comes from just more experience with WAS?

          Thanks again...

          Jeff

          Comment


            #6
            Re: How to pass a variable to a dialog?

            I do this in the Initialize event also. But one problem I have encountered in these dialogs is if the page is refreshed, then sometimes the data is lost. To combat this, I also put the same lines in the Activate event which is fired every time the page is run.
            Eric

            Alpha Five Websites
            longlivepuppies.com
            socialservicenetwork.com
            -------------------------------------------------
            socialservicenetwork.org

            Comment


              #7
              Re: How to pass a variable to a dialog?

              Eric

              Thanks for the heads up on that.

              Jeff

              Comment


                #8
                Re: How to pass a variable to a dialog?

                Originally posted by EricN View Post
                I do this in the Initialize event also. But one problem I have encountered in these dialogs is if the page is refreshed, then sometimes the data is lost. To combat this, I also put the same lines in the Activate event which is fired every time the page is run.
                Wouldn't this only need to be in the Activate event (otherwise it fires twice) or are page variables only ever picked up in the initialize event?

                Comment


                  #9
                  Re: How to pass a variable to a dialog?

                  Can't remember for sure. But I believe I tried this in Activate only and it didn't work when page was run first time. When I refreshed, then data was displayed. I could be wrong here.

                  But I do know that it works when I place it in both Initialize and Activate events. I have several dialogs which require user interaction (To, Subject, Message) and I pre-populate several other controls, including my "Anti-Robot."
                  Last edited by EricN; 03-28-2008, 01:20 PM.
                  Eric

                  Alpha Five Websites
                  longlivepuppies.com
                  socialservicenetwork.com
                  -------------------------------------------------
                  socialservicenetwork.org

                  Comment


                    #10
                    Re: How to pass a variable to a dialog?

                    Originally posted by EricN View Post
                    Can't remember for sure. But I believe I tried this in Activate only and it didn't work when page was run first time. When I refreshed, then data was displayed. I could be wrong here.

                    But I do know that it works when I place it in both Initialize and Activate events. I have several dialogs which require user interaction (To, Subject, Message) and I pre-populate several other controls, including my "Anti-Robot."
                    Ah yes I think once it's initialised, it then gets passed on when the form is submitted / reloaded.... I do seem to remember experimenting with this a while ago, although I think I had to make the page variable the same name as the field/control though but am not 100% sure...
                    Last edited by NoeticCC; 03-28-2008, 04:22 PM.

                    Comment

                    Working...
                    X