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

Google Charts using Web Socket data from Server every 5 seconds - Video

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

    #16
    Re: Google Charts using Web Socket data from Server every 5 seconds - Video

    Charles... it doesn't matter what UX you're currently viewing... it's the web-socket server that's handling the broadcast. This is what you have to wrap your head around. The UX (the Client) automatically receives broadcasted messages from the web-socket server. Read the info in the release notes a few times and you'll start to understand what's happening. Also, read the inline notes in the Action Javascript choices for Web-Sockets.

    Once the 'Web-socket server' property has been checked, when the UX or Grid component is run, it will automatically launch the web-socket server (if it is not already running) and it will start listening for messages. When a message is received, the client-side webSocketOnMessage event will fire and your Javascript code can decide what (if anything) to do with the message.
    The web-socket server is like the main post office. You send it a message and it broadcasts that message to all components that say... "sure... I'll receive messages... go ahead". If 10 UXs are currently running, then all 10 get the message. If 1000 users are viewing the same UX... 1000 users will get that message.

    You can send a message from the client (the UX) to the websocket server... or you can send a message from the Alpha Server (XBasic) to the websocket server.
    Sending a message client-side is like sending an email to a group... everyone gets the message except you.
    Sending a message server-side... everyone, including you, gets the message.

    http://youtu.be/19xQJAO35-4?hd=1

    The attached zip contains 2 UX components. One contains a List control... the other does not. I'm controlling the List from the UX which does not have the List.

    As well, I'm sending a client-side message to update the Users Gauge. In this case, the sending UX does not receive the message. So... client-side... I have to also perform whatever the message is.
    Attached Files

    Comment


      #17
      Re: Google Charts using Web Socket data from Server every 5 seconds - Video

      Okay, I take no issue with the receiving client side - I get that it "receives" and that any changes in the broadcasting UX get messaged out when you tell it to. My problem is triggering the "update" to the info in the UX.
      In other words, let's say I have a UX called UX1 with a list control and a button that says "update list"
      Now I have a seperate UX with a list with a detail view, a user does an INSERT - how can I update the OTHER UX that is actually broadcasting?
      See I don't understand how I would poll the database for changes to even broadcast the change. Now perhaps I am not understanding the premise for web socket servers but when I see gauges updating info automatically I wonder how they get the updated info - FIRST before it gets simultaneously broadcast to listening UX's/components.
      NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

      Comment


        #18
        Re: Google Charts using Web Socket data from Server every 5 seconds - Video

        Can I send a message to the UX1 via an xbasic script in another UX and in that way update the broadcaster?
        NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

        Comment


          #19
          Re: Google Charts using Web Socket data from Server every 5 seconds - Video

          You're still not quite there... but you'll soon have an epiphany.

          The "OTHER UX" is not broacasting. It is sending messages to the web-sockets server... and receiving messages from the web-sockets server. It is the web-sockets server that is taking in that message and broadcasting it.

          Remember, the web-sockets server is the central post office... a central hub... it gets everything individually from any component... then sends it back out. If the UX initiates a client-side message, then than UX will not get that message back. If the UX initiates a Server-Side message, then that UX will get that message.

          You need to look at the new examples I posted. Run one UX in Chrome... run the other UX in Firefox. One UX has a List... the other doesn't. The UX that does not have a List sends a message to the web-sockets server. The message is "sort the list". The web-sockets server gets the message and then sends it out to all listening components. Each component gets the message and our JS code reads the message and does what it says to do.

          You don't send a message to UX1... you send a message to the web-sockets server (which is running on the Alpha Server) and the web-sockets server sends the message to all listening UXs... including UX1.

          You don't poll a database change... you know you're doing the Insert right? You're in a UX... doing a List Insert. When you click Submit... you would also add code to send a web-socket message. The web-sockets server gets the message and sends it out to all listening components. The message could be... "refresh the List".

          The components get the message and test for "refresh the List". If the message is "refresh the List" then you perform List refresh data.
          Last edited by Davidk; 08-06-2016, 02:12 PM.

          Comment


            #20
            Re: Google Charts using Web Socket data from Server every 5 seconds - Video

            Boom, epiphany... Lol
            NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

            Comment


              #21
              Re: Google Charts using Web Socket data from Server every 5 seconds - Video

              So, question; If I have two UX's with a list control per UX and both list controls are named list1 - If I send a message to the web socket server that says to refresh 'list1' then both "listening" lists would refresh correct ? This seems like I should be very careful in my listening UX's as per naming conventions.
              NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

              Comment


                #22
                Re: Google Charts using Web Socket data from Server every 5 seconds - Video

                David, My stumbling point is I don't know Alpha well enough to determine which of the dozens of client/server events is best for a CRUD operation (to Alpha App server) triggering a message (to Web Socket server) and the proper sequence. Any pointers if I'm using an editable grid for transaction entry/edits? Another helpful example would be taking Selywn's chat example one step further by saving the comments to a table periodically.


                Charles, A useful resource for understanding the tech side is Amazon Elasticache https://aws.amazon.com/elasticache/redis/resources/ documentation. There are some good webinars and docs explaining the concepts. AWS Elasticache is just a fancier, more durable, costlier version of what Alpha is providing on install. It can also BE the Redis server used by any component so you don't need to worry about your realtime messaging server bonking.

                Comment


                  #23
                  Re: Google Charts using Web Socket data from Server every 5 seconds - Video

                  Originally posted by CharlesParker View Post
                  So, question; If I have two UX's with a list control per UX and both list controls are named list1 - If I send a message to the web socket server that says to refresh 'list1' then both "listening" lists would refresh correct ? This seems like I should be very careful in my listening UX's as per naming conventions.
                  Well... that really depends on how you code the client-side webSocketOnMessage event... and... if you sent a server-side web-socket message.

                  But generally... yes... you just need to organize and plan what you want to do.

                  Comment


                    #24
                    Re: Google Charts using Web Socket data from Server every 5 seconds - Video

                    Originally posted by menehune View Post
                    David, My stumbling point is I don't know Alpha well enough to determine which of the dozens of client/server events is best for a CRUD operation (to Alpha App server) triggering a message (to Web Socket server) and the proper sequence. Any pointers if I'm using an editable grid for transaction entry/edits? Another helpful example would be taking Selywn's chat example one step further by saving the comments to a table periodically.
                    If you're working with a grid, then the dozens of events gets reduced to a few... depending on what you're doing. There are server-side events for after insert, update, delete. There are client-side events you could use as well. I don't know what you're grid is doing or how you're doing it... but it really depends on how it's put together.

                    Comment


                      #25
                      Re: Google Charts using Web Socket data from Server every 5 seconds - Video

                      Wow, this is amazing stuff indeed. Could this technique be used to push pop-up messages to any logged in user?
                      I'm thinking along the lines of an administrator asking "Please save your work and logoff in the next 10 minutes". And where would the message arrive on the client app?

                      Thanks Pete & David for demonstrating and sharing.
                      Last edited by iRadiate; 08-06-2016, 10:28 PM.
                      Alpha Anywhere v12.4.6.5.2 Build 8867-5691 IIS v10.0 on Windows Server 2019 Std in Hyper-V

                      Comment


                        #26
                        Re: Google Charts using Web Socket data from Server every 5 seconds - Video

                        Stephen - yes. We have it all set up for a live chat system on a multi-tenant app. Permissions are provided only to the "current" tenant and further only those users so given permission. It works fine on one server but we're stuck without it working across a load balancer and two or more physical boxes.
                        -Steve
                        sigpic

                        Comment


                          #27
                          Re: Google Charts using Web Socket data from Server every 5 seconds - Video

                          Steve, I was watching your other thread and ALL I can think is there is something missing - and it will take an Alpha engineer to figure it out because they put this together in the first place. It seems to me that they would work on this because ANY application that has USERS (means makes money!) will probably require a load balanced environment, so therefore - this NEEDS to work!

                          I hope they take some time to really get under the hood on this, I KNOW there are some very smart folks working on development and they could solve it in a day if they would just take the time!

                          Good LUCK!
                          NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                          Comment


                            #28
                            Re: Google Charts using Web Socket data from Server every 5 seconds - Video

                            Steve, If using a load balancer you also need to use Redis instead of the simple option. I think the simple option only ties to the physical IP of a single box. I don't need a load balancer at this point so haven't tested, but the AWS link I posted has great in-depth info on the configuration. Also, it's part of their one year free tier trial.

                            Comment


                              #29
                              Re: Google Charts using Web Socket data from Server every 5 seconds - Video

                              Originally posted by iRadiate View Post
                              Wow, this is amazing stuff indeed. Could this technique be used to push pop-up messages to any logged in user?
                              I'm thinking along the lines of an administrator asking "Please save your work and logoff in the next 10 minutes". And where would the message arrive on the client app?
                              In a sense, this doesn't have anything to do with users or being logged in. If you must be logged in to use a component... then fine... but it really doesn't have anything to do with web-sockets. As long as a UX has web-sockets turned on, it will receive a broadcasted message. You can go further and set up and subscribe to channels per UX. The client-side event websocketOnMessage receives the message and you decide what to do with it. It's just JSON so the message can really be anything... and you interpret what is sent.

                              So... yes... Admin could send out a message advising of a shutdown. You could even log them out.
                              Last edited by Davidk; 08-07-2016, 10:58 AM.

                              Comment


                                #30
                                Re: Google Charts using Web Socket data from Server every 5 seconds - Video

                                When I first posted the Gauges video I wanted to spark AA developers in understanding "a message can be anything", many developers take AA video examples too literally.. they are mostly foundation blocks - and AA expect us the build on top of them, not be happy with them as they are. Another recent example of this was the ink control as an image gallery control, it displayed a technique in its simplest form, but when you build on top of it you get the rewards, see the example attached - it is now an integral part of all my builds - it works with S3, using a list bound component, and I could not be happier with the tool. Any AA developer not putting time into these tools right now, needs to take a breath, make some time, just like you Charles and get their head around it, I think these recent developments a total game changers for me, I'm so impressed with the AA Team right now.

                                2016-08-07_2157.png

                                2016-08-07_2156.png

                                Also nice work all around David.

                                Peter
                                Insanity: doing the same thing over and over again and expecting different results.
                                Albert Einstein, (attributed)
                                US (German-born) physicist (1879 - 1955)

                                Comment

                                Working...
                                X