You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Henry Saputra <he...@gmail.com> on 2011/12/15 07:54:13 UTC

What is the purpose of osapi.container.ViewParam compare to osapi.container.RenderParam?

Hi All,

For common container, what is the purpose of osapi.container.ViewParam
if the only value it can have is "view" which can be covered by
osapi.container.RenderParam "view" param?

I see its only used in
osapi.container.Container.prototype.navigateGadget to determine view
to used which just backup if "view" is not set in renderParams

- Henry

Re: What is the purpose of osapi.container.ViewParam compare to osapi.container.RenderParam?

Posted by Ryan J Baxter <rj...@us.ibm.com>.
Ah I see, should probably clean that up then.

-Ryan

Email: rjbaxter@us.ibm.com
Phone: 978-899-3041
developerWorks Profile



From:   Henry Saputra <he...@gmail.com>
To:     dev@shindig.apache.org, 
Date:   12/15/2011 03:22 PM
Subject:        Re: What is the purpose of osapi.container.ViewParam 
compare to osapi.container.RenderParam?



Implementation wise yes, its just a JSON object, but the comments in
the code like this:

 * @param {Object} viewParams Look at osapi.container.ViewParam.

seems to indicate only values in osapi.container.ViewParam are
respected by the function.

- Henry

On Thu, Dec 15, 2011 at 12:01 PM, Ryan J Baxter <rj...@us.ibm.com> 
wrote:
> Yes it could have anything, its just a JSON object.
>
> -Ryan
>
> Email: rjbaxter@us.ibm.com
> Phone: 978-899-3041
> developerWorks Profile
>
>
>
> From:   Henry Saputra <he...@gmail.com>
> To:     dev@shindig.apache.org,
> Date:   12/15/2011 03:00 PM
> Subject:        Re: What is the purpose of osapi.container.ViewParam
> compare to osapi.container.RenderParam?
>
>
>
> Ah I see, so viewParams can have more mappings than just
> osapi.container.ViewParam (which just have one value "view") I
> suppose?
>
> - Henry
>
> On Thu, Dec 15, 2011 at 11:41 AM, Ryan J Baxter <rj...@us.ibm.com>
> wrote:
>> Henry the view params get passed to GadgetHolder.render in
>> GadgetSite.render.  They get added to the iFrame URL in
>> GadgetHolder.getIframeUrl.
>>
>> -Ryan
>>
>> Email: rjbaxter@us.ibm.com
>> Phone: 978-899-3041
>> developerWorks Profile
>>
>>
>>
>> From:   Mark Weitzel <we...@gmail.com>
>> To:     dev@shindig.apache.org,
>> Date:   12/15/2011 01:29 PM
>> Subject:        Re: What is the purpose of osapi.container.ViewParam
>> compare to osapi.container.RenderParam?
>>
>>
>>
>> You can definitely use the getViewParams to pass info between the views
>> when it gets rendered.
>>
>> On Thu, Dec 15, 2011 at 1:23 PM, Henry Saputra
>> <he...@gmail.com>wrote:
>>
>>> Hmm interesting, in the code looks like viewParams seems only used to
>>> check what view wanted in rendering the gadget:
>>>
>>> osapi.container.GadgetSite.prototype.render = function(
>>>  gadgetInfo, viewParams, renderParams) {
>>>
>>> ....
>>>
>>>  // Find requested view.
>>>  var view = renderParams[osapi.container.RenderParam.VIEW] ||
>>>      viewParams[osapi.container.ViewParam.VIEW] ||
>>>      previousView;
>>>
>>> ...
>>>
>>> - Henry
>>>
>>> On Thu, Dec 15, 2011 at 6:49 AM, daviesd <da...@oclc.org> wrote:
>>> > Correct.  I've written a sample gadget that demonstrates this.
> Haven't
>>> used
>>> > it in a real world case yet, so not 100% sure the need.
>>> >
>>> > <?xml version="1.0" encoding="UTF-8"?>
>>> >
>>> > <Module>
>>> >
>>> >    <ModulePrefs title="Navigate Params">
>>> >        <Require feature="opensocial-0.9"/>
>>> >        <Require feature="security-token"/>
>>> >        <Require feature="osapi"/>
>>> >        <Require feature="views"/>
>>> >    </ModulePrefs>
>>> >
>>> >    <Content type="html" view="default">
>>> >        <![CDATA[
>>> >        <script type="text/javascript">
>>> >            gadgets.views.requestNavigateTo('home', {name: 'doug'});
>>> >        </script>
>>> >        ]]>
>>> >    </Content>
>>> >
>>> >    <Content type="html" view="home">
>>> >        <![CDATA[
>>> >        <script type="text/javascript">
>>> >            var params = gadgets.views.getParams();
>>> >            document.write('Name is ' + params.name);
>>> >            document.close();
>>> >        </script>
>>> >        ]]>
>>> >    </Content>
>>> >
>>> > </Module>
>>> >
>>> > doug
>>> >
>>> >
>>> > On 12/15/11 9:41 AM, "Ryan J Baxter" <rj...@us.ibm.com> wrote:
>>> >
>>> >> If I remember correctly the ViewParam is the view parameters that
> can
>>> >> retrieved from the gadget via gadgets.views.getParams.
>>> >>
>>> >> -Ryan
>>> >>
>>> >> Email: rjbaxter@us.ibm.com
>>> >> Phone: 978-899-3041
>>> >> developerWorks Profile
>>> >>
>>> >>
>>> >>
>>> >> From:   Henry Saputra <he...@gmail.com>
>>> >> To:     dev@shindig.apache.org,
>>> >> Date:   12/15/2011 01:53 AM
>>> >> Subject:        What is the purpose of osapi.container.ViewParam
>> compare
>>> >> to osapi.container.RenderParam?
>>> >>
>>> >>
>>> >>
>>> >> Hi All,
>>> >>
>>> >> For common container, what is the purpose of
>> osapi.container.ViewParam
>>> >> if the only value it can have is "view" which can be covered by
>>> >> osapi.container.RenderParam "view" param?
>>> >>
>>> >> I see its only used in
>>> >> osapi.container.Container.prototype.navigateGadget to determine 
view
>>> >> to used which just backup if "view" is not set in renderParams
>>> >>
>>> >> - Henry
>>> >>
>>> >>
>>> >>
>>> >>
>>> >
>>> >
>>>
>>
>>
>>
>
>
>
>





Re: What is the purpose of osapi.container.ViewParam compare to osapi.container.RenderParam?

Posted by Henry Saputra <he...@gmail.com>.
Implementation wise yes, its just a JSON object, but the comments in
the code like this:

 * @param {Object} viewParams Look at osapi.container.ViewParam.

seems to indicate only values in osapi.container.ViewParam are
respected by the function.

- Henry

On Thu, Dec 15, 2011 at 12:01 PM, Ryan J Baxter <rj...@us.ibm.com> wrote:
> Yes it could have anything, its just a JSON object.
>
> -Ryan
>
> Email: rjbaxter@us.ibm.com
> Phone: 978-899-3041
> developerWorks Profile
>
>
>
> From:   Henry Saputra <he...@gmail.com>
> To:     dev@shindig.apache.org,
> Date:   12/15/2011 03:00 PM
> Subject:        Re: What is the purpose of osapi.container.ViewParam
> compare to osapi.container.RenderParam?
>
>
>
> Ah I see, so viewParams can have more mappings than just
> osapi.container.ViewParam (which just have one value "view") I
> suppose?
>
> - Henry
>
> On Thu, Dec 15, 2011 at 11:41 AM, Ryan J Baxter <rj...@us.ibm.com>
> wrote:
>> Henry the view params get passed to GadgetHolder.render in
>> GadgetSite.render.  They get added to the iFrame URL in
>> GadgetHolder.getIframeUrl.
>>
>> -Ryan
>>
>> Email: rjbaxter@us.ibm.com
>> Phone: 978-899-3041
>> developerWorks Profile
>>
>>
>>
>> From:   Mark Weitzel <we...@gmail.com>
>> To:     dev@shindig.apache.org,
>> Date:   12/15/2011 01:29 PM
>> Subject:        Re: What is the purpose of osapi.container.ViewParam
>> compare to osapi.container.RenderParam?
>>
>>
>>
>> You can definitely use the getViewParams to pass info between the views
>> when it gets rendered.
>>
>> On Thu, Dec 15, 2011 at 1:23 PM, Henry Saputra
>> <he...@gmail.com>wrote:
>>
>>> Hmm interesting, in the code looks like viewParams seems only used to
>>> check what view wanted in rendering the gadget:
>>>
>>> osapi.container.GadgetSite.prototype.render = function(
>>>  gadgetInfo, viewParams, renderParams) {
>>>
>>> ....
>>>
>>>  // Find requested view.
>>>  var view = renderParams[osapi.container.RenderParam.VIEW] ||
>>>      viewParams[osapi.container.ViewParam.VIEW] ||
>>>      previousView;
>>>
>>> ...
>>>
>>> - Henry
>>>
>>> On Thu, Dec 15, 2011 at 6:49 AM, daviesd <da...@oclc.org> wrote:
>>> > Correct.  I've written a sample gadget that demonstrates this.
> Haven't
>>> used
>>> > it in a real world case yet, so not 100% sure the need.
>>> >
>>> > <?xml version="1.0" encoding="UTF-8"?>
>>> >
>>> > <Module>
>>> >
>>> >    <ModulePrefs title="Navigate Params">
>>> >        <Require feature="opensocial-0.9"/>
>>> >        <Require feature="security-token"/>
>>> >        <Require feature="osapi"/>
>>> >        <Require feature="views"/>
>>> >    </ModulePrefs>
>>> >
>>> >    <Content type="html" view="default">
>>> >        <![CDATA[
>>> >        <script type="text/javascript">
>>> >            gadgets.views.requestNavigateTo('home', {name: 'doug'});
>>> >        </script>
>>> >        ]]>
>>> >    </Content>
>>> >
>>> >    <Content type="html" view="home">
>>> >        <![CDATA[
>>> >        <script type="text/javascript">
>>> >            var params = gadgets.views.getParams();
>>> >            document.write('Name is ' + params.name);
>>> >            document.close();
>>> >        </script>
>>> >        ]]>
>>> >    </Content>
>>> >
>>> > </Module>
>>> >
>>> > doug
>>> >
>>> >
>>> > On 12/15/11 9:41 AM, "Ryan J Baxter" <rj...@us.ibm.com> wrote:
>>> >
>>> >> If I remember correctly the ViewParam is the view parameters that
> can
>>> >> retrieved from the gadget via gadgets.views.getParams.
>>> >>
>>> >> -Ryan
>>> >>
>>> >> Email: rjbaxter@us.ibm.com
>>> >> Phone: 978-899-3041
>>> >> developerWorks Profile
>>> >>
>>> >>
>>> >>
>>> >> From:   Henry Saputra <he...@gmail.com>
>>> >> To:     dev@shindig.apache.org,
>>> >> Date:   12/15/2011 01:53 AM
>>> >> Subject:        What is the purpose of osapi.container.ViewParam
>> compare
>>> >> to osapi.container.RenderParam?
>>> >>
>>> >>
>>> >>
>>> >> Hi All,
>>> >>
>>> >> For common container, what is the purpose of
>> osapi.container.ViewParam
>>> >> if the only value it can have is "view" which can be covered by
>>> >> osapi.container.RenderParam "view" param?
>>> >>
>>> >> I see its only used in
>>> >> osapi.container.Container.prototype.navigateGadget to determine view
>>> >> to used which just backup if "view" is not set in renderParams
>>> >>
>>> >> - Henry
>>> >>
>>> >>
>>> >>
>>> >>
>>> >
>>> >
>>>
>>
>>
>>
>
>
>
>

Re: What is the purpose of osapi.container.ViewParam compare to osapi.container.RenderParam?

Posted by Ryan J Baxter <rj...@us.ibm.com>.
Yes it could have anything, its just a JSON object.

-Ryan

Email: rjbaxter@us.ibm.com
Phone: 978-899-3041
developerWorks Profile



From:   Henry Saputra <he...@gmail.com>
To:     dev@shindig.apache.org, 
Date:   12/15/2011 03:00 PM
Subject:        Re: What is the purpose of osapi.container.ViewParam 
compare to osapi.container.RenderParam?



Ah I see, so viewParams can have more mappings than just
osapi.container.ViewParam (which just have one value "view") I
suppose?

- Henry

On Thu, Dec 15, 2011 at 11:41 AM, Ryan J Baxter <rj...@us.ibm.com> 
wrote:
> Henry the view params get passed to GadgetHolder.render in
> GadgetSite.render.  They get added to the iFrame URL in
> GadgetHolder.getIframeUrl.
>
> -Ryan
>
> Email: rjbaxter@us.ibm.com
> Phone: 978-899-3041
> developerWorks Profile
>
>
>
> From:   Mark Weitzel <we...@gmail.com>
> To:     dev@shindig.apache.org,
> Date:   12/15/2011 01:29 PM
> Subject:        Re: What is the purpose of osapi.container.ViewParam
> compare to osapi.container.RenderParam?
>
>
>
> You can definitely use the getViewParams to pass info between the views
> when it gets rendered.
>
> On Thu, Dec 15, 2011 at 1:23 PM, Henry Saputra
> <he...@gmail.com>wrote:
>
>> Hmm interesting, in the code looks like viewParams seems only used to
>> check what view wanted in rendering the gadget:
>>
>> osapi.container.GadgetSite.prototype.render = function(
>>  gadgetInfo, viewParams, renderParams) {
>>
>> ....
>>
>>  // Find requested view.
>>  var view = renderParams[osapi.container.RenderParam.VIEW] ||
>>      viewParams[osapi.container.ViewParam.VIEW] ||
>>      previousView;
>>
>> ...
>>
>> - Henry
>>
>> On Thu, Dec 15, 2011 at 6:49 AM, daviesd <da...@oclc.org> wrote:
>> > Correct.  I've written a sample gadget that demonstrates this. 
Haven't
>> used
>> > it in a real world case yet, so not 100% sure the need.
>> >
>> > <?xml version="1.0" encoding="UTF-8"?>
>> >
>> > <Module>
>> >
>> >    <ModulePrefs title="Navigate Params">
>> >        <Require feature="opensocial-0.9"/>
>> >        <Require feature="security-token"/>
>> >        <Require feature="osapi"/>
>> >        <Require feature="views"/>
>> >    </ModulePrefs>
>> >
>> >    <Content type="html" view="default">
>> >        <![CDATA[
>> >        <script type="text/javascript">
>> >            gadgets.views.requestNavigateTo('home', {name: 'doug'});
>> >        </script>
>> >        ]]>
>> >    </Content>
>> >
>> >    <Content type="html" view="home">
>> >        <![CDATA[
>> >        <script type="text/javascript">
>> >            var params = gadgets.views.getParams();
>> >            document.write('Name is ' + params.name);
>> >            document.close();
>> >        </script>
>> >        ]]>
>> >    </Content>
>> >
>> > </Module>
>> >
>> > doug
>> >
>> >
>> > On 12/15/11 9:41 AM, "Ryan J Baxter" <rj...@us.ibm.com> wrote:
>> >
>> >> If I remember correctly the ViewParam is the view parameters that 
can
>> >> retrieved from the gadget via gadgets.views.getParams.
>> >>
>> >> -Ryan
>> >>
>> >> Email: rjbaxter@us.ibm.com
>> >> Phone: 978-899-3041
>> >> developerWorks Profile
>> >>
>> >>
>> >>
>> >> From:   Henry Saputra <he...@gmail.com>
>> >> To:     dev@shindig.apache.org,
>> >> Date:   12/15/2011 01:53 AM
>> >> Subject:        What is the purpose of osapi.container.ViewParam
> compare
>> >> to osapi.container.RenderParam?
>> >>
>> >>
>> >>
>> >> Hi All,
>> >>
>> >> For common container, what is the purpose of
> osapi.container.ViewParam
>> >> if the only value it can have is "view" which can be covered by
>> >> osapi.container.RenderParam "view" param?
>> >>
>> >> I see its only used in
>> >> osapi.container.Container.prototype.navigateGadget to determine view
>> >> to used which just backup if "view" is not set in renderParams
>> >>
>> >> - Henry
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>>
>
>
>





Re: What is the purpose of osapi.container.ViewParam compare to osapi.container.RenderParam?

Posted by Henry Saputra <he...@gmail.com>.
Ah I see, so viewParams can have more mappings than just
osapi.container.ViewParam (which just have one value "view") I
suppose?

- Henry

On Thu, Dec 15, 2011 at 11:41 AM, Ryan J Baxter <rj...@us.ibm.com> wrote:
> Henry the view params get passed to GadgetHolder.render in
> GadgetSite.render.  They get added to the iFrame URL in
> GadgetHolder.getIframeUrl.
>
> -Ryan
>
> Email: rjbaxter@us.ibm.com
> Phone: 978-899-3041
> developerWorks Profile
>
>
>
> From:   Mark Weitzel <we...@gmail.com>
> To:     dev@shindig.apache.org,
> Date:   12/15/2011 01:29 PM
> Subject:        Re: What is the purpose of osapi.container.ViewParam
> compare to osapi.container.RenderParam?
>
>
>
> You can definitely use the getViewParams to pass info between the views
> when it gets rendered.
>
> On Thu, Dec 15, 2011 at 1:23 PM, Henry Saputra
> <he...@gmail.com>wrote:
>
>> Hmm interesting, in the code looks like viewParams seems only used to
>> check what view wanted in rendering the gadget:
>>
>> osapi.container.GadgetSite.prototype.render = function(
>>  gadgetInfo, viewParams, renderParams) {
>>
>> ....
>>
>>  // Find requested view.
>>  var view = renderParams[osapi.container.RenderParam.VIEW] ||
>>      viewParams[osapi.container.ViewParam.VIEW] ||
>>      previousView;
>>
>> ...
>>
>> - Henry
>>
>> On Thu, Dec 15, 2011 at 6:49 AM, daviesd <da...@oclc.org> wrote:
>> > Correct.  I've written a sample gadget that demonstrates this. Haven't
>> used
>> > it in a real world case yet, so not 100% sure the need.
>> >
>> > <?xml version="1.0" encoding="UTF-8"?>
>> >
>> > <Module>
>> >
>> >    <ModulePrefs title="Navigate Params">
>> >        <Require feature="opensocial-0.9"/>
>> >        <Require feature="security-token"/>
>> >        <Require feature="osapi"/>
>> >        <Require feature="views"/>
>> >    </ModulePrefs>
>> >
>> >    <Content type="html" view="default">
>> >        <![CDATA[
>> >        <script type="text/javascript">
>> >            gadgets.views.requestNavigateTo('home', {name: 'doug'});
>> >        </script>
>> >        ]]>
>> >    </Content>
>> >
>> >    <Content type="html" view="home">
>> >        <![CDATA[
>> >        <script type="text/javascript">
>> >            var params = gadgets.views.getParams();
>> >            document.write('Name is ' + params.name);
>> >            document.close();
>> >        </script>
>> >        ]]>
>> >    </Content>
>> >
>> > </Module>
>> >
>> > doug
>> >
>> >
>> > On 12/15/11 9:41 AM, "Ryan J Baxter" <rj...@us.ibm.com> wrote:
>> >
>> >> If I remember correctly the ViewParam is the view parameters that can
>> >> retrieved from the gadget via gadgets.views.getParams.
>> >>
>> >> -Ryan
>> >>
>> >> Email: rjbaxter@us.ibm.com
>> >> Phone: 978-899-3041
>> >> developerWorks Profile
>> >>
>> >>
>> >>
>> >> From:   Henry Saputra <he...@gmail.com>
>> >> To:     dev@shindig.apache.org,
>> >> Date:   12/15/2011 01:53 AM
>> >> Subject:        What is the purpose of osapi.container.ViewParam
> compare
>> >> to osapi.container.RenderParam?
>> >>
>> >>
>> >>
>> >> Hi All,
>> >>
>> >> For common container, what is the purpose of
> osapi.container.ViewParam
>> >> if the only value it can have is "view" which can be covered by
>> >> osapi.container.RenderParam "view" param?
>> >>
>> >> I see its only used in
>> >> osapi.container.Container.prototype.navigateGadget to determine view
>> >> to used which just backup if "view" is not set in renderParams
>> >>
>> >> - Henry
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>>
>
>
>

Re: What is the purpose of osapi.container.ViewParam compare to osapi.container.RenderParam?

Posted by Ryan J Baxter <rj...@us.ibm.com>.
Henry the view params get passed to GadgetHolder.render in 
GadgetSite.render.  They get added to the iFrame URL in 
GadgetHolder.getIframeUrl.

-Ryan

Email: rjbaxter@us.ibm.com
Phone: 978-899-3041
developerWorks Profile



From:   Mark Weitzel <we...@gmail.com>
To:     dev@shindig.apache.org, 
Date:   12/15/2011 01:29 PM
Subject:        Re: What is the purpose of osapi.container.ViewParam 
compare to osapi.container.RenderParam?



You can definitely use the getViewParams to pass info between the views
when it gets rendered.

On Thu, Dec 15, 2011 at 1:23 PM, Henry Saputra 
<he...@gmail.com>wrote:

> Hmm interesting, in the code looks like viewParams seems only used to
> check what view wanted in rendering the gadget:
>
> osapi.container.GadgetSite.prototype.render = function(
>  gadgetInfo, viewParams, renderParams) {
>
> ....
>
>  // Find requested view.
>  var view = renderParams[osapi.container.RenderParam.VIEW] ||
>      viewParams[osapi.container.ViewParam.VIEW] ||
>      previousView;
>
> ...
>
> - Henry
>
> On Thu, Dec 15, 2011 at 6:49 AM, daviesd <da...@oclc.org> wrote:
> > Correct.  I've written a sample gadget that demonstrates this. Haven't
> used
> > it in a real world case yet, so not 100% sure the need.
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> > <Module>
> >
> >    <ModulePrefs title="Navigate Params">
> >        <Require feature="opensocial-0.9"/>
> >        <Require feature="security-token"/>
> >        <Require feature="osapi"/>
> >        <Require feature="views"/>
> >    </ModulePrefs>
> >
> >    <Content type="html" view="default">
> >        <![CDATA[
> >        <script type="text/javascript">
> >            gadgets.views.requestNavigateTo('home', {name: 'doug'});
> >        </script>
> >        ]]>
> >    </Content>
> >
> >    <Content type="html" view="home">
> >        <![CDATA[
> >        <script type="text/javascript">
> >            var params = gadgets.views.getParams();
> >            document.write('Name is ' + params.name);
> >            document.close();
> >        </script>
> >        ]]>
> >    </Content>
> >
> > </Module>
> >
> > doug
> >
> >
> > On 12/15/11 9:41 AM, "Ryan J Baxter" <rj...@us.ibm.com> wrote:
> >
> >> If I remember correctly the ViewParam is the view parameters that can
> >> retrieved from the gadget via gadgets.views.getParams.
> >>
> >> -Ryan
> >>
> >> Email: rjbaxter@us.ibm.com
> >> Phone: 978-899-3041
> >> developerWorks Profile
> >>
> >>
> >>
> >> From:   Henry Saputra <he...@gmail.com>
> >> To:     dev@shindig.apache.org,
> >> Date:   12/15/2011 01:53 AM
> >> Subject:        What is the purpose of osapi.container.ViewParam 
compare
> >> to osapi.container.RenderParam?
> >>
> >>
> >>
> >> Hi All,
> >>
> >> For common container, what is the purpose of 
osapi.container.ViewParam
> >> if the only value it can have is "view" which can be covered by
> >> osapi.container.RenderParam "view" param?
> >>
> >> I see its only used in
> >> osapi.container.Container.prototype.navigateGadget to determine view
> >> to used which just backup if "view" is not set in renderParams
> >>
> >> - Henry
> >>
> >>
> >>
> >>
> >
> >
>




Re: What is the purpose of osapi.container.ViewParam compare to osapi.container.RenderParam?

Posted by Mark Weitzel <we...@gmail.com>.
You can definitely use the getViewParams to pass info between the views
when it gets rendered.

On Thu, Dec 15, 2011 at 1:23 PM, Henry Saputra <he...@gmail.com>wrote:

> Hmm interesting, in the code looks like viewParams seems only used to
> check what view wanted in rendering the gadget:
>
> osapi.container.GadgetSite.prototype.render = function(
>  gadgetInfo, viewParams, renderParams) {
>
> ....
>
>  // Find requested view.
>  var view = renderParams[osapi.container.RenderParam.VIEW] ||
>      viewParams[osapi.container.ViewParam.VIEW] ||
>      previousView;
>
> ...
>
> - Henry
>
> On Thu, Dec 15, 2011 at 6:49 AM, daviesd <da...@oclc.org> wrote:
> > Correct.  I've written a sample gadget that demonstrates this.  Haven't
> used
> > it in a real world case yet, so not 100% sure the need.
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> > <Module>
> >
> >    <ModulePrefs title="Navigate Params">
> >        <Require feature="opensocial-0.9"/>
> >        <Require feature="security-token"/>
> >        <Require feature="osapi"/>
> >        <Require feature="views"/>
> >    </ModulePrefs>
> >
> >    <Content type="html" view="default">
> >        <![CDATA[
> >        <script type="text/javascript">
> >            gadgets.views.requestNavigateTo('home', {name: 'doug'});
> >        </script>
> >        ]]>
> >    </Content>
> >
> >    <Content type="html" view="home">
> >        <![CDATA[
> >        <script type="text/javascript">
> >            var params = gadgets.views.getParams();
> >            document.write('Name is ' + params.name);
> >            document.close();
> >        </script>
> >        ]]>
> >    </Content>
> >
> > </Module>
> >
> > doug
> >
> >
> > On 12/15/11 9:41 AM, "Ryan J Baxter" <rj...@us.ibm.com> wrote:
> >
> >> If I remember correctly the ViewParam is the view parameters that can
> >> retrieved from the gadget via gadgets.views.getParams.
> >>
> >> -Ryan
> >>
> >> Email: rjbaxter@us.ibm.com
> >> Phone: 978-899-3041
> >> developerWorks Profile
> >>
> >>
> >>
> >> From:   Henry Saputra <he...@gmail.com>
> >> To:     dev@shindig.apache.org,
> >> Date:   12/15/2011 01:53 AM
> >> Subject:        What is the purpose of osapi.container.ViewParam compare
> >> to osapi.container.RenderParam?
> >>
> >>
> >>
> >> Hi All,
> >>
> >> For common container, what is the purpose of osapi.container.ViewParam
> >> if the only value it can have is "view" which can be covered by
> >> osapi.container.RenderParam "view" param?
> >>
> >> I see its only used in
> >> osapi.container.Container.prototype.navigateGadget to determine view
> >> to used which just backup if "view" is not set in renderParams
> >>
> >> - Henry
> >>
> >>
> >>
> >>
> >
> >
>

Re: What is the purpose of osapi.container.ViewParam compare to osapi.container.RenderParam?

Posted by Henry Saputra <he...@gmail.com>.
Hmm interesting, in the code looks like viewParams seems only used to
check what view wanted in rendering the gadget:

osapi.container.GadgetSite.prototype.render = function(
  gadgetInfo, viewParams, renderParams) {

....

  // Find requested view.
  var view = renderParams[osapi.container.RenderParam.VIEW] ||
      viewParams[osapi.container.ViewParam.VIEW] ||
      previousView;

...

- Henry

On Thu, Dec 15, 2011 at 6:49 AM, daviesd <da...@oclc.org> wrote:
> Correct.  I've written a sample gadget that demonstrates this.  Haven't used
> it in a real world case yet, so not 100% sure the need.
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <Module>
>
>    <ModulePrefs title="Navigate Params">
>        <Require feature="opensocial-0.9"/>
>        <Require feature="security-token"/>
>        <Require feature="osapi"/>
>        <Require feature="views"/>
>    </ModulePrefs>
>
>    <Content type="html" view="default">
>        <![CDATA[
>        <script type="text/javascript">
>            gadgets.views.requestNavigateTo('home', {name: 'doug'});
>        </script>
>        ]]>
>    </Content>
>
>    <Content type="html" view="home">
>        <![CDATA[
>        <script type="text/javascript">
>            var params = gadgets.views.getParams();
>            document.write('Name is ' + params.name);
>            document.close();
>        </script>
>        ]]>
>    </Content>
>
> </Module>
>
> doug
>
>
> On 12/15/11 9:41 AM, "Ryan J Baxter" <rj...@us.ibm.com> wrote:
>
>> If I remember correctly the ViewParam is the view parameters that can
>> retrieved from the gadget via gadgets.views.getParams.
>>
>> -Ryan
>>
>> Email: rjbaxter@us.ibm.com
>> Phone: 978-899-3041
>> developerWorks Profile
>>
>>
>>
>> From:   Henry Saputra <he...@gmail.com>
>> To:     dev@shindig.apache.org,
>> Date:   12/15/2011 01:53 AM
>> Subject:        What is the purpose of osapi.container.ViewParam compare
>> to osapi.container.RenderParam?
>>
>>
>>
>> Hi All,
>>
>> For common container, what is the purpose of osapi.container.ViewParam
>> if the only value it can have is "view" which can be covered by
>> osapi.container.RenderParam "view" param?
>>
>> I see its only used in
>> osapi.container.Container.prototype.navigateGadget to determine view
>> to used which just backup if "view" is not set in renderParams
>>
>> - Henry
>>
>>
>>
>>
>
>

Re: What is the purpose of osapi.container.ViewParam compare to osapi.container.RenderParam?

Posted by daviesd <da...@oclc.org>.
Correct.  I've written a sample gadget that demonstrates this.  Haven't used
it in a real world case yet, so not 100% sure the need.

<?xml version="1.0" encoding="UTF-8"?>

<Module>

    <ModulePrefs title="Navigate Params">
        <Require feature="opensocial-0.9"/>
        <Require feature="security-token"/>
        <Require feature="osapi"/>
        <Require feature="views"/>
    </ModulePrefs>

    <Content type="html" view="default">
        <![CDATA[
        <script type="text/javascript">
            gadgets.views.requestNavigateTo('home', {name: 'doug'});
        </script>
        ]]>
    </Content>

    <Content type="html" view="home">
        <![CDATA[
        <script type="text/javascript">
            var params = gadgets.views.getParams();
            document.write('Name is ' + params.name);
            document.close();
        </script>
        ]]>
    </Content>

</Module>

doug


On 12/15/11 9:41 AM, "Ryan J Baxter" <rj...@us.ibm.com> wrote:

> If I remember correctly the ViewParam is the view parameters that can
> retrieved from the gadget via gadgets.views.getParams.
> 
> -Ryan
> 
> Email: rjbaxter@us.ibm.com
> Phone: 978-899-3041
> developerWorks Profile
> 
> 
> 
> From:   Henry Saputra <he...@gmail.com>
> To:     dev@shindig.apache.org,
> Date:   12/15/2011 01:53 AM
> Subject:        What is the purpose of osapi.container.ViewParam compare
> to osapi.container.RenderParam?
> 
> 
> 
> Hi All,
> 
> For common container, what is the purpose of osapi.container.ViewParam
> if the only value it can have is "view" which can be covered by
> osapi.container.RenderParam "view" param?
> 
> I see its only used in
> osapi.container.Container.prototype.navigateGadget to determine view
> to used which just backup if "view" is not set in renderParams
> 
> - Henry
> 
> 
> 
> 



Re: What is the purpose of osapi.container.ViewParam compare to osapi.container.RenderParam?

Posted by Ryan J Baxter <rj...@us.ibm.com>.
If I remember correctly the ViewParam is the view parameters that can 
retrieved from the gadget via gadgets.views.getParams.

-Ryan

Email: rjbaxter@us.ibm.com
Phone: 978-899-3041
developerWorks Profile



From:   Henry Saputra <he...@gmail.com>
To:     dev@shindig.apache.org, 
Date:   12/15/2011 01:53 AM
Subject:        What is the purpose of osapi.container.ViewParam compare 
to osapi.container.RenderParam?



Hi All,

For common container, what is the purpose of osapi.container.ViewParam
if the only value it can have is "view" which can be covered by
osapi.container.RenderParam "view" param?

I see its only used in
osapi.container.Container.prototype.navigateGadget to determine view
to used which just backup if "view" is not set in renderParams

- Henry