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 grid search criteria to a dialog window from an action button

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

    Passing grid search criteria to a dialog window from an action button

    I've checked around and maybe its out there but I can't find it...

    I have a standard "customer" grid with a search. If the user does not see the customer on the grid I've added an action button to open a dialog with the fields from the customer table. I would like to pass the search data over to the dialog in order to keep the user from re-typing the customer information.

    Can someone point me in the right direction?

    Note: I saw the videos about LINKING a dialog field to a grid and having it populate the field. The problem is that if you want to link multiple fields you must complete them all during the search and it narrows down the results. Is there an AND/OR option for linking?
    Attached Files
    Thanks,

    Roderick Silva
    [email protected]

    About Me: rodericksilva.com
    Twitter: rodericksilva

    #2
    Re: Passing grid search criteria to a dialog window from an action button

    I think I'm getting warmer. The answer lies somewhere in: {grid.Object}.getValue and {grid.Object}.setValue

    I'm working on it and will post an answer for us beginner xbasic guys.
    Thanks,

    Roderick Silva
    [email protected]

    About Me: rodericksilva.com
    Twitter: rodericksilva

    Comment


      #3
      Re: Passing grid search criteria to a dialog window from an action button

      You're on the right track. BTW, {grid.Object}.getValue and {grid.Object}.setValue are JavaScript, not xbasic.
      Peter
      AlphaBase Solutions, LLC

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


      Comment


        #4
        Re: Passing grid search criteria to a dialog window from an action button

        Still struggling...switched to a popup grid to keep things simple.

        Thanks, Peter. It took quite a while to figure out my direction.

        On my main grid onSearchSubmit: fname = {grid.Object}.getValue('S','CUSTOMER_FIRSTNAME');
        On my popup grid onGridRender: {grid.Object}.setValue('G','CUSTOMER_FIRSTNAME',parent.fname); ....I've also tried just fname

        I don't get an error but I don't get anything. Ha.

        I put a debug(1) on server side CanSearch but fname is empty. I tried var fname but that doesn't work either.
        Thanks,

        Roderick Silva
        [email protected]

        About Me: rodericksilva.com
        Twitter: rodericksilva

        Comment


          #5
          Re: Passing grid search criteria to a dialog window from an action button

          I got it to work in a totally different way...

          On the Server Side on CanSearch:


          fname = ""
          lname = ""
          phone = ""
          email = ""
          username = ""

          fname = e.SearchDataSubmitted.CUSTOMER_FIRSTNAME
          lname = e.SearchDataSubmitted.CUSTOMER_LASTNAME
          phone = e.SearchDataSubmitted.CUSTOMER_PHONE
          email = e.SearchDataSubmitted.CUSTOMER_EMAIL
          username = e.SearchDataSubmitted.CUSTOMER_USERNAME


          Then on the grid in the fields Initial Value I just put "=fname", etc.

          This will only work if the user actually clicks the Search button. If the user hits the enter key it does not set the variables. The work-around was to edit the Action Button javascript and add: {grid.Object}.submitSearchForm(); before popping the new grid open.

          *** UPDATE
          OK so it works great in the Working Preview but not in Firefox (even after publishing).
          I'm stuck again!!
          Last edited by Roderick; 04-17-2012, 03:44 AM.
          Thanks,

          Roderick Silva
          [email protected]

          About Me: rodericksilva.com
          Twitter: rodericksilva

          Comment


            #6
            Re: Passing grid search criteria to a dialog window from an action button

            I'm interested in what you are doing. I will be trying something similar with the search criteria soon. I am currently populating a dialog's initial values from a row in a grid by setting session variables based on data in the row before opening the dialog, and that's working nicely. When I get to the point of trying to populate a dialog with data from a search submitted, I would be trying to do it via session variables. Is it possible that's what you need to do? I see that there is info by Alpha in the CanSearch event about setting session variables.
            Carol King
            Developer of Custom Homebuilders' Solutions (CHS)
            http://www.CHSBuilderSoftware.com

            Comment


              #7
              Re: Passing grid search criteria to a dialog window from an action button

              Hey Carol,

              I tried this in the Server Side CanSearch: Session.fname = e.SearchDataSubmitted.CUSTOMER_FIRSTNAME

              the session.fname shows a value in debug(1)

              then I tried

              =session.fname in the Initial Value of the field in the pop-up grid but its not found.

              When I try:

              =fname it works in Working Preview but not in the browser after publishing.

              Grrrrrrrr! I was up all night trying to figure it out.
              Thanks,

              Roderick Silva
              [email protected]

              About Me: rodericksilva.com
              Twitter: rodericksilva

              Comment


                #8
                Re: Passing grid search criteria to a dialog window from an action button

                Well, that's irritating for you (and for me in future). When I was thinking ahead about doing something similar, I found myself wondering about the CurrentGridFilter() function that can be used when opening a report. And I wondered if that CurrentGridFilter() function is available to use as a filter for opening a child grid or dialog, also. And if it is, can pieces of it be accessed for setting default values in the child? Someone far more savvy than me might be able to provide insight about this whole concept.
                Carol King
                Developer of Custom Homebuilders' Solutions (CHS)
                http://www.CHSBuilderSoftware.com

                Comment


                  #9
                  Re: Passing grid search criteria to a dialog window from an action button

                  I just did a search for CurrentGridFilter in the Alphapedia and it IS indicating that it can be used to open a child grid, too. But I know that doesn't help with your problem with initial values. There's not a lot of info about what is contained in the CurrentGridFilter and how to get at it. Perhaps that can be seen with debug.
                  Carol King
                  Developer of Custom Homebuilders' Solutions (CHS)
                  http://www.CHSBuilderSoftware.com

                  Comment


                    #10
                    Re: Passing grid search criteria to a dialog window from an action button

                    You need to do it the other way around. You need to start at the dialog and push the values to your grid (embedded the dialog)
                    {dialog.EmbeddedGrid_NAMEOFGRID}.gridBaseFilterSet(FIELD IN THE DIALOG, '',''); - The problem here is the Dialog2 began life as a servant to the grid - even today most of the functions that take it past that point are either feature packs or Subscriber benefits - so if like me you don't have a subscription you have a basic product you have to do it yourself and that's not a bad thing in he long run - I can't help you beyond that as the tools are not available in the standard product. You may want to contact Martin Heller and ask him. Here is something I found in the wiki (WOW) http://wiki.alphasoftware.com/How+to...dBaseFilterSet - it does work - just need to think i through.
                    Insanity: doing the same thing over and over again and expecting different results.
                    Albert Einstein, (attributed)
                    US (German-born) physicist (1879 - 1955)

                    Comment


                      #11
                      Re: Passing grid search criteria to a dialog window from an action button

                      Pete, thanks for the help.

                      I had to find a workaround in order to keep moving forward but it is something that I will need to revisit in a couple of days. Plus, once this is up and running I want to go back and polish it all

                      I'm not 100% on what you said. You said to start with the dialog and push to the grid but to embed the dialog?

                      I do have a subscription. Where should I start looking?
                      Thanks,

                      Roderick Silva
                      [email protected]

                      About Me: rodericksilva.com
                      Twitter: rodericksilva

                      Comment

                      Working...
                      X