cancel
Showing results for 
Search instead for 
Did you mean: 

sapui5 Radio button two way binding

Dear Experts,

below is data from my entity called PassportVisaBankCitizenshipDetails

I want to update the last highlighted 4 properties values without updating the other values. below is my code on pressing save button on my xmlview.

however I am getting an xml parsing error , can some expert please check the code and advise if I am doing correctly. The 4 properties were binded on the xmlview using expression binding as shown below.

<m:RadioButtonGroup id="rbgTermType" editable="false"> 
<m:RadioButton text="YES" selected ="{= ${/Term_Type}==='X'}" />
<m:RadioButton text="No" selected = "{=${/Term_Type}===''}" /> <br></m:RadioButtonGroup>

Accepted Solutions (1)

Accepted Solutions (1)

former_member322772
Active Participant
0 Kudos

Have you tried checking the network payload in your console to see what value is getting passed? Is it passing "X" or "", as required?

It looks to me like you are using the method getText() on the radio button and you are passing that value. But this will return "Yes" or "No" based on your snippet. This won't work because your OData property is expecting "X" or "" (empty string) and probably has a max length of 1. I'd also recommend switching that property to boolean as it will make data binding easier.

Answers (1)

Answers (1)

Fabrice
Active Participant
0 Kudos

Hi,

i think the problem could come from the <br> balise in your following code :

<m:RadioButtonGroup id="rbgTermType" editable="false"> 
<m:RadioButton text="YES" selected ="{= ${/Term_Type}==='X'}" />
<m:RadioButton text="No" selected = "{=${/Term_Type}===''}" /> <br></m:RadioButtonGroup>

try to remove it.

Regards,

Fabrice

0 Kudos

<br> is added by the editor Fabrice.

the original lines are

<m:RadioButtonGroup id="rbgTermType" editable="false"> 
<m:RadioButtontext="YES" selected ="{= ${/Term_Type}==='X'}" />
<m:RadioButtontext="No" selected = "{=${/Term_Type}===''}" />
</m:RadioButtonGroup>