Hi Jun,
I think that link talks more about javascript views (though the information provided there are useful). Also, I am developing something which doesnot use FLP. So, can you please explain it from a stand alone xml fragment perspective?
Also just for clearing out my queries, I am pasting the response from reference thread here. I have mentioned my queries in bold:
at the calling side (Question:
1. Does the following code is used to add the controller of the view (which is being reused) to the caller? 2. As I use xml fragments, I have added the fragment to the view assembly using <core:Fragment fragmentName="com.test.view.MyViewFragment" type="XML" />. So where should I write the following code?)
var oComp = sap.ui.getCore().createComponent( {
name : "com.abc.***",(Question:
1. Suppose caller component name is "com.target.Caller" and the called component name space is "com.source.Reuse". With this assumption, what value should I mention for "name" here?
2. Will it cause any issue as the name spaces are different?)
id : "Comp3",
url : "/appurlforthecomponent", (Question: How can I determine url to the component? Should that be the url to com.target.Caller or com.source.Reuse?)
componentData : {
"targetViewName" : "saywhichviewyouwant" (Question: I hope I should mention com.test.view.MyViewFragment here. How can I do that? As i refer the fragment in the view itself, is this necessary?)
}
});
var oCompCont = new sap.ui.core.ComponentContainer("CompCont3", {
component : oComp
});
at the providing side (Question: Can you quote this with an example code?)
in createcontent function of your component, you can check componentData to see which view is requested. you will return the view requested.
Thanks,
Faddy