Skip to main content

gadgets.views

Method​

gadgets.views.bind​

<static> String bind(urlTemplate, environment)

Binds a URL template with variables in the passed environment to produce a URL string.

Parameter​
NameTypeDescription
urlTemplateStringA URL template for a container view.
environmentArrayA set of specified string type variables.(example:[OWNER
Return value​
TypeDescription
StringA URL string

gadgets.views.getCurrentView​

<static> gadgets.views.View getCurrentView()

Returns the current view.

Parameter​

None

Return value​
TypeDescription
gadgets.views.ViewCurrent view
Sample​
var view = gadgets.views.getCurrentView();

gadgets.views.getParams​

<static> Map.<String, String> getParams()

Returns the parameters passed into this gadget for this view.

Parameter​

None

Return value​
TypeDescription
Map.<String, String>Parameter map

gadgets.views.getSupportedViews​

<static> Map<gadgets.views.ViewType, String, gadgets.views.View> getSupportedViews()

Returns a map of all supported views. Each gadgets.view.View name is used as a key.

Parameter​

None

Return value​
TypeDescription
MapAll supported views, using their name attribute as a key.

gadgets.views.requestNavigateTo​

It is scheduled to be offered.

gadgets.views.View.bind​

String bind(environment)

Binds the view's URL template with variables in the passed environment to produce a URL string.

Parameter​
NameTypeDescription
environmentArrayA set of specified string type variables.(example: [OWNER
Return value​
TypeDescription
StringA URL string

gadgets.views.View.getName​

gadgets.views.ViewType, String getName()

Returns the name of this view.

Parameter​

None

Return value​
TypeDescription
StringView name
Sample​
var view = gadgets.views.getCurrentView();
var name = view.getName();

gadgets.views.View.getUrlTemplate​

Not supported.

gadgets.views.View.isOnlyVisibleGadget​

boolean isOnlyVisibleGadget()

Returns true if the specified gadget is the only visible gadget in this view. On a canvas page or in maximize mode it is most likely true; on a profile page or in dashboard mode, it is most likely false.

Parameter​

None

Return value​
TypeDescription
booleanTrue if the specified gadget is the only visible gadget in this view; otherwise, false.
Sample​
var view = gadgets.views.getCurrentView();
if (view.isOnlyVisibleGadget) {
// ...
} else {
// ...
}

gadgets.views.ViewType​

gadgets.views.ViewType.HOME​

It is scheduled to be offered.

gadgets.views.ViewType.PROFILE​

It is scheduled to be offered.

gadgets.views.ViewType.CANVAS​

The canvas view.

gadgets.views.ViewType.PREVIEW​

Not supported.

Revision History​

  • 12/2010
    • Initial Release.