• mView Duplicate Entries

    By Aden Roper 1 decade ago

    Hi There,

    Wondered if anyone had a similar issue whereby sporadically view entries are being loaded in twice (sometimes more). I happens rarely but is quite annoying when it does.

    It is as though an event is being fired which loads in the entries via "readviewentries" but is not stopping and being fired again, with the result of the same data more than once (minus the last entry, which is not there.).

    Wondered if anyone had seen this.

    Regards

    • Yes

      By Clay Martin 1 decade ago

      I am also having the same issue with duplicate entries.

      Looks fine when opening with FireFox, but opening it via iPhone 4 i get duplicates.

    • I over came this by...

      By Sean Bannister 1 decade ago

      Hi,

      I was able to stop this from happening by modifying the mview custom control so as to call the scrollingDetectorFunctionCall function right away instead of letting setInterval make the first call. 

      ...

      LN64: scrollingDetectorFunctionCall;    //<==Added this line                    
      LN65: setInterval(scrollingDetectorFunctionCall, 500);

      We are still testing it ...

      Regards

      Sean

      • Did it work?

        By Clay Martin 1 decade ago

        Hi Sean,

        Did you get it too work?  I tried your suggestion but no joy.

        Cheers

        Clay

    • Fixed.....

      By Clay Martin 1 decade ago

      Not sure if it is the right approach but I moved the setValue isViewLoading into the http_request and after it has added the entries to the dom .

      mobileControls.js

                      var nextEntryNumber = parseInt(getValue(nextEntry, getViewStateIndex(viewItemsId)));
                      http_request.open("GET", databaseAndViewName + "?ReadViewEntries" + categoryFilter + "&Start=" + nextEntryNumber + "&Count=" + getValue(amountEntriesToBeRead, getViewStateIndex(viewItemsId)) + "&OutputFormat=JSON", true );
                      http_request.onreadystatechange = function () {

                          if (http_request.readyState == 4 && http_request.status == 200) {
                              if (nextEntryNumber == 1) {
                                  if (enableOffline == true) {
                                      localStorage.setItem("MobileControlsView", http_request.responseText);
                                  }
                              }
                         
                              addViewEntriesIntoDOM(viewItemsId, http_request.responseText, false, true, targetPageName, targetUrl, transition, enableOffline, offlineDocumentPath, columnNumber);            
                              setValue(isViewLoading, getViewStateIndex(viewItemsId), "false");
                          }
                      };
                      http_request.send(null);
                  }
                  prog.stop();
      //            setValue(isViewLoading, getViewStateIndex(viewItemsId), "false");
              }
       

    • Has anyone fixed this?

      By Ralph P Menon 1 decade ago

      Hello everyone at OpenNTF.org!

      I recently started usind these fine mobile controls and ran into the same problem people are describing here. When developing I didn't have problems until I checked with a "real" mobile connection and got sporadic double entries and other strange issues.

      I tried both solution approaches in this thread but none of them fixed the problem.

      Has anyone elso got a solution for that? I

      Ralph