Hi Robert,
I tried to set the rowCount and colCount following your script, but I
was getting the below error.
"The prefix 'gs' for element 'gs:rowCount' is not bound."
But then when I tried setting it by "xmlns$gs" instead of "xmlns$gsx",
I was getting a different error message.
"The posted entry is missing one or more of the required field(s):
title".

How do I set the additional namespace to my google.gdata.Entry object?
I have given the complete script below.

Please help.

Bala

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml";>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/
>
    <title>My Google Data API Application</title>
    <script src="http://www.google.com/jsapi"; type="text/javascript"></
script>
    <script type="text/javascript">

    google.load('gdata', '1.x');
    var service;
    var spreadsheethtml = [];
    var worksheethtml = [];
    var worksheetLink;
    function initialize() {
      var scope = 'http://spreadsheets.google.com/feeds/';
      if (google.accounts.user.checkLogin(scope)) {
        service = new google.gdata.client.GoogleService('wise',
'AddWorkSheet-App-v1.0');
        service.getFeed(scope + 'spreadsheets/private/full/',
handleFeed, handleError);
      } else {
        var token = google.accounts.user.login(scope); // can ignore
returned token
      }
    };

    var handleFeed = function(response) {
      var entries = response.feed.entry;
      if (!entries.length) {
        alert('You have no entries!');
        return;
      }
        handleWorksheet(entries[0]);
    };

    var handleWorksheet = function(entry){
        var worksheets = entry.link;
        worksheetLink = worksheets[0].href;
        createWorksheetXML();
    };
    var handleError = function(e) {
      alert('Error: ' + e.cause ? e.cause.statusText : e.message);
    };
    function createWorksheetXML(){
               var feedURI = worksheetLink;
               var entry = new google.gdata.Entry();
               var link = new google.gdata.Link.create("http://
schemas.google.com/g/2005#post","application/atom+xml",feedURI);
               entry.setTitle("Expense");
               entry.addLink(link);
               entry['gs$rowCount'] = {xmlns$gs:"http://schemas.google.com/
spreadsheets/2006",$t:50};
               entry['gs$colCount'] = {xmlns$gs:"http://schemas.google.com/
spreadsheets/2006",$t:10};
               service.insertEntry(feedURI,entry,handleWSAdd,
handleError,google.gdata.Entry);
    }
    var handleWSAdd = function(responseWSAdd){
        var entry = response;
    };
    function logMeOut() {
      google.accounts.user.logout();
      document.getElementById('data').innerHTML = "User Successfully
Logged Out";
    }
    </script>
  </head>
  <body>
    <button type="button" onclick = "initialize()" >Login</button>
    <button type="button" onclick = "logMeOut()" >Logout</button>
    <img src = "test.jpg" style="position: absolute; top:-1000px"/>
  </body>
</html>

On May 5, 4:24 pm, rkluin <robert.kl...@gmail.com> wrote:
> Hi Kumar, I am curious if you have found a "proper" solution?
>
> To create the additional properties I have been using code similar to
> the following:
> ws_entry["gs$rowCount"] = {xmlns$gsx:"http://schemas.google.com/
> spreadsheets/2006/extended",
>                                              $t:50};
> ws_entry["gs$colCount"] = {xmlns$gsx:"http://schemas.google.com/
> spreadsheets/2006/extended",
>                                             $t:10};
>
> This seems to produce the correct XML.
>
> Robert
>
> On Mar 27, 3:09 pm, Kumar <kumaravel.kandas...@gmail.com> wrote:
>
> > Hi,
>
> > I am trying to sendextendedattributesto the Entry object - for
> > creating a new worksheet. Any suggestions ? Unable to procced how to
> > send 'rowCount' and 'colCount'attributesbeing that currently js
> > library does not support spreadsheets.
>
> > Spreadsheet Protocol Spec:
>
> > <entry>
> >  <title>Expenses</title>
> >  <gs:rowCount>50</gs:rowCount>
> >  <gs:colCount>10</gs:colCount>
> > </entry>
>
> > Code :
>
> >           var ws_entry = new google.gdata.Entry();
> >            ws_entry.setTitle(google.gdata.Text.create('Goals'));
>
> >            // create an extend property with name=mydata and
> > value=xyz
> >            //var extendedProp = new google.gdata.ExtendedProperty();
>
> >            // Set the name of the property
> >            ///extendedProp.setName('rowCount');
>
> >            // Set the value of the property
> >            //extendedProp.setValue('120');
>
> >            // Add the property to the event
> >            ws_entry['rowCount'] = 120;
>
> >            service.insertEntry(feedUri, ws_entry, handleWSFeed,
> > handleError, google.gdata.Entry );
>
> > service Object is of Type:
>
> > new google.gdata.client.GoogleService('wise', 'xyz');
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Docs Data APIs" group.
To post to this group, send email to Google-Docs-Data-APIs@googlegroups.com
To unsubscribe from this group, send email to 
google-docs-data-apis+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Docs-Data-APIs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to