incubator-photark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Subash Chaturanga <subash...@gmail.com>
Subject Re: Problem in using org.apache.tuscany.sca.data.collection.Entry in my service callback method.
Date Fri, 12 Aug 2011 17:38:24 GMT
Got it :-)

Those key value pairs can be easily accessible by entries[i].key and
entries[i].data.

On Fri, Aug 12, 2011 at 9:35 PM, Subash Chaturanga <subashsdm@gmail.com>wrote:

>
>
> On Tue, Jul 26, 2011 at 9:27 AM, Luciano Resende <luckbr1975@gmail.com>wrote:
>
>> On Mon, Jul 25, 2011 at 10:49 AM, Subash Chaturanga <subashsdm@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
>
>
>


-- 
Subash Chaturanga
Department of Computer Science & Engineering
University of Moratuwa
Sri Lanka

Blog -  http://subashsdm.blogspot.com/
Twitter - http://twitter.com/subash89

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message