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

Method to disable a button when no connection?

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

    Method to disable a button when no connection?

    Does such a method exist?
    Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

    #2
    Re: Method to disable a button when no connection?

    client-side expressions?

    Comment


      #3
      Re: Method to disable a button when no connection?

      Not sure if you're asking about a disable button method or a connection method... or a combo method :)

      There's a client-side event named onConnectionChange that I use, along with a this method... {dialog.Object}._getOnlineStatus().

      Before I actually do whatever the button does, I call the _getOnlineStatus() method. If offline I adjust the button...

      Code:
      var btnSendEle = {dialog.Object}.getPointer('BTNSENDORDER');
      btnSendEle.style.color = "blue";
      btnSendEle.innerHTML = "NO INTERNET CONNECTION"
      I use the onConnectionChange event to do this...
      Code:
      if (e.online) {
      var btnSendEle = {dialog.Object}.getPointer('BTNSENDORDER');
      btnSendEle.style.color = "#ffffff";
      btnSendEle.innerHTML = "PLACE ORDER"
      }
      You could add an else to the onConnectionChange to disable the button. I like testing the status as well, though.

      Comment


        #4
        Re: Method to disable a button when no connection?

        I Thought I'd throw this in.....

        There is another useful function to help simulate being on or offline, which is especially important if you are developing on a laptop (like on the road, or say in the air going to a developer conference) and your computer does not have an Internet connection. That function is:

        {dialog.object}._setSimulatedOnlineStatus(simulateMode)

        where simulateMode = "on", "off", or ""

        In the UX, if you start typing that command into a JavaScript window it will bring up the context sensitive help, if you are on a new enough release. Sending an empty string to the function turns simulation mode off and reverts the ._getOnlineStatus() back to its default behavior.

        I don't know if the Grid has the same function.

        The ._getOnlineStatus function uses a function of the browser to determines the online/offline state. So, you are at the mercy of the browser to return the correct value. The browser does not understand you might be developing a disconnected application on a stand-alone computer. Sometimes you will want to simulate being online (as you have the database and web server running locally) and other times you will want to simulate really being offline.

        Comment


          #5
          Re: Method to disable a button when no connection?

          Thanks for the replies. These methods do not seem to work for an android device. I liked the method that you shared David, but I can't get that event to fire. A simple alert yields nothing when I change the connection status. I tried to call the _getOnlineStatus() in the click method of a button but it returns true whether there is a connection or not. So either these methods don't work for an android or I am not using them correctly.

          This is the code I am using in the click event of the synchronize button.
          Code:
          if ({dialog.Object}._getOnlineStatus())
          {
              {dialog.object}.saveListEdits('LST_SERVICELOG',{rows: 'current'});
          }
          else
          {
              alert('No Internet Connection - please try later');
          }
          this is in the code in the onConnectionChange event
          Code:
          if (e.online)
          {
              var ele = {dialog.Object}.getPointer('BTN_SYNC_LOG');
              ele.innerHTML = "Synchronize"
          }
          else
          {
              var ele = {dialog.Object}.getPointer('BTN_SYNC_LOG');
              ele.innerHTML = "NO CONNECTION"
          }
          Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

          Comment


            #6
            Re: Method to disable a button when no connection?

            I just fired up the app I have this code in on my Nexus 7. Got to the order button... then went to the Nexus 7 Settings and turned off Wifi. Back to the app, hit the order button and my button turned into "No connection".

            Then, back into settings, turned wifi back on, back into the app and the button turned back to "Place Order". So all looks good. The Nexus 7 is running Android 4.4.4.

            Comment


              #7
              Re: Method to disable a button when no connection?

              Thanks for double checking David, I will try again tomorrow. Perhaps it is because my tablets are cellular enabled even though I disconnected the cell connection and wifi. I know I did not have a connection because the synchronize never succeeded and when I refreshed the list I got the page not found message. I am having strange issues with client side events not firing. Could be the way I have my ux structured. Although fundamentally everything is working well.
              Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

              Comment


                #8
                Re: Method to disable a button when no connection?

                I still can't get the event or the method to work. I have tried on a laptop with no connection, my desktop, the tablet. It does not fire.
                I can debug the _getOnlineStatus() method but it always returns true. Perhaps I need to take another approach.
                I have found that when there is no connection and I press synchronize nothing happens. When the connection is restored I can press synchronize again and the data is synchronized, nothing is lost.
                Maybe I can put a timer to check if the record is still dirty after a set amount of time and return a failed message. Does anyone no how long the synchronize attempt runs before it times out, or actually what happens if it is unsuccessful.
                Last edited by frankbicknell; 12-13-2014, 11:18 AM.
                Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

                Comment


                  #9
                  Re: Method to disable a button when no connection?

                  I have made some discoveries about lists with child lists and synchronizing. The only detail view events that fire are in the parent list. Even if I use the method to synchronize a row from the child list. The synchronize row method asks for the id of the list. I thought it would only synchronize that list but instead it synchronizes all lists and fires the events in the parent list. Is that the way it is supposed to work?

                  Another interesting discovery. When I use the synchronize all method when inserting a record in the detail view of one of the child list it inserts 4 duplicates which is the same number of child lists.

                  I have to believe that some of these problems are bugs, unfortunately I guess I will have to wait until someone who can send a test case with the same problems reports it to alpha.

                  The connection methods and events seem to work OK in chrome, not in firefox, however I have some other formatting issues and sometimes chrome just hangs and the lists do not load.

                  All in all I am still happy with the lists and the way my app is working despite the problems. I am learning about what not to do. The data is safe and stable. My users are starting to get the hang of it. I am sure eventually alpha will fix it.
                  Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

                  Comment


                    #10
                    Re: Method to disable a button when no connection?

                    I received a message that the multiple record insert problem has been fixed. I have also given Internet Explorer another look and it appears that all of the connection methods and events fire like they should. I have added a notification area to tell the user if there is a connection and I call the _getOnlineStatus() method in the synchronize button click. Ahh finally it is getting real good. Hopefully the issues with firefox can be resolved.
                    2014-12-15_8-53-51.png
                    2014-12-15_8-57-52.png
                    Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

                    Comment


                      #11
                      Re: Method to disable a button when no connection?

                      Just adding a link to a video by Bob Moore in case someone would like more information on this thread's topic. He does not disable the button, but rather displays a popup message about the server being offline when the button is pressed.

                      But he also describes in quite a bit of detail how to do some of the online/offline checking when doing a mobile app. He also shows some ways to really improve the customer experience when using an app that can be offline.

                      Might be of additional help.

                      https://www.youtube.com/watch?v=1zG-da2Swdk

                      Comment

                      Working...
                      X