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



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

listGetValue and Persit data tol loca storage

  • Filter
  • Time
  • Show
Clear All
new posts

  • listGetValue and Persit data tol loca storage

    Hi all,

    I have a problem with a UX that I want to store a list in LocalStorage for web Socket messages.
    The app is intended to operate in PhoneGap as well as Web page.

    My code to populate the list upon receipt of the message works as I intended. I store TITLE, CONTENT and RECEIVED date/time.
    The message CONTENT includes HTML code and is rendered in a popup window upon initial receipt which I want to retrieve from the List.
    When I restart the UX the list is restored correctly.

    My problem is that I want the user to be able to click on the row to re-display the message.
    So I put this code (and a few other statements to display the pop-up widow) in the onClick event for the list.

    var row = arguments[0];
    var title = {dialog.object}.listGetValue('MESSAGELIST','TITLE',row);
    alert(row+':'+title); // debug message

    The listGetValue does not error NOR does it retrieve the value for the column in the list.
    The value "row" is correct.
    If I force an invalid list name or column I get an error.

    So, I changed the list to a direct SQL table retrieve (NOT LocalStorage) and the above code works as planned without change.
    Then I checked the LocalStorage with SQL table definition and problem returned.

    Has anyone seen this behavior before?

    I am using the latest release 4346_4889 from May 18... This was a problem in 3962_4772 from Nov 14 which is what I was using prior to today
    I cannot provide a copy of the app as it is 9MB
    Last edited by TaiTai; 05-22-2017, 07:03 AM. Reason: confirm verisonnumber

  • #2
    Re: listGetValue and Persit data tol loca storage

    Title should read "listGetValue and Persist data to local storage"


    • #3
      Re: listGetValue and Persit data tol loca storage

      I do not know if my problem is related.

      I am also not getting list value on code:

      var testme = {dialog.object}.getValue('list::LIST_PATIENTS::PatientName');

      I can get row number.

      LIST_PATIENTS has no detailview.

      Above getValue code works 100% if the list is binded to a detailview.


      • #4
        Re: listGetValue and Persit data tol loca storage

        Thanks for suggestion.

        I had already tried, just forgot to mention, both {dialog.object}.getValue and detailview, which work when I do not persist to local storage.

        Possible AA assistance required...


        • #5
          Re: listGetValue and Persit data tol loca storage

          Got mine working with {dialog.object}.listGetValue('LIST_PATIENTS','PatientName',rowNumber);

          Ar first it did not work. But then I switched off persist local storage and read only. Then I run it again and it worked.
          Switched persist local storage and read only on again. It still worked. Scary as I cannot reproduce the behavior.


          • #6
            Re: listGetValue and Persit data tol loca storage

            Hi all,


            I attach a ZIP file with the Message_Sender and Message_Listener function extracted from my mega App.
            This demonstrates the problem I am having.

            It is not linked to any connection, it simply sends/receives messages.....

            I do not want to bind the list to a table, Can one of my fellow AA'ers have a quick look and give me a pointer.
            Feel free to re-use the code......

            Thanks in advance



            • #7
              Re: listGetValue and Persit data tol loca storage

              I console logged it and seem to get the correct values when I click on a row (I'm using the same build as you):

              MESSAGE_LISTENER_PageLayoutLivePreview.a5w?13300519:1165 row:4
              MESSAGE_LISTENER_PageLayoutLivePreview.a5w?13300519:1168 messageTitle:Title Message 5
              MESSAGE_LISTENER_PageLayoutLivePreview.a5w?13300519:1169 actualMessage:<h2>Content 5</h2><br>Some words here

              EDIT: maybe need to delete some pre 4346_4889 localstorage keys on the device/browser where you are testing this or bump up the version number for the data in "Local Storage" in the Properties of the UX?
              Last edited by jgrannis; 05-24-2017, 03:09 PM.


              • #8
                Re: listGetValue and Persit data tol loca storage

                Jeff, thanks for your review. Tried version change, no luck. Also tried machine that had not run the UX before.

                Question: Did you try sending a message, by using the sender UX and click on that row?
                The rows loaded in the static definition show in the popup window as expected.
                The row I loaded using the logic in webSocketOnMessage displays as expected upon receipt. Message is loaded into the list as expected, it is also shown in list refresh OR UX reload as expected.
                Problem is that when I use the onClick code, the list fields for the inserted row do not return form the getListValue.


                • #9
                  Re: listGetValue and Persit data tol loca storage

                  Ah, OK, I think I understand the problem now. There is a difference in behavior when clicking on a row already present in the list (pre-loaded and stored in localstorage) and the behavior of a row that has just been added using the appendRows() method?
                  Makes me think of a good post that I had seen by DavidK about values of newly added rows before and after they have been synced. I'll try to find it.

                  I added a new row using the appendRows() method and took a look at the data in localstorage. I looks like this:
                  [{"Content_ID":"1","Msg_Title":"Title Message 1","Msg_Content":"<h2>Content 1</h2><br>Some words here","Published_Date":"25/05/2017 17:56","__a5crc":"4294946064","*key":0,"*renderIndex":0,"*value":"1"},
                  {"Content_ID":"2","Msg_Title":"Title Message 2","Msg_Content":"<h2>Content 2</h2><br>Some words here","Published_Date":"25/05/2017 17:57","__a5crc":"4294947311","*key":1,"*renderIndex":1,"*value":"2"},
                  {"Content_ID":"3","Msg_Title":"Title Message 3","Msg_Content":"<h2>Content 3</h2><br>Some words here","Published_Date":"25/05/2017 17:58","__a5crc":"4294921674","*key":2,"*renderIndex":2,"*value":"3"},
                  {"Content_ID":"4","Msg_Title":"Title Message 4","Msg_Content":"<h2>Content 4</h2><br>Some words here","Published_Date":"25/05/2017 17:59","__a5crc":"4294918781","*key":3,"*renderIndex":3,"*value":"4"},
                  {"Content_ID":"5","Msg_Title":"Title Message 5","Msg_Content":"<h2>Content 5</h2><br>Some words here","Published_Date":"25/05/2017 18:00","__a5crc":"4294907695","*key":4,"*renderIndex":4,"*value":"5"},

                  You'll notice that you see no *key, *renderIndex, *value for the newly added row.
                  Maybe when you receive a new message you could add the new message data to your own array stored in localstorage and then repopulate the list with that data using the setListColumnsAndPopulate() method
                  Last edited by jgrannis; 05-25-2017, 09:44 AM.


                  • #10
                    Re: listGetValue and Persit data tol loca storage

                    Jeff, take a bow!

                    You solved my problem..... I really must allocate time to learning how to use console log.....
                    Thank you very much from down under.....

                    I simply changed my code to this....

                    // load new data pairs...
                    var _d = {Content_ID: ID, Msg_Title: messageTitle, Msg_Content: actualMessage, Published_Date: receivedFormat};

                    // get current list contents
                    var data = {dialog.object}.getListData('MESSAGELIST');

                    // repopulate list ... where by ops is the template definition in HTML format as per the list layout tab of the list definition
                    var ops = {showTitle: false, style: 'freeform', template: ..........................................