cancel
Showing results for 
Search instead for 
Did you mean: 

Add text to webdynpro table dynamically

Former Member
0 Kudos

Hi All,

I'm a newbie to webdynpro development, I face an issue when trying to add text dynamically to the table. The scenario is as follows:

There is a field (Lead) in a table which is bound to a model, I'm supposed to display 'yes' if the back-end is sending me 'X' and 'No' when it's blank.

I've tried directly setting the value using wdContext.currentXXX_Element().setlead("No"), here the problem is as the back-end field is only one character long it's displaying 'N' or 'Y' in the table.

Could some one please help me out?

Thanks in advance,

Chaitanya

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Define a <b>calculated </b>context attribute of type "string" in the view controller context as a child of the table's data source node. if you cannot add an attribute directly in the node (because it is a model node), add a value node with cardinality 1:1 and add the attribute there in.

In the generated getter-method, ask for the value of the "lead" attribute and return "Yes"/"No" according to this value.

Armin

Former Member
0 Kudos

Hi Armin,

Thank you for the prompt response, I've done it and it's working fine now!

Thanks again,

Chaitanya

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Chaitanya,

You can use the calculated attribute or supply function to achieve your requirement. I have explained how to use the supply function to meet your requirement.

1. Create a value node "vnStatus" with cardinality 1:1 and "singleton=false" under the RFC output table.

2. Create a value attribute "vaStatus" under the value node "vnStatus" and set the "type" as "String".

3. Click on the value node and create a supplyfunction.

4. Goto the implementation tab and write the following code.

IPrivateCO_ComponentName.IVnStatusElement statusElement = node.createVnStatusElement();

node.bind(statusElement);

if(parentElement.getRFCStatus() == 'X')

statusElement.setVaStatus("Yes");

else

statusElement.setVaStatus("No");

5. In the Table UI element change the binding of the status field. Select the newly created a value attribute.

This will solve your problem.

If you still need any clarification do let me know.

Regards,

Santhosh.C