Skip to Content
0

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

Jun 02, 2017 at 08:00 AM

166

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Mahesh kumar palavalli Jun 02, 2017 at 07:21 PM
1

You can use expression binding like below:

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

<Button visible="{= ${model>field} === 0 ? true : false }" />
Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

0
avatar image
Former Member Jun 02, 2017 at 01:16 PM
0

Add button to the column. Have another field in the model to set visibility flag and bind this flag to the button. Conditionally change this field based on the conditions mentioned above.

Share
10 |10000 characters needed characters left characters exceeded