on 2005 Jul 28 7:21 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
68 | |
9 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.