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

Populate A Dialog with data from one or more tables .. about as useful as a pet rock

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

    Populate A Dialog with data from one or more tables .. about as useful as a pet rock

    I have tried all day to get this to work and always the same result... "Populate Dialog from Tables Action did not run because of an error. Variable for Primary key values not found."

    I have a UX with some data bound fields and three embedded grids that get called when I click on a link within another grid. The grids show up fine but for some reason that [use any name you want here] Populate Dialog... feature will not work. The fields on the UX stay blank.

    I watched D20 several times but it does not help that they decided to use 'Specify Now' as the primary key source.

    Why???? How many people will be hard coding a primary key vs how many need to do this dynamically????? Well, Video D21 answers that with "that's not pretty useful".

    So if I do NOT want to use 'Specify Now' and instead want to ReadFromVariable, what variable can I use and how can I set it when calling the UX from another compoent with an onClick event? I've tried page variables and arguments and nothing.

    #2
    Re: Populate A Dialog with data from one or more tables .. about as useful as a pet r

    Originally posted by josevelez View Post
    I watched D20 several times but it does not help that they decided to use 'Specify Now' as the primary key source.

    Why???? How many people will be hard coding a primary key vs how many need to do this dynamically????? Well, Video D21 answers that with "that's not pretty useful".

    So if I do NOT want to use 'Specify Now' and instead want to ReadFromVariable, what variable can I use and how can I set it when calling the UX from another compoent with an onClick event? I've tried page variables and arguments and nothing.
    That, along with the way too many error messages caused me to remove v12. My time is too valuable to try to figure it out. I mentioned to Selwyn that Alpha needs to think about the videos as a user things, not as an Alpha programer thinks. Probably wasn't too happy with me.
    Last edited by forskare; June 07, 2013, 01:43 PM.
    TYVM :) kenn

    Knowing what you can achieve will not become reality until you imagine and explore.

    Comment


      #3
      Re: Populate A Dialog with data from one or more tables .. about as useful as a pet r

      Jose,

      Just to clarify... you have a UX with 3 embedded grids. You call the UX from a grid component. You want the UX to open with data and the key to the UX data is from the current record of the calling grid. Is this right?

      Comment


        #4
        Re: Populate A Dialog with data from one or more tables .. about as useful as a pet r

        Not sure about the pet rock simile but...

        What you want to do is call a UX Component from a Grid Component and , from that Grid Component, send a variable containing data that will act as a key to get data for the UX Component.

        So... you must create a variable in your Grid that will be available in your UX. Since, in your UX, you are working with a Server-side event, that points us in the direction of a Session variable.

        Let's say you are using a button, available on each row of your grid to open your UX.

        To create a session variable from your Grid, you could use the Client-side event onRowSelect... as follows:

        Code:
        //place this Javascript in your code, and then reference the rowNum variable.
        var rowNum = {Grid.Object}._selectedRow;
        var userId = {grid.Object}.getValue('G','USER_ID',rowNum);
        
        var addlData = '_currKey='+userId
        
        {grid.Object}.ajaxCallback('G','{Grid.RowNumber}:all','getCurrId','',addlData,{});
        This code gets the current row of the grid, then gets the value of the USER_ID field on that row.

        Then sets a variable "addlData" with an expression that can be used with an Ajax Callback, for the Additional Data section of the callback.

        The Ajax Callback, "getCurrId" gets defined in the Xbasic functions section of the grid...

        Code:
        function getCurrId as c (e as p)
        'This function will handle the Ajax callback.
        
        session.myCurrKey = e._currKey
        
        end function
        Here, we set a session variable "session.myCurrKey" with the value of "_currKey" that was passed in with the Ajax Callback.

        Now we have a session variable.

        Back into your UX, set the Primary Key Source to ReadFromVariable and set the variable to session.myCurrKey.

        Hope that helps.

        David

        Comment


          #5
          Re: Populate A Dialog with data from one or more tables .. about as useful as a pet r

          David,

          That worked BEAUTIFULLY!!!!!!!!!!!!!!!!

          Thank you SO much!

          What I meant by pet rock is that for newbies like me that have no experience with creating session variables like you demonstrated, the 'Populate A Dialog with data from one or more tables' is not very helpful. It seems inconsistent that in some situations I can easily open up a grid or UX in the desired fashion just fine but for this specific way I have to struggle to figure it out.

          The videos really don't help with examples that even they admit are not very useful. It would have been more appropriate for the video to demonstrate something along like what you did and if not at least explain that this is how is should be done.

          When I try to use the 'Populate A Dialog with data from one or more tables' builder and I see a dropdown choice that has 'ReadFromVariable' I am expecting to be able to use arguments or page variables as well, but that does not seem to be the case.

          Untitled.png

          Alpha needs to provide more documentation, better examples, and make more contributions to this forum to help newbs like me. After all, if we are not successful then Alpha will not be because either we will walk away with a sour experience using Alpha and/or dump it altogether and look at alternatives. This experience alone has already got me using a demo for a competing product which I absolute love already. Time will tell.

          Thanks again for your help! Very generous of you.

          Jose

          Comment


            #6
            Re: Populate A Dialog with data from one or more tables .. about as useful as a pet r

            So glad it helped. Alpha Anywhere is amazingly powerful. Once you get the idea of passing around data between Server-side and Client-side then it opens up great possibilities.

            Comment


              #7
              Re: Populate A Dialog with data from one or more tables .. about as useful as a pet r

              David,

              I've run into a snag. I cannot seem to pull up a different record, the session variable sticks with the original id. How can I get the session variable to change. I thought the onRowSelect would handle that but it does not seem to work.

              It still boggles me that I cannot use a page variable. That would have been so much easier.

              Any thoughts?

              Comment


                #8
                Re: Populate A Dialog with data from one or more tables .. about as useful as a pet r

                Try this...

                Instead of...

                Code:
                //place this Javascript in your code, and then reference the rowNum variable.
                var rowNum = {Grid.Object}._selectedRow;
                var userId = {grid.Object}.getValue('G','USER_ID',rowNum);
                use e.rowNumber...

                Code:
                var userId = {grid.Object}.getValue('G','USER_ID',e.rowNumber);
                to help get your current value.

                I always forget where e.rowNumber is available.

                See if that helps.

                Comment


                  #9
                  Re: Populate A Dialog with data from one or more tables .. about as useful as a pet r

                  Dave,

                  No luck.

                  It always seems to give me the first result from the query. I noticed that from the two different grids I have tried this with, both grids have 10-20 records and the first record is the only one that shows up when I load the UX.

                  Should it be this difficult to do this???

                  My pet rock opinion stands on this 'Populate A Dialog with data from one or more tables' feature. It would be nice if Alpha come chime in here.

                  Comment


                    #10
                    Re: Populate A Dialog with data from one or more tables .. about as useful as a pet r

                    I'd have to see your UX and Grids at this point. You say...

                    both grids have 10-20 records and the first record is the only one that shows up when I load the UX.
                    When the UX is loaded, are there controls on that UX (not grids) that show the correct records, as passed in from the calling grid?

                    You have a main grid, which calls a UX and passes a key from the grid into the UX. The UX displays data based on that key from the grid.

                    Is this working?

                    From what you wrote I'm a little confused. You say both grids have 10-20 records... but at this point I'm just concerned with the UX showing the correct record based on the main grid row value.

                    Comment


                      #11
                      Re: Populate A Dialog with data from one or more tables .. about as useful as a pet r

                      David,

                      Ok I figured one thing I was doing wrong. I did not realize until checking out the Alphapedia page on the {grid.Object}.getValue Method that I needed to capitalize the name and part parameters.

                      I fixed that. Now what happens is that I pull up the UX for a record it still shows the first record that was in the original grid but when I refresh the page the correct records magically shows up! So it is working but not without refreshing the page. I'm not sure what is going on there.

                      Comment


                        #12
                        Re: Populate A Dialog with data from one or more tables .. about as useful as a pet r

                        I thought some pics would help clarify..

                        1.png2.png3.png

                        Comment


                          #13
                          Re: Populate A Dialog with data from one or more tables .. about as useful as a pet r

                          Yeah, one thing to get used to is treat posted code exactly as posted... except for IDs and variable stuff like that. If it's upper cased then do that, etc.

                          So... how are you calling your UX. You have your main grid displayed. The Grid onRowSelect event does the Ajax Callback to set the session variable. Then... how does the UX get opened?

                          Plus... you're running your main grid from a tabbed ui inside a navigation system? Is that right?

                          Comment


                            #14
                            Re: Populate A Dialog with data from one or more tables .. about as useful as a pet r

                            I decided to not use the tabbed ui... I was having too many problems with page layout components not refreshing.

                            The main grids are running inside of simple A5 pages. I am clicking a field (the underlined well name) that has the onClick event set to open the UX that is inside an a5 page.

                            Do these pics help?

                            1.png2.png

                            Comment


                              #15
                              Re: Populate A Dialog with data from one or more tables .. about as useful as a pet r

                              It sure would be nice if someone from Alpha could provide a USEFUL example of how to use this feature. Either the component does not work as advertised or the documentation is next to none.

                              Comment

                              Working...
                              X