Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-1726

hideNavbar/showNavbar on tableview searchbar focus/blur whites out first page of results

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: iOS

      Description

      {html}<div><p>Another tableview bug I've noticed with a working test case.
      Basically I like to hide the navbar when searching as it creates
      more room for the user to see his/her results. With a tableview
      with custom labels in it and/or one with a custom row height (not
      sure which exactly), searching causes the first page of results to
      be blank. It appears to be a rendering error as if you scroll past
      it and then back up, they are redrawn correctly.</p>
      <p><strong>To reproduce, do the following:</strong> 1. Take the
      code below, throw it in a navgroup (or tabgroup, whatever
      works)...or change it slightly to make it its own window<br>
      2. When you go to the page, you'll see a list of rows. Search for
      the text "test"<br>
      3. As you type you'll notice the results are shown correctly, no
      problems here<br>
      4. Then, hit the blue Search button on the keyboard. The searchbar
      blur event is sent, and the navbar is restored. This clears the
      first page of results.<br>
      5. Scrolling down and back up shows the first page properly.</p>
      <p>I've confirmed this with both 1.4.0 and the 1.4.1 nightly from
      9/2/2010. The controls are contained in a rowView, but removing
      that doesn't fix it. Also, trying to scroll the tableview to the
      top to try to invoke a refresh doesn't work either.</p>
      <p>Here's the code:</p>
      <pre>
      <code class="javascript">var win = Ti.UI.currentWindow;
      var max = 100;
      var data = [];

      for (var i=0; i<max; i++) {

      var row = Ti.UI.createTableViewRow({ label:"Testing: " + i, className:'testRow'+i, height:100, });

      var rowView = Ti.UI.createView({ top:0, left:0, height:100, });

      var nameText = Ti.UI.createLabel({
      font:{fontSize:18,fontWeight:'bold'},
      left:70,
      top:2,
      height:25,
      width:220,
      text: "Testing: " + i
      });
      rowView.add(nameText);
      row.add(rowView);
      data[i] = row;
      }

      //
      // CREATE SEARCH BAR
      //
      //disable it for now due to bug rendering results (first few rows are blank after Search btn is selected)
      // however, filtering while we type works fine...very weird...
      var search = Ti.UI.createSearchBar({ showCancel:false });
      search.addEventListener('change', function(e) { return e.value; // search string as user types });
      search.addEventListener('cancel', function(e) { search.blur(); });

      //HAVING THIS HERE IS WHAT MESSES THE TABLE DISPLAY UP AFTER THE SEARCH BUTTON IS CLICKED
      search.addEventListener('focus', function(e){ win.hideNavBar(); });

      search.addEventListener('blur', function(e){ win.showNavBar(); });
      //////////////////


      var tableview = Ti.UI.createTableView({
      search:search,
      data:data,
      filterAttribute:'label'
      });


      //Setup
      win.add(tableview);</code>
      </pre></div>{html}

        Attachments

          Activity

            People

            • Assignee:
              rseagraves Reggie Seagraves
              Reporter:
              robby Robby
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-1549
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration