Alpha Video Training
Results 1 to 11 of 11

Thread: Lists with parent lists and pre-loaded data

  1. #1
    Member
    Real Name
    Scott Binger
    Join Date
    Oct 2011
    Posts
    299

    Default Lists with parent lists and pre-loaded data

    Here is an interesting dilemma (or at least for me ;-) )...

    Background:

    I have a three lists in a UX: "Parent_List", "Child_1" and "Child_2". I am indicating that "Child_1" and "Child_2" each have a parent list: "Parent_List" and that the data for each should be pre-loaded (since this application is being designed to work offline - browser based, not mobile). The "Parent_List" is also configured to persist data to local storage (and the restore list data from local storage option is turned on in the UX properties). In order to refresh the data in the "Parent_List", I have the search part turned on in the list (with a text box control and button the UX to execute the server side search). Finally, I have a static text control in the UX with a "record counter" for "Parent_List"

    Dilemma:

    Executing the search on "Parent_List" sometimes refreshes the the list and sometimes does not. For example, if I search for id # 100, it will bring up results in "Parent_List", but if I search for id # 200, it will not update "Parent_List". My suspicion was that the child lists have too much data and the search is "crapping out". That being said, the static text control containing the record counter for "Parent_List" IS updating with the new record count.

    Hopefully this makes sense. Happy to elaborate as needed.
    Last edited by Scott B; 04-20-2019 at 01:04 PM. Reason: typo

  2. #2
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,496

    Default Re: Lists with parent lists and pre-loaded data

    What Alpha build are you using? How many records... and how large are they... in the child lists? IOW, how many MB of local data are you working with?
    It's arbitrary, but figure on about 5mb of local storage. It depends on the browser.
    When you start seeing issues, check on your local storage.

  3. #3
    Member
    Real Name
    Scott Binger
    Join Date
    Oct 2011
    Posts
    299

    Default Re: Lists with parent lists and pre-loaded data

    Thanks David. Version is 5152-5221; number of records could vary greatly from a few dozen to hundreds.
    Last edited by Scott B; 04-20-2019 at 03:27 PM. Reason: removed partial text

  4. #4
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,496

    Default Re: Lists with parent lists and pre-loaded data

    Both Child Lists have the same Parent List?
    Are you seeing any errors in the browser console?
    Does this happen at any time? Right after render... or after several searches?
    If you don't pre-load the child data... any issues?
    I think your build 5221-5152.

  5. #5
    Member
    Real Name
    Scott Binger
    Join Date
    Oct 2011
    Posts
    299

    Default Re: Lists with parent lists and pre-loaded data

    Both Child Lists have the same Parent List? Yes
    Are you seeing any errors in the browser console? In Chrome: a5-52215152.js:232 [Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080
    Does this happen at any time? Right after render... or after several searches? It happens only when I'm doing a search on the parent list which has > 500 records or so (and consequently, a greater number of records in the child lists)
    If you don't pre-load the child data... any issues? No issues if I don't pre-load the child data
    I think your build 5221-5152. ?

  6. #6
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,496

    Default Re: Lists with parent lists and pre-loaded data

    In a current release, I'm loading 700 parent records and 800 records each for 2 Child Lists. I'm not seeing any odd results.
    I would suggest you test this in a current release... just to ensure that your build isn't the cause.

  7. #7
    Member
    Real Name
    Sean OKelly
    Join Date
    Sep 2015
    Location
    Charleston, WV
    Posts
    205

    Default Re: Lists with parent lists and pre-loaded data

    Are you testing this on a mobile device?

  8. #8
    "Certified" Alphaholic CharlesParker's Avatar
    Real Name
    Charles Parker
    Join Date
    Dec 2012
    Location
    New Orleans, LA
    Posts
    2,041

    Default Re: Lists with parent lists and pre-loaded data

    Scott, If I may make a suggestion - eliminate the child lists altogether and perform the same filtering with a server side refresh. My guess is that it will work as expected.
    If it does work, you can add back in one child list and test. You may need to refresh the parent and the child to get the correct filtering.
    Data being "pre-loaded" doesn't mean it works offline as far as I can recall, it just means that the original call for the data will include the child list data which is probably why the "filter" is failing on the second go round.
    Someone will correct me if I am wrong, but no worries, I enjoy learning too!
    NWCOPRO Nuisance Wildlife Control Software-My Application: http://www.nwcopro.com "I am not discouraged, because every wrong attempt discarded is another step forward."

  9. #9
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,496

    Default Re: Lists with parent lists and pre-loaded data

    Yes... testing is on a mobile device... that's the only time you get those Console errors.

    I just tested under 5221 and nothing odd showing up. There must be something else going on with your UX and setup that's causing an error or running into an Alpha bug.

    Maybe you're running out of LocalStorage space. You said your issue occurs when you've loaded 500 or more Parent records... and many more Child Records x 2. But, you've not indicated how large those records are.

    Have a look at this site which gives you a simple Javascript function to call which will calc LocalStorage used and remaining. Remember that LocalStorage is volatile... it doesn't belong only to what you're doing. If something else needs it, it will wipe out your data.

    https://coderwall.com/p/4rsq1w/check...-storage-usage
    Last edited by Davidk; 04-21-2019 at 01:24 PM.

  10. #10
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,496

    Default Re: Lists with parent lists and pre-loaded data

    Quote Originally Posted by CharlesParker View Post
    Scott, If I may make a suggestion - eliminate the child lists altogether and perform the same filtering with a server side refresh. My guess is that it will work as expected.
    If it does work, you can add back in one child list and test. You may need to refresh the parent and the child to get the correct filtering.
    Data being "pre-loaded" doesn't mean it works offline as far as I can recall, it just means that the original call for the data will include the child list data which is probably why the "filter" is failing on the second go round.
    Someone will correct me if I am wrong, but no worries, I enjoy learning too!
    I'm not sure about this, Charles. The "Pre-load data" property does state that "this option is typically used when you are loading data so that the UX can be used while disconnected".

    If all Parent records are being loaded, then all Child records will be loaded as well... so everything should be available offline.

  11. #11
    Member jgrannis's Avatar
    Real Name
    Jeff Grannis
    Join Date
    Apr 2016
    Location
    New Iberia, LA
    Posts
    333

    Default Re: Lists with parent lists and pre-loaded data

    My understanding of what the "Pre-load data" option does is to set up the lists where it is really only the parent list that "stores" all the data for the parent and child(ren) lists.
    If you don't pre-render the UX and delay render for the parent list, open the app, and then take a look at the 3 lists' "_data", I do not believe you'll see any data in any of the lists.

    In the console (paste in the whole block of code into the console window):
    Code:
    var parentListData = DLG1_DlgObj.getControl('listParent')._data;
    var Child1ListData = DLG1_DlgObj.getControl('listChild1')._data;
    var Child2ListData = DLG1_DlgObj.getControl('listChild2')._data;
    table(parentListData);
    table(Child1ListData);
    table(Child2ListData);
    Once you explicitly call for the parent list to be refreshed, then you'll see the parent list with all the data (ie. the actual data for the parent rows and the data for the child lists included in that data).
    Run the above block of code again.
    You may see data in the children lists if a row in the parent list is selected but the data you see in those children lists will only contain the "filtered" child data of the selected parent row.
    I'm not sure if I'm being clear but if you check the "pre-load data" option, the children lists will not really "independently" contain any data and while offline, you will only see child data of a parent if its parent was loaded before going offline.

    You can also look at the Application tab in Chrome DevTools and then at Storage > Local Storage > file:// .....
    I believe that you should only see a key being stored for the parent list and no additional keys for the children lists. You'll see the child data stored in the parent list data there also.
    You can also look in the Chrome DevTools Network tab and see that when you refresh the parent list data that you'll see the child data "pre-loaded" under each of the parent rows. (click on the network call and then read the "response" data)

    I usually don't mix the Search functionality with offline apps; I'll always rely on client-side filtering. I am wondering if there isn't some sort of bug in that version where, during a search that requires a call to the server and where you receive new data for some "new" parent rows that were not part of the initial "pre-loaded data" load, that the child data of the any new parent row is not included in the search response and that that causes some unexpected exception.

    I've also seen, in older versions, where this:
    Code:
    parent list
              -> child list 1
                        -> child list 2
    is more stable* than when the children lists are "siblings":
    Code:
    parent list
              -> child list 1
              -> child list 2
    *more stable in terms of some list methods not working as expected. In older versions I know of at least the following list object's method not working well in the "sibling" case under some conditions: .updateTableRow and .addTableRowsBulk. I wouldn't doubt if other methods do not work as expected either in those cases.

Similar Threads

  1. parent/child lists in UX - issue when trying to hide a list
    By carlbsmith in forum Mobile & Browser Applications
    Replies: 2
    Last Post: 01-11-2018, 08:30 AM
  2. Replies: 0
    Last Post: 03-17-2015, 07:12 PM
  3. Parent & Child Lists
    By joegrun4 in forum Mobile & Browser Applications
    Replies: 12
    Last Post: 02-21-2015, 10:45 AM
  4. multiple child lists from a single parent list
    By wenbaugh in forum Mobile & Browser Applications
    Replies: 2
    Last Post: 11-23-2014, 11:12 PM
  5. Parent child grachild - in 3 dropdown lists
    By Marc King - A5solutions in forum Alpha Five Version 5
    Replies: 3
    Last Post: 03-03-2004, 07:45 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •