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

BlackBerry: closing a child window with Ti.UI.Window.close() closes the application

    Details

      Description

      Problem

      When closing a child window with Ti.UI.Window.close(), the whole application get closed.

      actual behavior

      application close

      expected behavior

      close child window only

      Test case

      app.js

      var win = Ti.UI.createWindow();
       
      function initWebViewWindow(url, timeout) {
          var self = Ti.UI.createWindow({
              backgroundColor : 'white'
          });
       
          var view = Ti.UI.createView({
              top : '90%',
              left : 0,
              height : '10%',
              backgroundColor : '#08A7DC'
          });
       
          var backView = Ti.UI.createView({
              left : 0,
              top : 0,
              width : '100%',
              bottom : 0
          });
       
          var backLabel = Ti.UI.createLabel({
              top : 4,
              left : 10,
              right : 0,
              bottom : 0,
              text : 'Back',
              color : 'white',
              font : {
                  fontSize : 16,
                  fontFamily : 'Helvetica Neue'
              },
              textAlign : 'center',
              touchEnabled : false
          });
       
          backView.add(backLabel);
          view.add(backView);
       
          backView.addEventListener("click", function(e) {
              Ti.API.info('-------------------> backView click');
              self.close();     // <<<<==== This accidentially closes the whole Application!!!
          });
       
          self.add(view);
       
          var webview = Ti.UI.createWebView({
              top : 0,
              left : 0,
              right : 0,
              height : '90%',
              url : url
          });
       
          // TODO: timeout not there yet
          // webview.setTimeout(timeout);
       
          webview.addEventListener('load', function(e) {
              Ti.API.info('-------------------> webview load');
              Ti.API.info(e);
          });
       
          webview.addEventListener('beforeload', function(e) {
              Ti.API.info('-------------------> webview beforeload');
              Ti.API.info(e);
          });
       
          webview.addEventListener('error', function(e) {
              Ti.API.info('-------------------> webview error');
              Ti.API.info(e);
          });
       
          self.add(webview)
          return self;
       
      }
       
      var button = Ti.UI.createButton({
          title : 'open WebView Window'
      });
       
      button.addEventListener('click', function(e) {
          var webViewWindow = initWebViewWindow('http://www.google.com', 5000);
          webViewWindow.open();
      });
       
      win.add(button);
      win.open();
      

      Discussions

      Link to Google Groups: Appc Ti Mobile BlackBerry

        Attachments

          Activity

            People

            • Assignee:
              joshroesslein Josh Roesslein
              Reporter:
              mkroeger Matthias Kroeger
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration