cancel
Showing results for 
Search instead for 
Did you mean: 

How to call select dialog from Popover list item click?

Jayakrishnan
Active Participant
0 Kudos

Hi All,

I am working on one Custom SAPUI5 application with sap.m.table. In my table i have 5 columns. last column for button. i displayed overflow menu button in my each list item row.

whenever user press the button, it should open the popover. Inside the popover i need to show one list. It is a hard coded list ,as of now i just used 3 standard list as a list item.

But once i click the list item, i need to open the select dialog. But the itempress event is not at all responding in my controller? i tried in debug,i put the break point but the event is not triggered? Could anyone please help me on this?

Please find the code,image below for better understanding.

Image:

popover fragment xml code:

<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core">
	<Popover showHeader="false" contentWidth="320px" contentHeight="300px" placement="Left">
		<NavContainer >
			<Page title="Order Information">
				<List >
					<StandardListItem title="OrderList" type="Active" press="onNavToOrder" iconDensityAware="false" iconInset="false"/>
					<StandardListItem title="OrderList1" type="Active" press="onNavToOrder2" iconDensityAware="false" iconInset="false"/>
					<StandardListItem title="OrderList2" type="Active" press="onNavToOrder3" iconDensityAware="false" iconInset="false"/>
				</List>
			</Page>
		</NavContainer>
	</Popover>
</core:FragmentDefinition>

Controller code in table :

var tableNotificationCellC = new sap.m.Button({
					icon: "sap-icon://overflow",
					type: "Transparent",
					press: function(oEvent) {
						notifNumberForContextMenu = oModel.getProperty(oEvent.getSource()
								.getParent()
								.getBindingContext()
								.getPath())
							.NotifNo;


						// create popover
						if (!this._oPopover) {
							this._oPopover = sap.ui.xmlfragment("com.db.zmai_ui5_kblt.util.ContextMenuPopover", this);
							that.getView()
								.addDependent(this._oPopover);
						}


						this._oPopover.openBy(oEvent.getSource())


					}
				});

Thank you,

JK.

Accepted Solutions (1)

Accepted Solutions (1)

maheshpalavalli
Active Contributor
0 Kudos

Hi Jayakrishnan Chandramohan

I am assuming your item press event is in the controller. When i look at the code, you are mixing "that" and "this" together..

I am assuming that you don't have the controller scope inside the button press event handler so you are using "that" which has controller scope.

In your below code, you are passing "this" reference which will the button reference(scope) you are passing..

this._oPopover = sap.ui.xmlfragment("com.db.zmai_ui5_kblt.util.ContextMenuPopover", this);

Just pass that there, you can even change this._oPopover to that._oPopover

that._oPopover = sap.ui.xmlfragment("com.db.zmai_ui5_kblt.util.ContextMenuPopover", that);

BR,

Mahesh

Jayakrishnan
Active Participant
0 Kudos

Hey Mahesh, thanks for your comment. It is working.

Answers (0)