facebook

Dynamic List still not clickable: CLOSED

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 6 posts - 16 through 21 (of 21 total)
  • Author
    Posts
  • #332134

    Hi tteasdale,

    The Dev team is investigating about this issue, will follow up as soon as I know more info.

    #332162

    support-michael
    Keymaster

    Solution to your issue:

      
     ...
     //build list css class list
       cssClassList = i==1 ? firstItemClass : '';
       cssClassList += i==itemCnt ? lastItemClass : '';
       cssClassList += internalItemClass;
       list.append(
         '<li id="m1-Sample_DB4ipad-listItem1" class="' + cssClassList + '"' +
         '      data-action-click-id="action14" data-listitem-index="' + i + '">'+
         '   <div id="m1-Sample_DB4ipad-listItem1-inner-div">'+
         '       <div id="m1-Sample_DB4ipad-text1" class="m1-text m1-font-5 m1-active-color-1">'+ 'foo' +'</div>'+
         '       <div id="m1-Sample_DB4ipad-text2" class="m1-text m1-font-5 m1-active-color-1">'+ 'bar' +'</div>'+
         '   </div>'+
         '</li>');
      }
    
      //Update panel's content height, set the ht value on the panel's 
      //  scroller <div> data-layout-content-height attribute.
      //  panelHt = header ht + listItems ht + footer ht
      var panelHt = 30 + itemCnt * 44;
      $('#m1-Sample_DB4ipad-panel1-scroller').attr('data-layout-content-height', panelHt);
        
      phoneui.preprocessDOM('#m1-Sample_DB4ipad'); // <------------ add this line, rebinds event handlers for the screen
    
    

    Seems I got a little confused by the indentation of your code and my 1st attempt I misplaced the phoneui.preprocessDOM() call just outside of this block… So I went on goose chase yesterday. Needed to clear head and revisit. Another dev pointed out the issue. Note we have much improved editors in the dev stream now that we are testing and will release soon to help improve code formatting.

    #332188

    tteasdale
    Member

    That did the trick. Thanks guys!!

    #336644

    jim
    Member

    @support-wayne wrote:

    Solution to your issue:

      
     ...
    [b]  phoneui.preprocessDOM('#m1-Sample_DB4ipad'); // <------------ add this line, rebinds event handlers for the screen[/b]
    

    I rewrote this issue in the message below as I learned more about the behavior.

    #336694

    jim
    Member

    OK, I’ll post a little more detail. I need that line of code “phoneui.preprocessDOM” with the screen id for my list links to work. This is the very bizarre behavior I’m experiencing.

    I have a function called populateDB which works when you press a button. When I don’t have the phoneui.preprocessDOM line of code it works fine and will write 2 records when I push the button.

    When phoneui.preprocessDOM(‘screenid’) is inserted into my code then the following will happen when I first enter the app

    1st click of populateDB button – writes 4 records instead of 2
    2nd click of populateDB button – writes 16 records instead of 2
    3rd click of populateDB button – writes 32 records instead of 2
    4th click …. etc. etc.

    If I remove the phoneui.preprocessDOM then everything works fine except the list is no longer clickable.

    
    The button executes:
        db.transaction(populateDB, errorCB);
        db.transaction(queryDB, errorCB);   >>> this rewrites the records to the list on the screen and is what has the phoneui.preprocessDOM at the end
    
            //************************
            function populateDB(tx) {
            //************************            
                tx.executeSql('CREATE TABLE IF NOT EXISTS spotRecords (id INTEGER PRIMARY KEY AUTOINCREMENT, spotID TEXT NOT NULL, desc TEXT NOT NULL, color TEXT NOT NULL, misc TEXT NOT NULL)');
                tx.executeSql('INSERT INTO spotRecords(spotID, desc, color, misc) VALUES ("Jims", "Desc1","green","")');
                tx.executeSql('INSERT INTO spotRecords(spotID, desc, color, misc) VALUES ("test2", "Desc2","blue","")');
            }
    

    Thanks in advance if anyone can possibly make sense of this. .

    #336699

    jim
    Member

    After rewriting my code 10 different ways, I finally figured it out.

    Changed the code Wayne recommended to use the list name and not the entire screen. I don’t completely understand what this code does but it worked. The strange multiple events happening stopped and the clicking of the items also works.

    phoneui.preprocessDOM('#m1-screenName-List1');

    Now I can go back to living a normal life as this was driving me crazy.

    Jim

Viewing 6 posts - 16 through 21 (of 21 total)
Reply To: Dynamic List still not clickable: CLOSED

You must be logged in to post in the forum log in