cancel
Showing results for 
Search instead for 
Did you mean: 

passing value from the model in UI element

former_member477160
Discoverer
0 Kudos

Hi Experts

I need to pass value from the model to the press event of the Link ui element.

I tried this but it didnt work

<Link press="onOpenAttachmentDlg({requestModel>vendorId})" >

Could you please let me know how i can pass the value from the model in view so that i can get it in the controller.

Thanks

Karthi D

Accepted Solutions (0)

Answers (2)

Answers (2)

irfan_gokak
Contributor
0 Kudos

Hi,

You need to get current rows binding object. You can do it as below.

<Link press="onOpenAttachmentDlg" >

// In controller 
onOpenAttachmentDlg:function(oEvent){
  var oData = oEvent.getSource().getBindingContext(“<modelname>”).getObject();

// In oData object you’ll get VendorId from current row. Check in debugger 
}

If this helps you please mark as answered.

former_member477160
Discoverer
0 Kudos

Hi Experts

This ui element is in a table column

So i cannot use id for this element to get the value using sap.ui.getCore().byId("id").

Thanks

Karthi D