on 06-14-2016 7:04 PM
Hi All,
I wanted to get the "Responsive Popover" on a icon of a FeedListItem. I have tried Responsive PopOver with setModel. Some how, it is not binding the data on responsive popover control. Here is my code. I am unable to find out where I am doing wrong in the following code. As of now, I am getting the output in the responsive pop over as "{mytest>value}"
My Controller Code
onPress:function(oEvent)
{
var selecteditem = oEvent.getSource().getSender();
var mDLData =
{
label: "DL Name",
value: selecteditem,
};
var oDLModel = new sap.ui.model.json.JSONModel();
oDLModel.setData(mDLData);
var oPopover = this._getPopover();
var oSource = oEvent.getSource();
// connect dialog to view (models, lifecycle)
this.getView().addDependent(oPopover);
//oPopover.bindElement(oSource.getBindingContext().getPath());
this._oPopover.setModel(oDLModel,"mytest");
// open dialog
oPopover.openBy(oEvent.getParameter("domRef"));
},
_getPopover : function () {
// create dialog lazily
if (!this._oPopover) {
// create popover via fragment factory
this._oPopover = sap.ui.xmlfragment(
"my_dls.view.ResponsiveMail", this);
}
return this._oPopover;
},
My Responsive Fragment Code is
<core:FragmentDefinition xmlns="sap.m" xmlns:l="sap.ui.layout" xmlns:core="sap.ui.core">
<ResponsivePopover title="test2" class="sapUiPopupWithPadding">
<content>
<l:Grid>
<l:content>
<Text text="{mytest>value} " />
</l:Grid>
</content>
</ResponsivePopover>
My View Code
<FeedListItem
sender="{fake>NativeData}"
icon="sap-icon://email"
iconPress="onPress"
iconDensityAware="false"
/>
If anybody knows responsive pop over with model (binding data at run time using model), please help me with a sample code.
Thanks,
Geetha Rani.
Hi Geetha Rani,
Do you want to display the data context from list to responsive popover?
If so, then you have to get the binding context of the list item and you need to set it to Responsive popover.
Also if you declare a model name, then while using get and set binding context, you have to pass the model name in arguments.
API: JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.ui.base.ManagedObject
Here is a code sample: Plunker
Regards,
Sai Vellanki.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Geetha,
Make it Dynamic. Plunk edited with two lists and making use of single Responsive Popover: Plunker
Regards,
Sai Vellanki.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.