cancel
Showing results for 
Search instead for 
Did you mean: 

Validate dynamic context

Former Member
0 Kudos

Dear to all.

I'm trying to validate values of dynamic context.

The created context is this:

IWDNodeInfo nLicitador = nDadesVal.addChild("Licitador_" + i, null, true, true, true, false, false, true, null, null, null);

nLicitador.addAttribute("Criteri_" + j, "ddic:com.sap.dictionary.decimal");

And the information to the user this (creating the message previously in the message pool):

IWDMessageManager msgMgr = this.wdThis.wdGetAPI().getComponent().getMessageManager();

IWDAttributeInfo attributeInfo = this.wdContext.nodeDadesValoracio().getChildNode("Licitador_0", IWDNode.LEAD_SELECTION).getNodeInfo().getAttribute("Total_0");

msgMgr.reportContextAttributeMessage(this.wdContext.currentContextElement(),attributeInfo, IMessageValoracioOfertes.VALOR_INCORRECTE, new Object[] {"TestMessage"},true);

The result is ths stack trace

java.lang.IllegalArgumentException: No such attribute Total_0

at com.sap.tc.webdynpro.progmodel.context.AttributePointer.<init>(AttributePointer.java:47)

at com.sap.tc.webdynpro.progmodel.controller.MessageManager.reportContextAttributeMessage(MessageManager.java:941)

at com.gisa.vo.GraellaValoracioOfertes.onActiontstBean(GraellaValoracioOfertes.java:848)

I have tried this with a simple context attribute and it works correctly.

Any ideas??

Accepted Solutions (0)

Answers (1)

Answers (1)

abhijeet_mukkawar
Active Contributor
0 Kudos

seems it is not getting Total_0 attribute,

make sure that you added Total_0 attribute to the node Licitador_0.

From code it seem , the added attribute is Criteri_<j>.

hope it helps

regards,

Former Member
0 Kudos

Yes, the attribute Total_0 and Criteri_+j are in the context and works correctly.