You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@shindig.apache.org by Allan Bond <al...@yahoo.com> on 2011/03/21 16:15:51 UTC

different views in the same gadget container

Hello,

I am working on a gadget container that has different layout options (typical 
layouts like 2-column, 3-column, etc.) We plan to support several gadget view 
sizes ('canvas', 'home', and 'wide'). When I switch to a two-column view where 
Column A is maybe 2/3 of the browser width and Column B is 1/3, what is the 
preferred way to tell shindig which view each gadget should use for rendering?

Currently, as each gadget is added to the page, I call


shindig.container.setView('<view name>');
The <view name> changes depending on the column in which the gadget resides. Is 
there a better or more preferred way to accomplish this? There is a parameter 
called viewParams, but I'm not sure how that is used (can't see it in the 
shindig gadget rendering servlet source either).

I've looked at several OpenSocial implementations (OSEC & Eureka Streams) and 
they don't seem to change the view based on how wide the columns are in the 
layout. They only change the view to 'canvas' when the user maximizes a specific 
gadget.

Thanks for your input.

- Allan



      

Re: different views in the same gadget container

Posted by Allan Bond <al...@yahoo.com>.
We ended up setting a 'view' property on each of our gadgets. In addition, we 
implemented our own version of shindig.IfrGadget and changed the getIFrameUrl() 
function to set the &view parameter to gadget's view property. This way, 
whenever the container needs to repaint our gadgets, each gadget knows it's 
current view. We also have logic to change the gadget's view property when it is 
dragged to a different location in the layout.

Having done this, we aren't sure whether or not we'll really use the WIDE view. 
So we may end up with an approach similar to the one you suggested where the 
gadget just figures out what it can fit into its allocated space and dynamically 
changes its content. Thanks for the tip!

- Allan




________________________________
From: Paul Lindner <li...@inuus.com>
To: users@shindig.apache.org
Cc: Allan Bond <al...@yahoo.com>
Sent: Mon, March 21, 2011 12:15:33 PM
Subject: Re: different views in the same gadget container

Having gone through a number of container redesigns I can only suggest that
you inform gadget authors to make their gadget deal with dynamic width.  Try
using gadgets.window.getViewportDimensions()


On Mon, Mar 21, 2011 at 8:15 AM, Allan Bond <al...@yahoo.com> wrote:

> Hello,
>
> I am working on a gadget container that has different layout options
> (typical
> layouts like 2-column, 3-column, etc.) We plan to support several gadget
> view
> sizes ('canvas', 'home', and 'wide'). When I switch to a two-column view
> where
> Column A is maybe 2/3 of the browser width and Column B is 1/3, what is the
> preferred way to tell shindig which view each gadget should use for
> rendering?
>
> Currently, as each gadget is added to the page, I call
>
>
> shindig.container.setView('<view name>');
> The <view name> changes depending on the column in which the gadget
> resides. Is
> there a better or more preferred way to accomplish this? There is a
> parameter
> called viewParams, but I'm not sure how that is used (can't see it in the
> shindig gadget rendering servlet source either).
>
> I've looked at several OpenSocial implementations (OSEC & Eureka Streams)
> and
> they don't seem to change the view based on how wide the columns are in the
> layout. They only change the view to 'canvas' when the user maximizes a
> specific
> gadget.
>
> Thanks for your input.
>
> - Allan
>
>
>
>




-- 
Paul Lindner -- lindner@inuus.com -- linkedin.com/in/plindner

Re: different views in the same gadget container

Posted by Paul Lindner <li...@inuus.com>.
Having gone through a number of container redesigns I can only suggest that
you inform gadget authors to make their gadget deal with dynamic width.  Try
using gadgets.window.getViewportDimensions()


On Mon, Mar 21, 2011 at 8:15 AM, Allan Bond <al...@yahoo.com> wrote:

> Hello,
>
> I am working on a gadget container that has different layout options
> (typical
> layouts like 2-column, 3-column, etc.) We plan to support several gadget
> view
> sizes ('canvas', 'home', and 'wide'). When I switch to a two-column view
> where
> Column A is maybe 2/3 of the browser width and Column B is 1/3, what is the
> preferred way to tell shindig which view each gadget should use for
> rendering?
>
> Currently, as each gadget is added to the page, I call
>
>
> shindig.container.setView('<view name>');
> The <view name> changes depending on the column in which the gadget
> resides. Is
> there a better or more preferred way to accomplish this? There is a
> parameter
> called viewParams, but I'm not sure how that is used (can't see it in the
> shindig gadget rendering servlet source either).
>
> I've looked at several OpenSocial implementations (OSEC & Eureka Streams)
> and
> they don't seem to change the view based on how wide the columns are in the
> layout. They only change the view to 'canvas' when the user maximizes a
> specific
> gadget.
>
> Thanks for your input.
>
> - Allan
>
>
>
>




-- 
Paul Lindner -- lindner@inuus.com -- linkedin.com/in/plindner