HTH,

String

On Jun 24, 11:37 am, Nishtha <[email protected]> wrote:

> I am using showTeachers as a user pref parameter in the gadget. and
> passing it to content type url as:
>
> <UserPref name="showTeachers" display_name="Show Teacher"
> required="true" datatype="bool"/>
> <Content type="url" href="http://test-aatetsting.appspot.com?
> param=__UP_showTeachers__">
>
> http://test-aatetsting.appspot.com: This is the python application i
> am using.  Here i try to fetch the parameter as the following from the
> request:
>
> showTeachers = str(self.request.get('showTeachers'))

The parameters are passed to the target URL prefixed by "up_", as
documented at 
http://code.google.com/apis/gadgets/docs/legacy/reference.html#RequestParams_Ref.

So in your example, you should be using gadget XML like this:
<UserPref name="showTeachers" display_name="Show Teacher"
required="true" datatype="bool"/>
<Content type="url" href="http://test-aatetsting.appspot.com";>

and getting a remote URL (at the server end) like:
http://test-aatetsting.appspot.com?up_showTeachers=true

I don't know Python, but guessing at its syntax, I'd think you'd want
something like:
showTeachers = str(self.request.get('up_showTeachers'))

> Another thing I read is urlparam attribute to be used for content type
> url
>
> http://code.google.com/apis/gadgets/docs/legacy/reference.html#Userpr...
>
> urlparam = Optional string to pass as the parameter name for content
> type="url".
>
> Is this to be used? if so then how?

I've not used urlparam myself, but I think it's optional. If you do
use it, the API will pass that as the url parameter name instead of
up_<name>. So for instance, if you defined your gadget XML like this:#
<UserPref name="showTeachers" display_name="Show Teacher"
required="true" datatype="bool" urlparam="show_teachers"/>
<Content type="url" href="http://test-aatetsting.appspot.com";>

your remote URL would then look like:
http://test-aatetsting.appspot.com?show_teachers=true

But again, that's just how it looks to me reading the docs, I haven't
used url parameters like this.

String
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"iGoogle Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Gadgets-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to