Skip to Content
0
Former Member
Apr 09, 2014 at 10:50 AM

Get the second parent id using select event in SAPUI StandardListItem

148 Views

I have a Table control in my SAPUI5 xml view and in the cells I have a Button control.When the button press I will trigger a SelectDialog with StandardListItem. When the user selects an item from the StandardListItem, I need to set that selected item name to the button text.

The table part in view,

<Table id="idProductsTable" inset="false" items="{ path: 'smp>/ProductCollection' }"> <columns> <Column><Label text="" /></Column> <Column><Label text="" /></Column> <Column><Label text="" /></Column> <Column><Label text="" /></Column> <Column><Label text="" /></Column> <Column><Label text="" /></Column> <Column><Label text="" /></Column> </columns> <items> <ColumnListItem> <cells> <ObjectIdentifier title="{smp>Name}" text="{smp>Name}" /> <ObjectIdentifier title="{smp>SupplierName}" text="{smp>SupplierName}" /> <Link text="Active" visible="{smp>assigned}"/> <core:Icon src="sap-icon://notification" press="notificationPress"></core:Icon> <ObjectIdentifier title="{smp>date}" /> <Button id="productInput" text="UnAssigned" icon="sap-icon://down" press="fnPress" class="absolute" /> </cells> </ColumnListItem> </items> </Table>


The item select event,

handleClose: function (oEvent) {

var oSelectedItem = oEvent.getParameter("selectedItem");

if (oSelectedItem) {

// set button text

}

}

The dialog fragment,

<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core"> <SelectDialog noDataText="No Products Found" title="Select Product" search="handleSearch" confirm="handleClose" cancel="handleClose" items="{ path: 'qm>/Userid' }" > <StandardListItem title="{qm>PlantID}" description="{qm>PlantName}" iconInset="false" press="nameSelect" /> </SelectDialog> </core:FragmentDefinition>

Attachments

dialog.png (23.1 kB)
table.png (17.6 kB)