Hi Experts
I have a situation here i'trying to resolve. Any help would be appreciated.
I have 2 components A and B. Let say component A uses its view A and component B uses its view B.
View A of component A uses a dropdown key. The values in dropdown get populated from a RFC call in component A.
View B of component B also a dropdownkey. The values in dropdown get populated from the same RFC call as in A.
As you can seen, values in dropdown get populated and duplicated at 2 places in component A and B, hence 2 calls to RFC.
I tried to create another component C which will call the same RFC just once and populate the dropdown values in order to return to component A or B through extenal context mapping.
To achieve this, I declare a value attribute vaColor (type string) in the interface controller context of component C and uses the following code in do_init of component C. Please note the value attribute vaColor has Input Element property = true and it will be mapped to exactly the same value attribute declared in component A and B.
<b>Unfortunately this does not work. The problem is WD does not permit to modify a data type of a value attribute used in external context mapping. How do you experts resolve this ?</b><b> Please remember that my objective is to have 1 single RFC call in a child component to populate the dropdown list and this dropdown list will be transferred back for use by different parent components.</b>
ISimpleTypeModifiable myType = wdThis.wdGetAPI().getContext).getModifiableTypeOf("vaColor");
IModifiableSimpleValueSet valColor = myType.getSVServices().getModifiableSimpleValueSet();
.........
.........
.........
.........
calling RFC
..........
.........
...........
for (int i = 0; i < wdContext.node<>.size(); i++) {
valColor.put(wdContext.node<>.getXXElementAt(i).getKey(),
wdContext.node<>.getXXElementAt(i).getText());
}
Thanks a lot in advance guys