cancel
Showing results for 
Search instead for 
Did you mean: 

Reuse of a dynamic created NodeElement

Former Member
0 Kudos

Hi,

how is it possible to reuse a dynamic created attribute in a context? In my Application the user has the option to sort the attributes. But after sorting the attributes I can't use the same method to show the sorted documents (linktoAction) in my view, because of the name. I get the message: <b> duplicate name for attribute FileResource0 </b>.


          for (int i = 0.....){
                ......
		IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().
			addAttribute("FileResource"+i,"com.sap.dictionary.binary");
                fileDownload.bindData(wdContext.getNodeInfo().getAttribute("FileResource"+i));
                ......
           }

regards,

sharam

Accepted Solutions (1)

Accepted Solutions (1)

roberto_tagliento
Active Contributor
0 Kudos

wdcontext.invalidate();

do it before create.

Former Member
0 Kudos

Hi Roberto,

Thank you, for your suggestion. It works with a "similar" piece of Code:

wdContext.getContext().reset(true);

regards,

Sharam

Former Member
0 Kudos

<i>t works with a <u>"similar"</u> piece of Code</i>

LOL!

wdContext.invalidate() removes data from node

wdContext.getContext().reset(true) removes all dynamically created metadata

VS

Answers (2)

Answers (2)

Former Member
0 Kudos

Try the following.

if(wdContext.getNodeInfo().getAttribute("FileResource"+i)!=null)

{

IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().

addAttribute("FileResource"+i,"com.sap.dictionary.binary");

fileDownload.bindData(wdContext.getNodeInfo().getAttribute("FileResource"+i));

......

}

}

Regards,Anilkumar

Former Member
0 Kudos

Hi SHaram,

Where are you writing that piece of code ??

Regards, Anilkumar

Former Member
0 Kudos

Hi Anilkumar,

I write it in "wdDoModifyView(...)" under "if (firstTime)" and I call the same piece of code from another function. I had to do that because the user has the option to sort and update the view several times. So if the user re-sort the values on the view I get a problem with the name of it.

regards,

sharam