multiple views(Enyo)

Hi, This code is loading the search.js file in the begining.
Now what i want is that when my app. starts only view button should appear clicking on which inturn should load the search.js . but it's loading the search.js without pressing the view button.
Thanx:)
/* Copyright 2009-2011 Hewlett-Packard Development Company, L.P. All rights reserved. */

enyo.kind({
	name: "enyo.Canon.HelloWorld1",
kind: "enyo.VFlexBox",
	 components: [
      {kind: "PageHeader", components: [
          {kind: enyo.VFlexBox, content: "Switching btw views", flex: 1},
		   
          {name: "backButton", kind: "Button", content: "Back", onclick: "goBack"}
      ]},
	   {name: "viewButton", kind: "Button", onclick: "view"},

      {name: "pane", kind: "Pane", flex: 1, onSelectView: "viewSelected",
          components: [

              {name: "search", className: "enyo-bg", kind: "MyApps.Search"}
              
          ]
      }
  ],
  create: function() {
      this.inherited(arguments);
      //this.$.pane.selectViewByName("search");
  },
  view:function()
  {
     this.$.pane.selectViewByName("search");
  },

  viewSelected: function(inSender, inView) {
      if (inView == this.$.search) {
         // this.$.webView.setUrl("");
          this.$.backButton.show();
      } 
  },
  goBack: function(inSender, inEvent) {
      this.$.pane.back(inEvent);
  }
});

Comments

  • The first component of the Pane is what will be displayed when you don't select anything. So, you'll want to put whatever components you want displayed when the Search pane is not loaded, above it in the components list there.

  • ya that's fine..what i want is to load the first pane(search.js)(that i have done) and in search.js i have a button . Now i want that when i click on this button(which is in search.js) another pane should get load. how do i do this?
  • put in another named component in the Pane, and this.$.PaneName.selectViewByName("otherviewname");
Sign In or Register to comment.