on 08-02-2017 5:38 PM
Hello,
i have an sap.m.table wiht
C1 C2 C3 C4 c5
Text text Radiobuttongroup Text
..
..
Text text Radiobuttongroup Text.
When a radiobutton is selected the onSelect Event is triggerd.
Is there an easy way to get the Index of the line in the table where the button was selected?
At this moment i use oEvent.getId() and split it so that i get the index number from there.
Is there an easier way to accomplish that?
Regards
Dirk
there are many ways. One way is to use binding path
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried that. My View code is as follows.
items="{Target_Group_Model>/}" >
<columns>
<Column> <header> <Text text= "Customer" /></header> </Column>
<Column> <header> <Text text= "Contact Person" /> </header> </Column>
<Column> <header> <Text text= "Yes No" /> </header> </Column>
<Column> <header> <Text text= "Reason" /> </header> </Column>
</columns> <ColumnListItem>
<Text text="{Target_Group_Model>CompanyName}" /> <Text text="{Target_Group_Model>NameLast}" />
<RadioButtonGroup id="DeleteGroupFlag" columns="2">
<buttons>
<RadioButton id="DeleteYes" select="onReceiverTypeSelect"
selected="{path:'Target_Group_Model>Yes', formatter:'.Formatter.getBoolean'}">
<customData> <core:CustomData key="Delete" value="Y"/> </customData>
</RadioButton> <RadioButton id="DeleteNo" select="onReceiverTypeSelect"
selected="{path:'Target_Group_Model>No', formatter:'.Formatter.getBoolean'}">
<customData> <core:CustomData key="Delete" value="N"/> </customData>
</RadioButton> </buttons> </RadioButtonGroup>
</ColumnListItem> </Table> </content>
Your solution doesn't work on this code . When i call bindingcontext in the event i get undefined.
Any advice?
Regards
Dirk
why you want to know?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check with the mProperties method of the onSelect event of the radio button group. If you can get the selected item, that should give you the index of the row.
Regards,
Sharath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.