I gave that a shot and the entire div doesn't get rendered. I am not getting any javascript errors, but the jscontent attribute of the tag seems to be incorrect. It appears that the template compiler is not recognizing the embedded references correctly. It is close, and it looks like it might just be a parsing issue. I will look into this a little closer.
-----Original Message----- From: Lane LiaBraaten [mailto:lliab...@google.com] Sent: Wednesday, May 06, 2009 4:21 PM To: shindig-dev@incubator.apache.org Subject: Re: How to output App Data within an Opensocial Template using client side processing You should be able to do it like this: <div>Owner data key=key1 value=${ownerdata[owner.id].key1}</div> -Lane On Wed, May 6, 2009 at 12:45 PM, Terlecki, Stephen < stephen.terle...@lmco.com> wrote: > I have a template that I am now using client side processing (thanks > Lev) to output. I am making opensocial data requests to retrieve data > and then render into the template. When I try to process App Data, > however, there is no way to represent data for a single person using > opensocial templates. > > > > Here is an example of what I am doing: > > > > <script type="text/os-template" name="basictemplate" > xmlns:os=http://ns.opensocial.org/2008/markup> > > <div>Owner id is ${ownerinfo.displayName}</div> > > <div>Owner data key=key1 > value=${ownerdata.2.key1}</div> > > </script> > > > > <div id="renderhere"></div> > > > > <script type="text/javascript"> > > function getData() > > { > > var req = opensocial.newDataRequest(); > > > req.add(req.newFetchPersonRequest(opensocial.IdSpec.PersonId.OWNER), > 'ownerinfo'); > > > req.add(req.newFetchPersonAppDataRequest(opensocial.newIdSpec({userId : > 'OWNER'}), 'key1'), 'ownerdata'); > > req.send(render); > > } > > > > function render(data) > > { > > var basicTemplate = > opensocial.template.getTemplate('basictemplate'); > > > basicTemplate.renderInto(document.getElementById("renderhere"), data); > > gadgets.window.adjustHeight(); > > } > > > > gadgets.util.registerOnLoadHandler(getData); > > </script> > > > > The request returns a JSON dataset that looks like this: > > > > [{"id":"ownerinfo","data":{"id":"1","name":{"formatted":"Steve > Here"},"displayName":"Steve" > > }},{"id":"ownerdata","data":{"1":{"key3":"value3","key4":"value4","key1" > :"value1","key2":"value2" > > }}}] > > > > Owner info displays fine in the opensocial template, but notice the > App Data for the owner it has the person id in the middle, so within > the opensocial template I have to refer to it this way ${ownerdata.2.key1}. > Does anyone know another way of doing this, obviously the "2" in the > middle is no good. Am I requesting the data wrong? > > > > Any help would be appreciated. > > > > Steve T. > >