Skip to Content

Dynamic data binding with sap.ui.commons.MenuItem and sap.ui.commons.Menu

Hi,

I am creating UI5 app and trying to load menu with submenu. I have explored about sap.ui.commons.MenuItem and sap.ui.commons.Menu controls but i couldn't bind my odata items to this menu item control.

can anyone help me to find the correct way for binding and please suggest me if there is any samples,

Thank you,

Ranjani Sekar

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 05, 2017 at 04:19 AM

    Hi Ranjani Sekar,

    It is better not to use any sap.ui.commons control in you application, as most of them are deprecated. You can bind your OData to your menu by trying out the foll code :

    	<u:Menu
    			itemSelect="handleMenuItemPress"
                            items="/Your_Entity_Set_name">
                <u:items>
    			<u:MenuItem
    				text="{your_field_name}"
    				icon="{your_field_name}"/>
                </u:items>
            </u:Menu>

    Hope this helps,

    Regards.

    Add comment
    10|10000 characters needed characters exceeded