cancel
Showing results for 
Search instead for 
Did you mean: 

getting context exception

Former Member
0 Kudos

HI,

I am getting context exception like as

com.sap.tc.webdynpro.progmodel.context.ContextException: Path 'null' does not point to an attribute, but to View(path=AccountComp/AccountHistory, class=com.sap.tc.webdynpro.progmodel.generation.DelegatingView)

i created context as

Node --> category

Attribute --> Category.description

Node -->Source

Node--> points

Attribute --> Source.Points.sdate

Attribute -->Source.points.Edate

Attribute --> Source.points.label

and to set the values for the attribute in a loop i created the nodes added the element to it like as

IPublicAccountComp.ICategoryNode dnode = wdContext.nodeCategory();

for (int i = 0; i < CategoryValues.length; i++)

{

IPublicAccountComp.ICategoryElement cat1 = dnode.createCategoryElement();

cat1.setDescription(CategoryValues<i>);

wdContext.nodeCategory().addElement(cat1);

}

for (int i = 0; i < CatLabels.length; i++)

{ IPublicAccountComp.ISourceNode snode = wdContext.nodeSource();

IPublicAccountComp.ISourceElement src= snode.createSourceElement();

IPublicAccountComp.IPointsNode oupt1 = snode.nodePoints();

IPublicAccountComp.IPointsElement pEle = oupt1.createPointsElement();

pEle.setCuID(CatLabels<i>);

pEle.setStartValue(startDate<i>);

pEle.setEndValue(endDate<i>);

oupt1.addElement(pEle);

wdContext.nodeSource().addElement(src);

}

}

i dont know where i went wrong would you please help me in this

Thanks

Anu

Accepted Solutions (1)

Accepted Solutions (1)

Qualiture
Active Contributor
0 Kudos

You are creating element Source and then creating child element Points before adding the parent element Source first

You need to create and then add the element before you can add a child node to it

Hope this explains,

Robin

Answers (1)

Answers (1)

Former Member
0 Kudos

solved