Uploaded image for project: 'Alloy'
  1. Alloy
  2. ALOY-466

Alloy TableViews with sections not reliably passing 'click' events

    Details

      Description

      If you create a TableView in an Alloy View, and then populate it with TableViewRow's which are created from Alloy view files, then click events are not passed to the parent. NOTE: if you create rows in dynamically in code or pre-defined in the TableView.xml file, then click events are passed.

      ref: Q&A

      code to reproduce:
      index.xml

      index.xml

      <Alloy>
          <Window>
          <TableView id="jobsTable" onClick="rowWasClicked">
              <TableViewSection id="activeSection" headerTitle="Current jobs"/>
              <TableViewSection id="futureSection" headerTitle="Future jobs">
                 
              </TableViewSection>
          </TableView>
          </Window>   
      </Alloy>
      

      testRow.xml
      (.js and .ts files are blank)

      <Alloy>
          <TableViewRow id="row">
              <View id="view" backgroundColor="red" width="20" height="20"  />
          </TableViewRow>
      </Alloy>
      

      index.js

      index.js

       
      function rowWasClicked(e) {
          alert('you pressed me');
      }
       
      for (var i = 0; i < 5; i++) {
         //$.activeSection.add(Ti.UI.createTableViewRow({title: 'row ' + (i+1)}));
       
         var args = {};
         var row = Alloy.createController('testRow', args).getView();
          //row.bubbleParent = true;
       
           $.activeSection.add(row);
       
      }
       
      $.index.open();
      

      notes

      (tableViewRow.xml is code I took from the TableViewRow online doc.)

      If I remove the View (in the row), it works perfectly. If the View is in place, then only the 1st row responds to taps. (Using the iOS simulator.) The other rows are silent. It seems that other elements (<Label/>) etc don't seem to cause a problem.

      And again, my table works perfectly IFF I don't use sections.
      I also found the behavior (good or bad) doesn't always respond to my changes in the code unless I do a 'project clean'.

      I also tried forcing $.view.bubbleParent = true but that didn't help anything.

      Please let me know if you need more info or test cases.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tlukasavage Tony Lukasavage
                Reporter:
                kenny Joel Margolese
              • Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration