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

Dialog2 V11 how to read dialog values from an embedded object

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

    Dialog2 V11 how to read dialog values from an embedded object

    Hi,

    I have a dialog. This dialog contains a Dropdown, a button and a Grid as an embedded object. The embedded Object is defined that it appears " When the button is clicked"
    The Grid of the embedded Object depends on the value selected from the dropdown box: This value is an SQL Argument.

    I found that under Controls>select Embedded Object>Component Definition> Override settings>Override settings> I can set the arguments like
    Code:
    Arguments[1].value = value1
    Arguments[2].value = value2
    This works fine if it is a hard coded value string. But how can I enter the value of the dropdown box here?
    I am looking for somthing like:
    Code:
    Arguments[1].value = {dialog.object}.getValue('Dropdown1')
    Arguments[2].value = {dialog.object}.getValue('Dropdown2')
    The above code does not work. Can anybody tell me how I can accomplish this?
    Thank you

    #2
    Re: Dialog2 V11 how to read dialog values from an embedded objekt

    i have not tried to set up a test case to duplicate your situation, but i think you might be taking the wrong approach.

    since you are only showing the embedded Grid when a button is pressed (rather than when the dialog is initially rendered), you could just as easily have added a standard button to the dialog and then used action javascript to define the button action to open a grid and shows the grid in a div on the dialog. (when you use action javascript to open a grid you can specify the target for the child grid - the default is a pop-up window, but it can also be a div)

    the benefit of using this approach is that you can easily set the Grid link or filter to dynamically reference the values in the dropdown box. you will not need to write any code.



    2. use a button on

    Comment


      #3
      Re: Dialog2 V11 how to read dialog values from an embedded objekt

      Hi Selwyn,

      Thank you once again for your help!
      Could it be that a part of your answer is missing?:
      Originally posted by Selwyn Rabins View Post
      2. use a button on
      But I have the same situation with your suggestion as with the embedded grid, the "Open Grid Genie" is the same.

      - in the onClick() Event I added a new Action "open Grid Component�
      - I selected the Grid and this dialog is the same as with the embedded object.

      I can't use the "link" or for that matter the �filter� or �Order� option for my purpose, as I am not trying to link, order or filter (to) a column of the Grid. The selected grid is build upon a stored procedure, I need to set the e.arguments for this call. But if I set the e. arguments either in the onSelect() Event of the dropdown or in the onClick() event of the button, they do no longer exist in the onSQLSelectQuery function of the grid. It seems that even if it is not an embedded object per definition the dialog components (dropDowns) have a totally different "e" as the grid.

      This was also the main reason why I wanted to use above mentioned Override function but I can't figure out how to enter here the values of the 2 Dropdowns but it works fine if I hardcode the values at this point (which of course is not what I want to do.

      So thank you for your suggestion anyway!

      Comment


        #4
        Re: Dialog2 V11 how to read dialog values from an embedded objekt

        Hi Selwyn,

        a funny thing happens when I add a button to a dialog and call it "zur�ck" (German for "Back"). The Button text does not seem to like the "�" and changes the whole thing straight away to "Zur�ƒ�’�†�€™�ƒ�€š�‚¼ck" and whenever I click on the "Button Text" field again, e.g. to change the text the system hangs (I configured the Alpha5.exe process to create a dump file straight away when the process hangs, so it is sending info to the dump file currently the whole time) and each time when it recovers the button text gets longer. the second time round its "zur�ƒ�’�†�€™�ƒ�€ â�‚��„��ƒ�’â�‚�� �ƒ¢â�€š¬â�€ž¢�ƒ�’�†�€™�ƒ¢â�€š¬�…¡�ƒ�’â�‚�š�ƒ�€š�‚¼ck" and so on.

        I tried the same thing in a different dialog and the same thing happened. Can you reproduce this? When I write "Zuruek" instead or anything else without ��� (reproduceable for all three), all is OK.
        Thanks!

        Comment


          #5
          Re: Dialog2 V11 how to read dialog values from an embedded objekt

          try using <a5:r>back</a5:r> for the button text.
          then go to the language definitions property and add this entry

          back=zur�ck

          Comment


            #6
            Re: Dialog2 V11 how to read dialog values from an embedded objekt

            Perhaps this video will help


            http://www.ajaxvideotutorials.com/Ji...BEDDEDGRID.swf

            Comment


              #7
              Re: Dialog2 V11 how to read dialog values from an embedded objekt

              Hi Selwyn,

              Happy new year!
              I was on holidays for a while now, so I only could reply now.

              Originally posted by Selwyn Rabins View Post
              try using <a5:r>back</a5:r> for the button text.
              then go to the language definitions property and add this entry
              back=zur�ck
              Above works fine, thank you!
              Thank you as well for the video and it sounds simple enough but sadly
              Code:
              {dialog.EmbeddedGrid_G1}.gridFilterSet('','',field1 +'|||c|arg_field1\n'+field2+'|||c|arg_field2');
              does not work for me.

              It works fine if I actually use the arguments in the Query>Stored Procedure> SQL Statement like
              Code:
              EXEC [SP_myStoredProcedure] @field1 = :field1, @field2 =:field2
              , then I am able to add the two arguments to the SQL argument. But if I only use a dummy SQL statement in order to retrieve the column headers to be able to select the fields (see http://msgboard.alphasoftware.com/al...472#post593472 ), this does not work although I defined the SQL arguments under Grid>Query>define Arguments e.arguments.XML does not contain anything
              Code:
              <SQLArguments>
              </SQLArguments>
              and I cannot add anything in this way. Even more, I noticed if I use the arguments in the SQL statement I can only add new arguments with your code but if arg_field1 and arg_field2 are already existent, it does not change the value of these arguments.

              So I have a bit of an problem here as I need to proceed as in above mentioned thread but then I cannot use your example. I do not understand why it matters what lies behind the stored procedure call. The only thing that should matter is what is returned to Alpha Five, which is a table no matter if done with a simple Select statement or complicated T-SQL as Stored procedure definition.

              Thank you for your help!

              Comment


                #8
                Re: Dialog2 V11 how to read dialog values from an embedded objekt

                are you running the pre-release build, or the official release?

                this syntax will only work in the pre-release build as the {dialog.embeddedGrid_G1} placeholder would not be translated into a real object name otherwise.
                {dialog.EmbeddedGrid_G1}.gridFilterSet('','',field1 +'|||c|arg_field1\n'+field2+'|||c|arg_field2');

                {dialog.embeddedGrid_G1} placeholder is just a shortcut for the real object name, which would be

                window['G1_GridObj'].gridFilterSet(......).

                I can tell you with 100% certainty that the gridFilterSet() method works exactly as shown.

                Comment


                  #9
                  Re: Dialog2 V11 how to read dialog values from an embedded object

                  Hi Selwyn,

                  the last patch I installed was the pre-release from 2011-12-16. I saw that there was a new patch yesterday so I exited A5 and installed it. After finishing installation I debugged the code as shown in your video and Alpha5 crashed while I was adding an argument see:
                  A5_crash_duringDebugging_dump_20120111.JPG
                  I have a dump file if you’re interested in it, but it is too large to send by mail.
                  Anyway, I could not reproduce the crash, after starting Alpha 5 and debugging again it worked just as you said. Thank you.

                  One thing I noticed was, that although I was able to change the arguments and the correct data was shown in the embedded grid. When I clicked on "Export to Excel" the data exported was the data from the initially loaded embedded grid and not the one currently shown. Does it not export the data presented in the UI but get the data new from the database? But even so it should still know the correct SQL arguments. Do I have to handle the export myself when using stored procedures or embedded grids? If so, do you have an example how to do that? How can I debug the Excel export?

                  Thank you!

                  Comment


                    #10
                    Re: Dialog2 V11 how to read dialog values from an embedded object

                    Hi Selwyn,

                    when I put this dialog as a page of my tabbed UI and open the page I get an Error and the onClick Event no longer works. Even when I put an alert() as first thing in my click event this is not fired.
                    Here is the Error: A5_error_tabui_embGrid_20120116.JPG
                    But as soon as I comment out the filter set method of the embedded grid
                    Code:
                    //{dialog.EmbeddedGrid_G1}.gridFilterSet('','',selectedYear +'|||c|year');
                    it works fine.

                    Do you know why this is? And do you have a solution?
                    Thank you!
                    Attached Files

                    Comment


                      #11
                      Re: Dialog2 V11 how to read dialog values from an embedded object

                      Hi,

                      does anybody know what the problem is with the above post #10? I only have the problem when the dialog is opend within the Tabbed UI.
                      Please help. Thank you!

                      Comment


                        #12
                        Re: Dialog2 V11 how to read dialog values from an embedded object

                        In the command below, the placeholder '{dialog.EmbeddedGrid_G1}' is a special type of placeholder.
                        Support for this type of placeholder was only introduced in a very recent patch.
                        Internally, the placeholder is resolved to the 'real' object name.

                        So for example, when you write this:

                        Code:
                        {dialog.EmbeddedGrid_G1}.gridFilterSet('','',selectedYear +'|||c|year');
                        Alpha Five converts that (at run time) to:

                        Code:
                        window['{dialog.componentname}_G1_GridObj'].gridFilterSet('','',selectedYear +'|||c|year');

                        When support for this new type of placeholder was introduced (in a very recent update), the placeholder was only decoded into the 'window' syntax
                        shown above if the Dialog was loaded when the page was loaded. There was no support for decoding the placeholder
                        when the Dialog was loaded VIA AN AJAX CALLBACK (as is the case when the Dialog is loaded from a tabbed UI).

                        So the reason you are getting an error in the tabbed UI, is that the placeholder is not getting resolved. Therefore javascript is seeing
                        this '{dialog.EmbeddedGrid_G1}', which it tries to interpret as a JSON object. Of course, this is not a JSON object, hence the error message.

                        So, the solution is

                        a) don't use the special placeholder '{dialog.EmbeddedGrid_G1}'. Instead, resolve the embedded grid object name yourself by using this
                        in your code:
                        window['{dialog.componentname}_G1_GridObj'].gridFilterSet('','',selectedYear +'|||c|year');

                        or b), download the latest pre-release build, in which we have fixed the issue.

                        Comment


                          #13
                          Re: Dialog2 V11 how to read dialog values from an embedded object

                          Hi Selwyn,

                          thank you so very much!
                          The latest build I found on the pre-release website, was from "Jan-25-2012 9:04 am (build 2384-3863)" so I used option a) and that works fine.
                          Thank you again.

                          Comment

                          Working...
                          X