inital scene

enyo.kind({
	name: "HelloWorld",
kind: "VFlexBox",
 style: "margin:8px 0px 10px 0px;" ,
	components: [ 

 {name: "panefile", kind: "Pane", flex: 1, onSelectView: "viewSelected",
          components: [
		   {name: "search", className: "enyo-bg", kind: "MyApps.Search"}
              
          ]
      }


],

create: function(){
 this.yourInit(); 
},
yourInit: function(){
//HERE I HAVE MY CODE THAT GIVES ME  MY INITIAL LAYOUT
in b/w i have the line ...
{BUTTON PRESS FUNCTION}
     this.$.panefile.selectViewByName("search");
Now My app is giving me the initial layout! but it is not giving me the search scene which i should get upon pressing one button in the layout?? i have included my search file in depends.js!
probably i think i have put my layout code in YourInit() that is being called everytime through create function..
ny help??
thanx.

Comments

  • edited March 2012
    First, the default view for a pane is always the first view that is loaded automatically when the Pane is created. Second, I don't see a button in your components block.

    Where exactly is your call to selectViewByName? In a separate method or in the yourInit method?

    Oh, and add the line this.inherited(arguments); above this.yourInit(); in the create function.
  • my view in the pane is search but it's not loaded initially..but the code inside my yourinit() is getting loaded.(and i also want this). Yes i do have a seprate method through which i have called selectviewbyname but then too search view is not getting loaded?...and what is the purpose of this.inherited(arguments); ?
  • edited March 2012
    this.inherited(arguments) calls the same method on the super-kind (in this case the create method is called).

    If you don't call this nothing will be rendered. It's possible that none of your code is functioning correctly simply because this call is missing.

    Also, I think you misunderstand about the Pane: the first view in the pane will be loaded when the app starts up regardless of whether you tell it to or not. This is the default behaviour of a Pane.
Sign In or Register to comment.