3 messages in com.googlegroups.google-mashup-editorfeed.size() does not work properly
FromSent OnAttachments
Mirage24 Jun 2007 11:09 
Jason25 Jun 2007 10:30 
Mirage25 Jun 2007 17:24 
Subject:feed.size() does not work properly
From:Mirage (mira@googlemail.com)
Date:06/24/2007 11:09:59 AM
List:com.googlegroups.google-mashup-editor

Hi all,

It seems, that feed.size() doen't work properly. In the first call it delivers alway 0, In the seconc call the real value. This is a strange behaviour, isnt it.

attached you will find sample coding

=> bug!

keep the spirit of GME alive... Jan

<gm:page title="My App" authenticate="true" onload="onLoad()> <gm:data id="pd" data="${user}/huhu"/> <gm:list id="personalData" data="${pd}" template="Detailbild" pagesize = "99"/> <gm:template id="Detailbild"> <table> <tr repeat="true"> <td> Zeitraum von:&nbsp; </td> <td> <gm:date ref="gd:from"/> </td> <td> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bis:&nbsp; </td> <td> <gm:date ref="gd:to"/> </td> <td> <gm:number ref="gd:counter"/> </td> <td><gm:editButtons editonly="false"/></td> </tr> </table> </gm:template>

<script> function onLoad(){ var fromGPath = new GPath("gd:from"); var toGPath = new GPath("gd:to"); //Get the Feed var myData = google.mashups.getObjectById( 'personalData' ); feed = myData.getData(); // fist alert returns always 0... alert(feed.size()); // second alert returns the real size... alert(feed.size()); if(feed.size()< 2) { //Create a new entry var entry = feed.createEntry(); //Set the values fromGPath.setValue(entry,'2001-12-12'); toGPath.setValue(entry,'2004-01-01'); //Add the entry to the feed feed.addEntry(entry); } } </script>

</gm:page>