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

iOS7: NavigationWindow should work also inside Ti.UI.iPad.SplitWindow

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Alloy 1.3.0, Alloy 1.2.1
    • Component/s: Titanium SDK, XML
    • Labels:
      None
    • Environment:

      Alloy 1.2.1 from 1_2_X branch
      Alloy 1.3.0 from master branch
      TiSDK 3.1.3.v20130903160805

      Description

      Description

      <NavigationWindow> iOS Ui object should also be used inside a <SplitWindow> object for iPad.

      Sample

      In classic Titanium projects, this is showing two NavigationWindows inside a SplitView object (one as master view, the other as detail view)

      var win1 = Ti.UI.createWindow({
      	backgroundColor:'gray'
      });
       
      var label1 = Ti.UI.createLabel({
      	text:'detail view',
      	color:'orange',
      	font:{
      		fontSize:'24dp'
      	},
      	fontWeight:'bold'
      });
       
      win1.add(label1);
       
       
      var win2 = Ti.UI.createWindow({
      	backgroundColor:'purple'
      });
       
      var label2 = Ti.UI.createLabel({
      	text:'master view',
      	color:'orange',
      	font:{
      		fontSize:'24dp'
      	},
      	fontWeight:'bold'
      });
       
      win2.add(label2);
       
       
       
      var nav = Ti.UI.iOS.createNavigationWindow({
         window: win1
      });
       
      var masterView = Ti.UI.iOS.createNavigationWindow({
         window: win2
      });
       
      var splitwin = Ti.UI.iPad.createSplitWindow({
          detailView: nav,
          masterView: masterView
      });
       
      splitwin.addEventListener('visible',function(e){
          if (e.view == 'detail'){
              e.button.title = "Master";
              win1.leftNavButton = e.button;
          } else if (e.view == 'master'){
              win1.leftNavButton = null;
          }
      });
       
      splitwin.open();
      

      Alloy sample

      On Alloy, this sample code is throwing the following exception when run:

      [ERROR] :  SplitWindow must have exactly 2 children that are Windows, a master and detail respectively
      [ERROR] :  Alloy compiler failed
      

      index.xml

      <Alloy>
          <SplitWindow>
              <!-- First window is the masterView -->
              <NavigationWindow platform="ios">
              	<Window id="main" title="Main Window">
              	    <Label class="space">I am the master view</Label>
              	</Window>
         		 </NavigationWindow>
       
              <!-- Second window is the detailView -->
              <NavigationWindow platform='ios'>
              	<Window>
                  	    <Label>I am the detail view.</Label>
             		</Window>
              </NavigationWindow>
          </SplitWindow>
      </Alloy>
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tlukasavage Tony Lukasavage
                Reporter:
                fcasali Federico Casali
              • Watchers:
                2 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