cancel
Showing results for 
Search instead for 
Did you mean: 

how make the button and text visible and invisible dynamically in sap.m.table column?

RaviKant_Ranjan
Participant
0 Kudos
9,606

My requirement:

i have used sap.m.table and column fields are installment 1, installment 2. Now at the time of page first it will check in database table that whether the installments columns are 0 or not. If its 0 then i need to show the the buttons "Pay Now" in my column of sap.m.table and if the database column is not 0 (i.e. installment is paid) then instead of button it should show the value (i.e. amount paid) from the database column. I am using sap web IDE

Please help me.

View Entire Topic
maheshpalavalli
Active Contributor

You can use expression binding like below:

https://sapui5.hana.ondemand.com/#docs/guide/daf6852a04b44d118963968a1239d2c0.html

<Button visible="{= ${model>field} === 0 ? true : false }" />
RaviKant_Ranjan
Participant
0 Kudos

my code is in xml view is:

<HBox>

<Link text="PAY NOW" enabled="{= ${course>stud_payment_instal_1} === 0}" emphasized="true" id="lnk" visible="{= ${course>stud_payment_instal_1} === 0 ? true : false }"></Link>

<Link text="{course>stud_payment_instal_1}" enabled="{= ${course>stud_payment_instal_1} !== 0}" emphasized="true" id="lnk1" visible="{= ${course>stud_payment_instal_1} !== 0 ? true : false }"></Link>

</HBox>

this is the output what i am getting after using expression binding in table cell:

in first column the output should be pay now with enabled link because installment paid is zero but what i am getting is zero with enabled link

in second column the output should be value of installment field with disabled link because installment paid it is not zero but what i am getting is value of installment field with enabled link

the values in all the column is set according to condition satisfied in the last row of the table