0

In my app I have a project controller and a tree view in my viewport. The treeview displays a list of projects. In the center of my viewport there is a tab panel. When I select I project in my tree view I want to open a specific tab for the current project. That works fine in my project controller.

To clean my code I want to extract this logic in a new ProjectDetails controller which is responsible for the tab opening and my Tabs form. What will be the right way to do that? I would create a new controller and instead of opening the tab I would load this new controller, init it and launch it.

But how to put the project as param to the controller and in which method I should open my tab and assigning events to the components? I thought the init method is too early because the components aren't created...

Thanks and regards!

Izhaki
  • 23,372
  • 9
  • 69
  • 107
Gerrit
  • 2,515
  • 5
  • 38
  • 63
  • It is important to know that controllers are global - you can have the same controller controlling a multitude of similar views, given the controller logic is the same per view. In other words, the same controller can work with 6 similar views. I believe this is your case? – Izhaki Mar 03 '13 at 16:38
  • Thank you for this comment. I've now created a new controller and fired an application event on selecting a node of the tree. This event is handled by the other controller to separate the logic. – Gerrit Mar 03 '13 at 21:18

0 Answers0