Skip to Content
0
Jun 14, 2016 at 06:04 PM

ResponsivePopover control issue in XML View

636 Views

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:content>

</l:Grid>

</content>

</ResponsivePopover>

</core:FragmentDefinition>

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.