cancel
Showing results for 
Search instead for 
Did you mean: 

Context node convert ArrayList

victorpale
Participant
0 Kudos

Hi Java Web Dynpro gurus

If I'm wrong please correct me. I know the all context nodes are collections.

I want to convert a value attribute on ArrayList. With the aim of use the method "contains" instead of walking with cycling registers (for cycle).

Is it posible?

Best Regards,

Victor Carmona

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

That is not possible victor....

There is no standard function to convert Context to Arraylist but it can be done by iterating the node using the following code.

"Messages" is the context name in below case.

IWDNode node = wdContext.currentMessagesElement().node();

List<String> allMsgIds = new ArrayList<String>();

IMessagesElement element=  wdContext.currentMessagesElement();

for(int i=0;i<node.size();i++){

element = (IMessagesElement) node.getElementAt(i);

allMsgIds.add(element.getMessageID());

}

and then you can use "Contain" function.

Sharathmg
Active Contributor
0 Kudos

Agreed. Context to an array, not supported by the context api.

You have to manually loop to find the value.

Best Regards,

Sharath

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

didn't get u....