loio |
---|
234320f8d8ee45b39c60893116d60351 |
view on: demo kit nightly build | demo kit latest release
Example how both types of fragments can be instantiated in an XML view.
In XML views, fragments are used like regular controls, or more precisely, like views.
The following code example shows an XML view that includes both types of fragments, that is an XML fragment and a JS fragment. Each type is instantiated once without a given ID and once with a given ID. These fragment references basically work like import statements including the fragment content controls.
<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns:core="sap.ui.core" controllerName="testdata.fragments.XMLViewController" >
<core:Fragment fragmentName="my.useful.SimpleUiPart" type="XML" />
<core:Fragment id="xmlInXml" fragmentName="my.useful.SimpleUiPart" type="XML" />
<core:Fragment fragmentName="my.useful.UiPartX" type="JS" />
<core:Fragment id="jsInXml" fragmentName="my.useful.UiPartX" type="JS" />
</mvc:View>
Related Information