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

New record notify?

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

    New record notify?

    Can a server automagically push new data to a browser or must the browser always pull?
    Rapid Development, Training, Support
    http://data2web.network
    903-740-2549

    #2
    Re: New record notify?

    Browser must pull.

    Comment


      #3
      Re: New record notify?

      Actually, browsers are able to PUSH now apparently. I have not tested this but have read a lot about it recently.

      Google for: SERVER SENT EVENTS

      Comment


        #4
        Re: New record notify?

        Originally posted by lvasic View Post
        Browser must pull.
        If you want to sent notifications to the clients best option is to use NodeJS with socket.io. There are some opensource projects with good examples how to implement this but understand you need some good knowledge how NodeJS works to implement this as the WAS side.
        Perhaps a better and more stable solution is you ask Selwyn to take a look what the possibilities are.

        Comment


          #5
          Re: New record notify?

          This problem has been discussed in an earlier thread. Post #7 explains one way to solve problem with AA

          Comment


            #6
            Re: New record notify?

            Originally posted by kkfin View Post
            This problem has been discussed in an earlier thread. Post #7 explains one way to solve problem with AA

            Ken,

            Correct i saw the same website as Jim mentioned i mist the earlier post thanks.

            Comment


              #7
              Re: New record notify?

              Thanks for the link, Ken. One interesting part of that post is this:
              ...example using node.js (now built into AA in the pre-release version)...
              I wonder if that was cut from the final release? I can't find mention of it anywhere.
              Rapid Development, Training, Support
              http://data2web.network
              903-740-2549

              Comment


                #8
                Re: New record notify?

                I wonder if that was cut from the final release? I can't find mention of it anywhere.
                It's in the release notes from the 29 September official release.

                Xbasic - Node.JS - Extending Server-side Functionality using Node.js - Node.js is a popular program for writing server side utilities in Javascript. Alpha Anywhere now has tight integration with Node and you can now define your own Node modules that can be called from Xbasic.

                Watch Video - Part 1
                Watch Video - Part 2
                Watch Video - Part 3

                To create a new 'Node Service' that can be called from Xbaisc, you create a new .js file in the Node_Services folder in the Alpha Anywhere executable folder. The syntax for this .js file is the syntax you would use for any Node module.

                To call a Node service from Xbasic, you:

                dim an instances of the helper::V8 object
                construct a JSON string that defines the Node service you want to call and the parameters you wan to pass to the Node service
                call the .NodeRequest() method of the helper::V8 object instance



                In the following example, we have defined a trivial Node service that takes as its input two variables, 'firstname' and 'lastname' and sends back a string showing: Hello firstname lastname.

                The Node service in this example is called 'hello'. Therefore the '_command' property of the JSON command object is set to 'hello'

                You must also set an '_id' property in the JSON command object. This can be any value. Using a UUID for this value is convenient.

                The Node service is called using the .NodeRequest() method and the result is returned as a JSON string with properties for the error text (if there was an error) and 'result' - the result of the request. The JSON response can be parsed to get Xbasic varibles, or the json_extract() function can be used to extract the 'result' property.







                dim n as helper::V8
                dim p as p

                'generate an id for the request we are about to send to Node.

                'we just use a GUID for convenience
                p._id = api_uuidcreate()



                'set the _command property. This is the name of the Node service we want to call
                p._command = "hello"




                'specify any variables you want to pass to the Node service

                p.firstname = "Nellie"
                p.lastname = "Jones"


                'convert the Xbasic .dot variable to a JSON string.

                dim jsonCommand as c

                jsonCommand = json_generate(p)


                ?n.NodeRequest(jsonCommand)
                = {"_id":"id1","error":"","result":"Hello Nellie Joness"}




                Here is how the corresponding Hello.js file is defined. This file must be in the Node_Services folder in the Alpha Anywhere executable folder. This is a standard Node module. It can 'require' any other Node modules that you have written, or that have been installed using NPM (the Node Package Manager).



                exports.handler = function(packet,response,sendResponse) {
                var e;
                var attachments = null;

                var msg = 'Hello ' + packet.firstname + ' ' + packet.lastname;
                response.result = msg;

                sendResponse(response,attachments);
                };




                If you edit the .js file in the Node_Services folder after having called it, your edits will not be seen until you shutdown the Node service. The next time you call the Node service you will see a short delay as Node starts up.

                To shut down the Node service you can all the .NodeShutDown() method on the helper::V8 object instance. For example, in the above example the helper::V8 object instance was called 'n', so the following command will shut Node down.



                n.NodeShutdown()



                NOTE: Node.exe is automatically installed in the Alpha Anywhere executable folder when you install Node. You do not need to install Node yourself.
                Jim Coltz
                Alpha Custom Database Solutions, LLC
                A5CustomSolutions.com
                [email protected]

                Comment


                  #9
                  Re: New record notify?

                  Thank you Jim, I watched the videos and used your code as my template. Works great in working preview but not live, which is odd.
                  After publishing the UX I'll open two instances of dlg_Chat to try chatting, but nothing at all appears to happen.

                  XBasic function in a UX:
                  Code:
                  function chat as c (e as p)
                  
                  if len(e.dataSubmitted.txtmsg) > 0 then
                  	dim n as helper::V8
                  	dim p as p
                  	p._id = api_uuidcreate()
                  	p._command = "hello"
                  	p.firstname = e.dataSubmitted.txtname
                  	p.msg = e.dataSubmitted.txtmsg
                  	dim jsonCommand as c
                  	jsonCommand = json_generate(p)
                  	p.return = n.NodeRequest(jsonCommand)
                  	
                  	dim p2 as p
                  	p2 = json_parse(p.return)
                  	dim result as c = p2.result
                  	dim firstname as c = p.firstname
                  	
                  	dim display as c = e.dataSubmitted.textbox + crlf() + result
                  	chat = "{dialog.Object}.setValue('TEXTBOX',display);"
                  end if
                  
                  'n.NodeShutdown()
                  
                  end function
                  hello.js located in C:\Program Files (x86)\a5V12\node_services

                  hello.js:
                  Code:
                  exports.handler = function(packet,response,sendResponse) {
                  var e;
                  var attachments = null;
                  
                  var msg = packet.firstname + ': ' + packet.msg;
                  response.result = msg;
                  
                  sendResponse(response,attachments);
                  };
                  I've noticed that most if not all services in node_services have corresponding folders in node_modules which include package.json for that service. My hello.js has no such module.

                  Dialog Chat: dlg_chat.a5wcmp
                  Last edited by mvaughn; 11-02-2014, 05:50 PM.
                  Rapid Development, Training, Support
                  http://data2web.network
                  903-740-2549

                  Comment

                  Working...
                  X