On Tue, Jul 26, 2011 at 9:27 AM, Luciano Resende <luckbr1...@gmail.com>wrote:
> On Mon, Jul 25, 2011 at 10:49 AM, Subash Chaturanga <subash...@gmail.com> > wrote: > > Hi all, > > I am using the org.apache.tuscany.sca.data.collection.Entry as the return > > type of one my service methods. I am having problems in using them in the > > callback method > > The return type of the calling method is Entry<String, String>[] . > > > > So here is my callback method. > > > > function facebook_ff_callback(items, exception) { > > if(exception) { > > alert("Err"); > > } else { > > alert(items[0].getData()); > > } > > } > > > > And I am getting no response. Is this the correct way to iterate > > through Entry<String, String>[] ? > > > > Here are some examples on how to iterate trough a Tuscany collection in JS > > > https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/applications/store/src/main/resources/uiservices/store.html Hi Luciano, I looked in to this example code. This is what i captured. What I am returning is a Entry<String,String> which has key value pairs. I am not getting what is "entries[i].getElementsByTagName("content")[0]" and "..... .firstChild.nodeValue" ??? var entries = feed.getElementsByTagName("entry"); var list = ""; for (var i=0; i<entries.length; i++) { var content = entries[i].getElementsByTagName("content")[0]; var name = content.getElementsByTagName("name")[0].firstChild.nodeValue; var price = content.getElementsByTagName("price")[0].firstChild.nodeValue; list += name + ' - ' + price + ' <br>'; } > > > > > -- > Luciano Resende > http://people.apache.org/~lresende > http://twitter.com/lresende1975 > http://lresende.blogspot.com/ > Thanks -- Subash Chaturanga Department of Computer Science & Engineering University of Moratuwa Sri Lanka Blog - http://subashsdm.blogspot.com/ Twitter - http://twitter.com/subash89