Skip to Content
0
Former Member
Sep 06, 2006 at 10:18 AM

Must not modify the datatype of a mapped attribute

62 Views

Hi,

I have a value attribute in a component controller context, mapped to a view Context attribute, and then bind it to a DropDownByKey.

<b>When putting the values (key, value) to the view context, using the following code:</b>

<i>IWDAttributeInfo attrInfo = wdContext.getNodeInfo().getAttribute(IPublicSearch.IContextElement.STATE);

ISimpleTypeModifiable type = attrInfo.getModifiableSimpleType();

IModifiableSimpleValueSet valueSet = type.getSVServices().getModifiableSimpleValueSet();</i>

<b>I’m getting the Report Exception:</b>

<i>com.sap.tc.webdynpro.progmodel.context.ContextException: MappedAttributeInfo(ListaMensagensInterface.Estado): must not modify the datatype of a mapped attribute</i>

The i found the following solution in the SDN:

“…1. You have some context attribute in custom/component controller.

2. You map this attribute to attribute in view controller.

3. You are trying to modify simple type of attribute in view controller.

Step 3 is wrong -- move your code that modifies simple type of attribute to custom/component controller, where attribute was defined. Mapped attribute in view controller will get modified type automatically. …”

The problem is that the attribute of Component Controller is mapped to an attribute of Interface Controller of a Used Web Dynpro Component. This means that all contexts are mapped.

Component1 Controller Attribute X mapped to Component1 View Controller Attribute X

Component1 Controller Attribute X mapped to Component2 Interface Controller Attribute X

Component2 Interface Controller Attribute X mapped to Component2 Controller Attribute X

Component2 Controller Attribute X mapped to Component2 View Controller Attribute X

How to solved it?

Is the only solution, create two attributes? One to bind to UI and other to pass the information from Component1 to Component2?

Thanks and regards,

John