Skip to Content
author's profile photo Former Member
Former Member

View or fragment with controller

Hi,

I created a main view to which I have to add a panel that has its own controller, controller different view. I thought about introducing the panel in a View or a fragment and then add it to the main View, what would be the best option?

I have two options:

1. Create a view with sap.ui.xmlview (the controller be indicated in the View)

2. Create a fragment with sap.ui.xmlfragment (the controller be a parameter of this function)

In principle I opted more for the first option. Because the natural behavior of the fragments is not having a controller associated, but depend on the controller of View, what do you think?

Regards.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jul 28, 2016 at 09:22 AM

    It could be better if you could use fragments, because you can reuse this fragments. As well as you can able to call this fragments from different controllers.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.