Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1137] Modal windows in split view completely screwed

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2011-04-15T02:44:58.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0
ComponentsiOS
Labelsn/a
ReporterStephen Tramer
AssigneeStephen Tramer
Created2011-04-15T02:44:57.000+0000
Updated2017-03-02T19:22:31.000+0000

Description

Run the following (slightly modified) #929 test:

var win = Ti.UI.createWindow();

var data = [
{title:'May 6, 2010 Report - Week 1', hasChild:false, test:1, header:'May 2010'},
{title:'April 26, 2010 Report - Week 4', hasChild:false, test:2, header:'April 2010'}
]
 
var nav = Ti.UI.iPhone.createNavigationGroup({
   window: win
});

tableview = Titanium.UI.createTableView({
    data:data,
    style: Titanium.UI.iPhone.TableViewStyle.GROUPED,
    backgroundColor:'transparent',
    rowBackgroundColor:'white'
});


var newView1 = Titanium.UI.createView({
    backgroundColor:'blue'
});

newImageView = Titanium.UI.createImageView({
    url:'default_app_logo.png',
    top:100,
    left:100,
    height:100,
    width:100
});

newImageView.addEventListener('click', function(e)
{
    var w = Titanium.UI.createWindow({ 
        backgroundColor:'#336699',     
        title:'Modal Window',
        barColor:'black',
        url:'largechart_scrollable.js',
        modal:true
    });
    
    var flexSpace = Titanium.UI.createButton({
        systemButton:Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE
    });

    var bb = Titanium.UI.createButton({
        title:'Return to Thumbnail View',
        style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED     
    });

    // Add a toolbar
    var toolbar1 = Titanium.UI.createToolbar({
        items:[bb,flexSpace],
        top:0,
        borderTop:true,
        borderBottom:true
    });

    bb.addEventListener('click', function()
    {
        w.close();
    });
    
    w.add(toolbar1);
    w.open();
});

newView1.add(newImageView);

//create the scrollable (right-hand view)
var scrollView = Titanium.UI.createScrollableView({
    views:[newView1], // can add in addition views here
    showPagingControl:true,
    pagingControlHeight:30,
    maxZoomScale:2.0,
    currentPage:0
});

win.add(scrollView);
 
var splitwin = Ti.UI.iPad.createSplitWindow({
    detailView:nav,
    masterView:tableview
});
 
splitwin.addEventListener('visible',function(e)
{
    if (e.view == 'detail')
    {
        e.button.title = "Master";
        win.leftNavButton = e.button;
    }
    else if (e.view == 'master')
    {
        win.leftNavButton = null;
    }
});
 
splitwin.open();

Click on the image to make the modal window appear. Which direction will it slide in from? How will the view re-orient? Nobody knows.

Comments

  1. Stephen Tramer 2011-04-15

    Actually, this makes for a better test:

       
       var data = [
       {title:'May 6, 2010 Report - Week 1', hasChild:false, test:1, header:'May 2010'},
       {title:'April 26, 2010 Report - Week 4', hasChild:false, test:2, header:'April 2010'}
       ]
       
       tableview = Titanium.UI.createTableView({
           data:data,
           style: Titanium.UI.iPhone.TableViewStyle.GROUPED,
           backgroundColor:'transparent',
           rowBackgroundColor:'white'
       });
       
       
       var newView1 = Titanium.UI.createView({
           backgroundColor:'blue'
       });
       
       newImageView = Titanium.UI.createImageView({
           url:'default_app_logo.png',
           //top:100,
           //left:100,
           height:100,
           width:100
       });
       
       newImageView.addEventListener('click', function(e)
       {
           var w = Titanium.UI.createWindow({ 
               backgroundColor:'#336699',     
               title:'Modal Window',
               barColor:'black',
               url:'largechart_scrollable.js',
               modal:true
           });
           
           var flexSpace = Titanium.UI.createButton({
               systemButton:Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE
           });
       
           var bb = Titanium.UI.createButton({
               title:'Return to Thumbnail View',
               style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED     
           });
       
           // Add a toolbar
           var toolbar1 = Titanium.UI.createToolbar({
               items:[bb,flexSpace],
               top:0,
               borderTop:true,
               borderBottom:true
           });
       
           bb.addEventListener('click', function()
           {
               w.close();
           });
           
           w.add(toolbar1);
           w.open();
       });
       
       newView1.add(newImageView);
       
       //create the scrollable (right-hand view)
       /*
       var scrollView = Titanium.UI.createScrollableView({
           views:[newView1], // can add in addition views here
           showPagingControl:true,
           pagingControlHeight:30,
           maxZoomScale:2.0,
           currentPage:0
       })
       */;
       
       var splitwin = Ti.UI.iPad.createSplitWindow({
           detailView:newView1,
           masterView:tableview
       });
        
       splitwin.addEventListener('visible',function(e)
       {
           if (e.view == 'detail')
           {
               e.button.title = "Master";
               win.leftNavButton = e.button;
           }
           else if (e.view == 'master')
           {
               win.leftNavButton = null;
           }
       });
        
       splitwin.open();
       

    This removes any issues caused by #929.

  2. Stephen Tramer 2011-04-15

    Somehow, I didn't bother checking the largechart_scrollable.js file for supported orientations until now.

  3. Lee Morris 2017-03-02

    Closed as invalid.

JSON Source