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

Forward argument from one component to a child

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

    Forward argument from one component to a child

    Hi,

    I have a component (read only grid) based on a filtered MySQL query. On this grid I have an action javascript that opens a child UX component. The filter in the grid should be forwarded to the child UX component as an argument as I want to use it in the ondialoginitialize event.

    Any idea on how to go forward with this? I don't find anything...

    Thanks!

    #2
    Re: Forward argument from one component to a child

    I would have thought there was an easier way, but the only way I can think of is to bind your UX argument to a Javascript function in the grid component. Just create a Javascript function in your grid component like this:

    Code:
    function GetArgument (rowNum)
    {
          return {grid.Object}.argumentValue('myArg');
    }
    Your UX argument binding definition would be:

    Javascript:GetArgument

    Comment


      #3
      Re: Forward argument from one component to a child

      Great, I will try this, thanks!

      Comment


        #4
        Re: Forward argument from one component to a child

        Thanks again, it didn't really work as my grid does not include an argument, just an SQL filter (a base filter).

        First I tried the to grab the filtered value from the first row (one value should be the same in all records as the grid is already filtered) but I just realised that if the filter does not return any rows it does not work.

        Is there any other way I could collect the "where" case of the sql in a filtered grid? Or any other suggestions, maybe I should think in a different way?

        thanks again
        Robert

        Comment


          #5
          Re: Forward argument from one component to a child

          Are you saying that the grid's filter is built into the SQL statement? For example, "where State = 'CA'" and you want to pass the entire where clause to the UX component? Can you provide an example and describe what you want the UX component to do with the where clause?

          Comment


            #6
            Re: Forward argument from one component to a child

            Thanks again Dave for following up on this, I am clearly not doing a good job on explaining it... I will try my best to provide the details, maybe I should rethink on how I am doing it...? A lot of sections in my project is built in the same way so getting this to work would be great! It is probably easy but I am just getting stuck!

            The whole situation is that I have a lot of projects, each with their own "projectID". When viewing the project I open a page layout that collects the "projectID" as an argument.

            Top Layer - Page Layout Component
            The page layout contains several components, one of these is a grid called "notes", but there are several and all are working in the same way.

            Sub layer 1 - Grid - "Notes"
            This is a simple grid filtered on the "projectID" argument in the page layout component. The link type used is "base filter".
            Some grids on this layer is linked as "Link" as they are grids with details views to enter new records. By doing this all new records will carry the "ProjectID" and get properly linked to the project. However, I am generally not using a grid with detail view anymore as the UX component is so versatile as a detail view. Instead, I am placing an action button "new record" that opens the next sub layer.

            Sub layer 2 - "New Record"
            This is a UX component that I use to enter new record, like a "detail view". The problem is that I need the "projectID" in this component, but it is not used in it's parent more than in the filter so I don't know how to retrieve it from the top layer. I don�t lie using session variables as there might be several "Project Layouts" open at the same time.

            Maybe this makes sense? Thanks for the feedback on this, VERY appreciated!!!

            Comment


              #7
              Re: Forward argument from one component to a child

              Hi Robert,

              I have a much better understanding, but I'm not quite clear on a couple of things. Do you link a projectId field in the grid component to the "projectID" argument in the page layout component? And do you also define a base filter right below where you specify the link between the page layout and grid?

              Does the UX component just need to get to the projectId argument from the grandparent (page layout component)?

              Comment


                #8
                Re: Forward argument from one component to a child

                Originally posted by DaveF View Post
                Do you link a projectId field in the grid component to the "projectID" argument in the page layout component?
                I don't use a "link" as the grid is read only and no new records can be created directly on the grid but only from the UX component.

                Originally posted by DaveF View Post
                And do you also define a base filter right below where you specify the link between the page layout and grid?
                Yes, the grid has got a field called "projectID" and the grid is filtered using a base filter: sublayer1grid.ProjectID = :projectID

                Originally posted by DaveF View Post
                Does the UX component just need to get to the projectId argument from the grandparent (page layout component)?
                Yes, I need to know the argument from the grandparent, alternatively the base filter from the parent which is the same.

                Thanks a lot for helping out!!!

                Comment


                  #9
                  Re: Forward argument from one component to a child

                  Hi Robert,

                  Sorry, but I can't find any "built-in" technique to do what you are trying to accomplish. You can get the grandparent object and then get to the project id argument from the client side of the UX component using {dialog.object}.getTopParentObject(), but probably not until after the server-side onDialogInitialize event has executed.

                  I did notice that the e.rv object inside the grid's onGridInitialize event contains the base filter expression. It is called e.rv.__baseFilter. You could pass this on to the UX component, but Alpha's recommendation is to use the new "request" object instead of the older e.rv construct. I could not find the base filter inside the "request" object.

                  Comment


                    #10
                    Re: Forward argument from one component to a child

                    Robert, you can pass the project ID along as an argument to any depth of ux's and grids. Give me time to write-up how it is done and I will post back here.
                    p.s. It does require a V12 build after 3/19/2014, I'm not sure if it is Build 2036 or the one after that that gives you what you need. My next post will show you how.
                    Last edited by RichCPT; 03-27-2014, 10:19 AM.

                    Comment


                      #11
                      Re: Forward argument from one component to a child

                      Fantastic, thanks to both of you!!!

                      Video D24 basically shows my situation except that my grid is already filtered so the "new record" should be linked to that filter. I do think there should be an option to "link" when using the action javascript, I will suggest it to A5.

                      Looking forward to your next post Rich :)

                      Comment


                        #12
                        Re: Forward argument from one component to a child

                        Robert,
                        Look for the ng post "SOLVED: passing argument between grid and UX and Lookup Grids " that I just posted. Hopefully, you can use some of the parameter passing techniques in it for what you want to do.

                        Edit: link to post http://msgboard.alphasoftware.com/al...d-Lookup-Grids
                        Last edited by Al Buchholz; 03-28-2014, 03:40 PM.

                        Comment


                          #13
                          Re: Forward argument from one component to a child

                          Robert, in response to your post # 11: If you are tyring to set a visible or a hidden control in the UX to a passed-in argument then in the OnDialogInitialize
                          e.control.your_control = e.arguments.Find("your_arg_name").data

                          To set the control's value only when you are in add new record mode then put an "IF" statement around it like this:
                          if e.rv.__dialogSpecialMode = "newGridRow:"
                          e.control.your_control = e.arguments.Find("your_arg_name").data
                          end if

                          In the sample I posted in another thread, you can modify the "M36_UX2_Called" UX by adding a textbox with a control id of "RcvdArg" and then adding the following xbasic to OnDialogInitialize:

                          e.control.RcvdArg = e.arguments.Find("TLArg").data

                          Run the "M36_Main" in working preview, click "Open Grid 'G1_Caller'" button, click any one of the "Call UX" buttons and the added control will show the passed "TLArg" value - "Evan".
                          Last edited by RichCPT; 03-29-2014, 11:32 AM. Reason: Additonal info: setting control conditionally in "Add record" mode

                          Comment

                          Working...
                          X