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

Action Button action if no records in grid?

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

    Action Button action if no records in grid?

    I have an application that still uses stand alone pages (I know, that's sooo version 9!)

    I have an action button in the footer of a grid on the page, and the purpose is to set a session variable to the value "new" and navigate to another page. But, there is no Action JavaScript to go to a new page (there is if I want a modal window, but i don't...I want a whole other page) so I looked in the JavaScript manual that's been holding up the table with the broken leg and found location.href.

    So my Action Button calls an Ajax Callback that is:
    Code:
    function setJobNew as c (e as p)
    e.Session.Jobid = "new"
    setJobNew = "location.href = 'job_addedit.a5w';"
    end function
    This works great if there are records in the grid, but if there are no records, it doesn't work. Does anyone know if action buttons are supposed to work if there are no records in the grid?
    If not, what else can I try?
    Pat Bremkamp
    MindKicks Consulting

    #2
    Re: Action Button action if no records in grid?

    Pat,

    How about using a dialog instead of a grid?
    Peter
    AlphaBase Solutions, LLC

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


    Comment


      #3
      Re: Action Button action if no records in grid?

      What about disabling the action button if there are no records in the grid?

      Within the Action Button definition, under Client-Side Properties, you have Enable Expression.

      In there, one of the Insert Field choices is grid.recordsInGrid. So, I put grid.recordsInGrid > 0 for the Enable Expression and now when there are no records the button is disabled.

      Comment


        #4
        Re: Action Button action if no records in grid?

        Peter,

        Thanks, but I'm still struggling to create the dialog2 components, especially to display existing records. Plus this grid needs a search which is disguised as a password. So, the grid seems easiest. This is a production application so I don't have a lot of time to experiment.
        In Version 10, I just used a link and set the session variable in the URL.

        David,

        Thanks, but my problem is just the opposite. It works when the grid contains records, but does not work when the search finds no records. That is, it is already disabled (some kind of JavaScript error) and I need it to work.

        If it is a bug, I don't have time to wait for a fix, but if I can't make this work, I'll just find another way to accomplish the same thing.
        Pat Bremkamp
        MindKicks Consulting

        Comment


          #5
          Re: Action Button action if no records in grid?

          Oops... read that wrong... must read and not skim.

          Zip and post your grid... we'll have a look.

          Pat,

          I just copied your code into my grid, and created an Action Button, Ajax Callback, to call the setJobNew function, and the button is fine... it's there on the grid and enabled.

          Do you want the browser window you're in to change to the new page, or open a new browser window?
          Last edited by Davidk; 01-27-2012, 02:10 PM.

          Comment


            #6
            Re: Action Button action if no records in grid?

            David,

            Thanks for sticking with me on this.

            I want to move to a new page, not in a window or div or tabbed UI pane. Just like a link would do, except that I need to set a couple session variables in the process.

            I was able to create the button and put it in the grid footer also, and it works if there are records in the grid, but, if after the search there are no records, then it does not work (at least for me).

            I'll attach some photos to show what I'm doing.
            Screen1 (hover for numbers) shows the grid that contains the job listing with a link for employers to post jobs (it's a do-it-yourself process). When they click the link, they go to screen2, a grid to enter an access code. This is really just a search on a grid that is hidden if no search active. This way, they can edit previous postings. If there are jobs with that code, they show. as in screen3. The button to add a new job is the one I'm struggling with. As long as there are jobs in the grid, it works and goes to screen4 where they can enter new jobs. However, if the search doesn't find any listsings, the button fails with a JavaScript error.
            screen1.jpgscreen2.jpgscreen3.jpgscreen4.jpg
            screen5.jpg

            The error says
            Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIWebNavigation.sessionHistory]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://global/content/bindings/browser.xml :: :: line 755" data: no]
            Source File: chrome://global/content/bindings/browser.xml
            Line: 762
            I have no clue what to do about that!
            Pat Bremkamp
            MindKicks Consulting

            Comment


              #7
              Re: Action Button action if no records in grid?

              Does you Add/Edit Grid depend on any data from a previous grid?

              Comment


                #8
                Re: Action Button action if no records in grid?

                The add / edit uses the following session variables

                Session.SeNum = the section (tennant) ...it is a multitenant application
                Session.JobId = the job id selected to be edited, or "new" if this is to create a new job
                Session.AccessCode = for new jobs, this is saved to the record so the job can be accessed with it in the future.

                Pat
                Pat Bremkamp
                MindKicks Consulting

                Comment


                  #9
                  Re: Action Button action if no records in grid?

                  Dunno Pat. I would try putting together a really simple page and putting that in place of job_addedit.a5w... just to try and figure out what and where the error is.
                  If the new page opens without error, then job_addedit.a5w is the problem... so what's in there that's causing an error.
                  Just for the heck of it, try location.replace instead of location.href.

                  No errors here opening the page with Location.href or Location.replace(), with or without records in the grid.

                  Does your target grid open without errors by itself? I'm guessing you may have a bad grid, since you're getting an exception error on a component.

                  Comment

                  Working...
                  X