Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1019] App crash on controller.close when the searchBar has focus

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionCannot Reproduce
Resolution Date2015-12-14T14:25:13.000+0000
Affected Version/sAppcelerator Studio 4.4.0
Fix Version/sn/a
Componentsn/a
Labelsn/a
Reporterdbenhenni
AssigneeRadamantis Torres-Lechuga
Created2015-11-26T14:05:02.000+0000
Updated2016-03-08T07:37:21.000+0000

Description

Steps to Reproduce

create a window with a 'close'-Button a simple action: $.getView().close(); after that create a simple listView (I used Alloy) with a searchbar. When you run this on iPad and your searchView has focus and you click now (with the focussed searchbar) the close-Button. The app crashes without giving any errorMessage in the console.

Actual Result

when I'm focussing the SearchBar of my ListView and click on my 'close-Button' (including the following code: $.getView().close();) the app crashes without any errorMessage in the console.

Expected Result

The controller should be closed. The app should shut down.

Attachments

FileDateSize
.log2015-11-26T14:05:09.000+00006484747
demoapp.zip2015-12-16T16:37:31.000+00001261
diagnostic7426290897126324166.log2015-11-26T14:05:18.000+0000101014

Comments

  1. Sharif AbuDarda 2015-11-30

    Hello [~dbenhenni], Please provide a test code of your problem. Also, you can take a look at these links below. [Link1](https://developer.appcelerator.com/question/176929/how-to-close-an-alloy-window-from-controller-of-required-view). [Link2](https://developer.appcelerator.com/question/154457/close-windows-with-alloy).
  2. dbenhenni 2015-12-01

    Hi Sharif AbuDarda , ** ...
    function openHome() {
       $.listview.getSearchView().blur();
       $.getView().close();
       }
    When I click into the searchBar field, so the searchBar has focus, and I'm clicking my close-button (function openHome), the app crashes without any errorMessage in the console. It is the same behaviour within all of my listviews. I'm running the newest Appcelerator version and SDK without any luck. Best regards
  3. Sharif AbuDarda 2015-12-09

    Hello [~dbenhenni], I tried tested your issue with a classic code, The code is working fine. No app crash happens. See the code below. Thanks.
       var win = Ti.UI.createWindow({
           backgroundColor : 'white',
           fullscreen : true
       });
       
       var close = Ti.UI.createButton({
           title : 'close',
           top : 0,
           height : 20
       });
       win.add(close);
       
       close.addEventListener('click', function() {
           win.close();
       });
       
       var search = Titanium.UI.createSearchBar({
           barColor : '#000',
           showCancel : true,
           height : 43,
           top : 0,
       });
       search.addEventListener('cancel', function() {
           search.blur();
       });
       
       var listView = Ti.UI.createListView({
           searchView : search,
           caseInsensitiveSearch : true,
           top : 50
       });
       var listSection = Ti.UI.createListSection();
       var fruits = ['Papaya', 'Peach', 'Pear', 'Persimmon', 'Pineapple', 'Pluot', 'Pomegranate'];
       var data = [];
       for (var i = 0; i < fruits.length; i++) {
           data.push({
               properties : {
                   title : fruits[i],
                   searchableText : fruits[i]
               }
           });
       }
       listSection.setItems(data);
       listView.addEventListener('noresults', function(e) {
           alert("No results found!");
       });
       listView.sections = [listSection];
       win.add(listView);
       win.open(); 
       
  4. Julian Buss 2015-12-16

    I can clearly reproduce with the demoapp attached (only app/controller and app/view folders). Tested with most recent SDK 5.1.1. Steps to reproduce: - create a new Alloy app - copy app/controller and app/view folders from the demoapp.zip to your app - start app on iPad simulator - index.xml opens jbtest.xml automatically, now click on "schließen" button in the upper left -> the window closes and the index window is visible - now start the app again, click in the searchbar so that the searchbar has focus, now click the button "Schließen" -> app crashes

JSON Source