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

Automatically perform button "onclick" event when GRID loads

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

    Automatically perform button "onclick" event when GRID loads

    I have a set of actions attached to an "onclick" event within a GRID (technically, attached to an image in a field in the grid).

    Interactively the onclick event works fine.

    I would like to use a "client-side event" such as "onGridRenderComplete" to perform the equivalent of a "click".

    I've tried the suggestions I can find from the forum, such as:


    So I have an "onGridRenderComplete" command of:

    // ===
    // = My simple javascript function that in turn calls an "onclick" event
    // ===
    launch_greeting_page();


    The actual function looks like:

    function launch_greeting_page()
    {
    // ===
    // = The command that should
    // ===
    $('{grid.componentName}.V.R{grid.rowNumber}._UNBOUND_IMAGE_2').onClick();



    And the result in FireBug is simply that the object does NOT have an ONCLICK method (or a CLICK method... tried that too).


    Any thoughts on how to click a button on page-launch would be appreciated.

    #2
    Re: Automatically perform button "onclick" event when GRID loads

    I've also tried a more indirect approach (recommended elsewhere in the forum).

    function launch_greeting_page() {
    // ===
    // = Chincy method for auto-launching a PDF when the page starts
    // ===
    dummyvar = $('{grid.componentName}.V.R{grid.rowNumber}._UNBOUND_IMAGE_2');
    dummyvar.onClick();

    }


    Tried this with "click" and "onclick" options. No luck.

    Comment


      #3
      Re: Automatically perform button "onclick" event when GRID loads

      hello

      one of the bob moore video showed something similar, i will look for it. in the meantime i think use the following
      $('{grid.componentName}.V.R1._UNBOUND_IMAGE_2').onClick(); don't include the grid.rowNumber.
      try this. i think that is how he did it or D.V.R1_UNBOUND_IMAGE_2
      thanks for reading

      gandhi

      version 11 3381 - 4096
      mysql backend
      http://www.alphawebprogramming.blogspot.com
      [email protected]
      Skype:[email protected]
      1 914 924 5171

      Comment


        #4
        Re: Automatically perform button "onclick" event when GRID loads

        Thanks Govindan.

        I believe I reviewed the video you were referring to. It is referenced in the link I initially included on the thread.

        Being a thorough sort I tried multiple variations (direct call, indirect call via function, .Click(), .onClick(), etc).

        No luck so far.

        function launch_greeting_page() {

        // ===
        // = Attempt to "click" a button
        // ===


        // $('{grid.componentName}.V.R{grid.rowNumber}._UNBOUND_IMAGE_2').onClick();
        // $('{grid.componentName}.V.R{grid.rowNumber}._UNBOUND_IMAGE_2').Click();

        // $('{grid.componentName}.V.R._UNBOUND_IMAGE_2').onClick();
        // $('{grid.componentName}.V.R._UNBOUND_IMAGE_2').Click();

        // vl_launch_greeting_pdf = $('{grid.componentName}.V.R{grid.rowNumber}._UNBOUND_IMAGE_2');
        // vl_launch_greeting_pdf.Click();

        // vl_launch_greeting_pdf = $('{grid.componentName}.V.R._UNBOUND_IMAGE_2');
        // vl_launch_greeting_pdf.Click();

        // vl_launch_greeting_pdf = $('{grid.componentName}._UNBOUND_IMAGE_2');
        // vl_launch_greeting_pdf.Click();

        vl_launch_greeting_pdf = $('{_UNBOUND_IMAGE_2');
        vl_launch_greeting_pdf.Click();
        }


        Example images:

        Portion of screen before button click
        20130509_A5v11_issue_-1-_initial_state.jpg

        Portion of screen after button click (launches PDF)
        20130509_A5v11_issue_-2-_manual_click.jpg

        Firebug error when any automatic click action is taken
        20130509_A5v11_issue_-3-_auto-click_error.jpg


        I'll try some alternative searches later. Right now I'm out of ideas.

        Argh.

        Comment


          #5
          Re: Automatically perform button "onclick" event when GRID loads

          This is from a detail view, but I'm successfully using things like this throughout our app:
          ($('{Grid.ComponentName}.D.V.R1._UNBOUND_BUTTON_7')).click();

          Also, strip it down--make sure that the function is firing at all with something simple before getting more complex:
          alert('this fired');

          instead of {grid.rowNumber}, try:
          //place this Javascript in your code, and then reference the rowNum variable.
          var rowNum = {Grid.Object}._selectedRow;

          And finally, it's less preferable if you need to change the Action Javascript later, but if you go to the onClick Action Javascript in your image and switch it to text mode, copy the code from the Javascript - Attribute tab and use it rather than trying to click the button. You can cancel out of changes to the image and leave it Action Javascript.

          Comment


            #6
            Re: Automatically perform button "onclick" event when GRID loads

            in your attached example i did not see any
            $('{grid.componentName}.V.R1._UNBOUND_IMAGE_2').onClick();

            see the number 1 after V.R
            since you want to call an image in a row and you are not defining that rownumber i have added the rownumber to be added manually.
            if you do not want that approach then take a look at version 10 videos all the way to the end there is one how to calculate row number
            thanks for reading

            gandhi

            version 11 3381 - 4096
            mysql backend
            http://www.alphawebprogramming.blogspot.com
            [email protected]
            Skype:[email protected]
            1 914 924 5171

            Comment


              #7
              Re: Automatically perform button "onclick" event when GRID loads

              also, the formation using the rowNum variable, I left out of my earlier post, but it would be:

              '{grid.componentName}.V.R'+rowNum+'._UNBOUND_IMAGE_2'

              I also just noticed that you're using Click() on some of your attempts; Javascript is case sensitive, so I think you'd need to use click() instead.

              Comment


                #8
                Re: Automatically perform button "onclick" event when GRID loads

                Thanks all... will try to sneak in a test of some of these ideas between other work.

                Note: I did use variant Click/click/onClick/onclick in my tests. I didn't leave all options in the sample code however.

                Comment


                  #9
                  Re: Automatically perform button "onclick" event when GRID loads

                  Govindan & Chris,

                  Thanks for your input. I tried multiple variations using your input.

                  The call is now simplified and entered directly in the "onGridRenderComplete" object.

                  It appears the GRID object name is not recognized even after the grid has been fully rendered. This should not be a scope issue insofar as the object should be available to all javascript on the page at this point.

                  Here is my simple code and a screen shot of the very simple call and the error:

                  Code // ===
                  // = Simple auto-click attempt.
                  // = Uses a direct call instead of an intermediary function.
                  // ===
                  // launch_greeting_page();
                  // alert('Attempting directly in onGridRenderComplete.');

                  // The grid component renders to: GRID_OBJLST_02
                  // Using row "1" of the table (it is only a single row table)
                  {grid.componentName}.V.R1._UNBOUND_IMAGE_2.click();

                  Screenshot, call & code 20130509_A5v11_issue_-5-_auto-click_call_and_code.jpg
                  Firebug ERROR
                  GRID_OBJLST_02 is not defined

                  onGridRenderComplete: function(e) {
                  GRID_OBJLST_02.V.R1._UNBOUND_IMAGE_2.click();
                  )

                  Error screenshot 20130509_A5v11_issue_-4-_bad_object_definition.jpg


                  All good fun. Clearly it works for others... there has to be something about the object name or scope that is the problem.

                  Thanks for your input so far. It is appreciated.

                  Comment


                    #10
                    Re: Automatically perform button "onclick" event when GRID loads

                    Solution determined!
                    It was a combination of all the input and trials so far... so thanks.

                    Although the javascript (from Actionscript) shows a "_G_" reference, the other object insertions always show the ".V.R" method, as do the few forum references I could find.

                    In this case, simply changing to the "_G_" method, which I had presumed was only usable when "in-the-grid", along with the row info... worked.

                    So this is now in the "onGridRenderComplete" event within "client-side events". And it works just fine... the button clicks and it opens a PDF when the page and grid renders.


                    // ===
                    // = Force a "click" to launch the greeting-page PDF.
                    // =
                    // = This code placed in "onGridRenderComplete" client-side event.
                    // ===

                    // This code did NOT work: {grid.componentName}.V.R1._UNBOUND_IMAGE_1.click()


                    // The following code DID work:
                    {grid.componentName}_G__UNBOUND_IMAGE_1_1(1,'1',this);



                    I'll eventually have to understand from Selwyn and/or the community a bit more about object naming, classes, events, and scope. But for today I'll be happy it works.

                    Thanks again for your collective contributions. Sometimes just another nudge the right direction (or confirmation you're on the right track)... is all it takes.

                    Comment

                    Working...
                    X