Hey Chris,

You are seeing this because the rave.RegionWidget.defaultView property
was not set on the portal pages.  I have updated the page.jsp file to
set defaultView to 'home', which should create the behavior you are
expecting. You can up 0.21.1 and confirm.

For clarity I'll try to explain clearly what's going on here.

- There are two overlapping concepts of views right now. Rave portal
has a concept of views which is basically the container in which the
iframe is rendered (home view with widget chrome and menu on the page,
maximized view, modals and slideouts for example). Shindig gadgets
have a concept of view which is the content within the iframe -
default, canvas, profile, etc.
- Those two things do not necessarily align. For ex. you may want the
same widget chrome (rave view) for both portal pages and profile
pages, but the gadget view is different - home vs profile. You may
want to render any number of gadget views into a modal.
- When you render a widget through the rave core api you can manually
declare which rave view and gadget view to render it into:

    rave.getWidget(id).render('raveView', {view: 'gadgetView'});

- If the gadget view is not defined there, it then assumes that gadget
view property to be rave.RegionWidget.defaultView. This will be
'default' until some page changes it. So if we want our gadgets to be
in home mode on the portal pages we change defaultView to 'home', on
profile pages we change it to 'profile'
- If the gadget in question does not have the specified view declared,
shindig falls back on 'default' view.

On Thu, May 2, 2013 at 12:29 PM, Chris Geer <[email protected]> wrote:
> I wanted to start a discussion about view rendering. In testing of 0.21.1 I
> noticed that the Gadget View Type (canvas-nav.xml) demo gadget wasn't
> displaying properly. Looking into it I saw that it had a new view defined
> with type="default" that was being displayed regardless of what mode the
> gadget was in (same view in home and maximized) which wasn't correct. The
> gadget already defined both a home view and a canvas view but they were
> being ignored. So my question is what is the right way to render gadgets?
>
> My 2 cents is that if there is a specific view defined (home, canvas,
> profile) it should be used when the gadget is in that mode. If there isn't
> a view defined for the current mode, then if there is a default view
> defined it should be used. Right now we seem to have the opposite where
> default is always used. I'm not sure if this is a Rave problem where we
> aren't requesting the render the view in the right mode or if it's a
> shindig problem where it's picking the wrong view.
>
> BTW - I'm removed the default view from the canvas-nav gadget so it works
> again but the problem is easy to recreate.
>
> Chris

Reply via email to