Step 15: Nested Views


Our panel content is getting more and more complex and now it is time to move the panel content to a separate view. With that approach, the application structure is much easier to understand, and the individual parts of the app can be reused.


Step 15: Nested Views - 第1张  | 优通SAP


You can view and download all files at Walkthrough – Step 15.


Instead of putting the panel and its content directly into our App
view, we will move it to a new separate HelloPanel view. We refer to
this using an XMLView tag in the content aggregation of the panel.

3.webapp/view/HelloPanel.view.xml (New)

The whole content for the panel is now added to the new file
HelloPanel.view.xml. We also specify the controller for the view by
setting the controllerName attribute of the XML view.

4.webapp/controller/HelloPanel.controller.js (New)

To have a reusable asset, the method onShowHello is also moved from the
app controller to the HelloPanel controller.


We have now moved everything out of the app view and controller. The app controller
remains an empty stub for now, we will use it later to add more functionality.



20 + 14 =