cancel
Showing results for 
Search instead for 
Did you mean: 

Convert automatically Node results to a Java List ?

diegohs
Active Participant
0 Kudos

Hi Everyone,

I have a Node with a lot of records inside, somebody knows if there is an easy way to transform that result into a Java List ?

Right now, I'm reading the entire node result, and adding each element. But, It doesn't sound to be a good practice..

Somebody have a clue about this ?

Thanks guys, regards from MX 😃

Diego

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Diego,

in case the iterator as Armin stated isn't sufficient (in most cases it should) there's another possibility.

Imaginge you have a model node. There you're able to directly bind a collection of type ICMIObservableList containing model objects. To use this you have to write an own implementation of it, we're doing this by wrapping an ArrayList. The ICMIObservableList is directly bound without iterating the content. So you can hold this list in your controller and always have direct access to the context content over this Collection too. For more information please see the JavaDoc for ICMIObservableList.

Best regards,

Christian

diegohs
Active Participant
0 Kudos

Ey.. thanks guys.

I'll try it and I'll let you know the results.

Thanks !

Former Member
0 Kudos

Why do you need a list of node elements? Would an iterator also be sufficient?

Armin