cancel
Showing results for 
Search instead for 
Did you mean: 

Change icon based on certain condition

Former Member
0 Kudos

Hi Experts,

I am enhancing a webdynpro component where i need to add 1 column in a table UI the column should be a button with text

"Attachment (var)" where var shows how many files have been attached at that line item.

Initially it should display as "Attachment(0)"

When i click on this button i am opening a pop up to attach files. When user attach 1 file or 2 files how can i change the text

on the button as 'Attachment (2) i.e the no. of files the user has attached.

Pop up is a separate component which is addded in the main component.

Please advice on how to go about it?

Thanks

Bhanu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Bhanu, this should be easy...

just map a context char type attribute to the button 'TEXT' property and change this context attribute when you upload the attachments.. the Button text will automatically change

Answers (2)

Answers (2)

Former Member
0 Kudos

HI Bhanu,

To change the button text you can take a attribute of type char in your component and bind it to TEXT

property of the button and change it depending on the attachments made.

As you told hat the popup is a separate component, first you need the count of how many files have been

attached. For this if you external componenet is Z-component then you can use an interface node

in external component to get the count and map this node in your component and can get the count.

Former Member
0 Kudos

Hi Malik

First you need to use the LinkToAction. One of its properties is an image.

To change the image as per your requirement , you may store an array of per-fabricated images in your Mimes

folder and just use them at will at runtime.

You can also try to manipulate the image at runtime , but I do not know how this is done in Abap.

Please refer to my blog [How to change an image at runtime in Webdynpro java|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/27326] [original link is broken] [original link is broken];

Hope I have helped you out here.

regards

Yuval Peery