|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.smartgwt.client.widgets.BaseWidget
com.smartgwt.client.widgets.Canvas
com.smartgwt.client.widgets.StatefulCanvas
com.smartgwt.client.widgets.Button
com.smartgwt.client.widgets.Label
com.smartgwt.client.widgets.ViewLoader
public class ViewLoader
The ViewLoader component can be used to load new SmartGWT-based user interfaces into a running application.
NOTE: before using a ViewLoader, be sure that you have read about and understood the
'SmartGWT Architecture'
. The most responsive and
scalable application architecture preloads views rather than using ViewLoaders.
A ViewLoader is a Canvas, and can be provided anywhere a Canvas can be provided: as a Tab
pane, and Layout member, etc. When a ViewLoader draws, it shows a
loadingMessage
, then
performs an RPC to the viewURL
to load components.
The response from the viewURL should be SmartGWT components defined in JavaScript, with no
surrounding <SCRIPT> tags or other HTML framing. The returned script can be
dynamically generated, for example, it may be the result of a JSP containing an XML view
description enclosed in '<isomorphicXML>'
tags.
In the returned script, the special variable "viewLoader" is available to refer to the
ViewLoader instance that is loading components. The intended usage is that the returned
script creates a view consisting of SmartGWT components, then calls
viewLoader.setView(myView)
to place the loaded view into the ViewLoader.
If the view does not call setView() explicitly, the viewLoader will find the last top-level
UI component (Canvas subclass) created by the view and set that as the current view.
Top-level in this case means that the UI component is not contained in another UI component
as a member or child.
The ViewLoader relies on the XMLHttpRequest object which can be disabled by end-users in some
supported browsers. See PlatformDependencies
for more information.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Field Summary |
---|
Fields inherited from class com.smartgwt.client.widgets.BaseWidget |
---|
config, configOnly, id, isElementSet |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
ViewLoader()
|
|
ViewLoader(com.google.gwt.core.client.JavaScriptObject jsObj)
|
Method Summary | |
---|---|
protected com.google.gwt.core.client.JavaScriptObject |
create()
|
java.lang.Boolean |
getAllowCaching()
By default a ViewLoader will explicitly prevent browser caching. |
java.lang.String |
getHttpMethod()
Selects the HTTP method that will be used when fetching content. |
java.lang.String |
getLoadingMessage()
Message to show while the view is loading |
static ViewLoader |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
|
Canvas |
getView()
Retrieve the current view. |
java.lang.String |
getViewURL()
URL to load components from. |
void |
setAllowCaching(java.lang.Boolean allowCaching)
By default a ViewLoader will explicitly prevent browser caching. |
void |
setHttpMethod(java.lang.String httpMethod)
Selects the HTTP method that will be used when fetching content. |
void |
setLoadingMessage(java.lang.String loadingMessage)
Message to show while the view is loading |
void |
setViewURL(java.lang.String viewURL)
URL to load components from. |
void |
viewLoaded(Canvas view)
StringMethod fired when the view has been loaded. |
Methods inherited from class com.smartgwt.client.widgets.Label |
---|
getAlign, getAutoFit, getContents, getDynamicContents, getIcon, getIconAlign, getIconHeight, getIconOrientation, getIconSize, getIconSpacing, getIconWidth, getShowDisabledIcon, getShowDownIcon, getShowFocusedIcon, getShowRollOverIcon, getShowSelectedIcon, getValign, getWrap, setAlign, setAutoFit, setContents, setDynamicContents, setIcon, setIconAlign, setIconHeight, setIconOrientation, setIconSize, setIconSpacing, setIconWidth, setShowDisabledIcon, setShowDownIcon, setShowFocusedIcon, setShowRollOverIcon, setShowSelectedIcon, setValign, setWrap |
Methods inherited from class com.smartgwt.client.widgets.Button |
---|
action, addIconClickHandler, addToRadioGroup, deselect, getActionType, getBaseStyle, getHiliteAccessKey, getRadioGroup, getSelected, getShowDisabled, getShowDown, getShowFocused, getShowRollOver, getState, getTitle, isSelected, removeFromRadioGroup, removeFromRadioGroup, select, setActionType, setBaseStyle, setDisabled, setHiliteAccessKey, setRadioGroup, setSelected, setShowDisabled, setShowDown, setShowFocused, setShowRollOver, setState, setTitle, setVAlign |
Methods inherited from class com.smartgwt.client.widgets.StatefulCanvas |
---|
getOverCanvasConstructor, getRedrawOnStateChange, getShowFocusedAsOver, getShowOverCanvas, getStateSuffix, setOverCanvasConstructor, setRedrawOnStateChange, setShowFocusedAsOver, setShowOverCanvas, setTitleStyle |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getStyleElement, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setPixelSize, setSize, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Constructor Detail |
---|
public ViewLoader()
public ViewLoader(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail |
---|
public static ViewLoader getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
protected com.google.gwt.core.client.JavaScriptObject create()
create
in class Label
public void setLoadingMessage(java.lang.String loadingMessage) throws java.lang.IllegalStateException
loadingMessage
- loadingMessage Default value is "Loading View..."
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.String getLoadingMessage()
public void setViewURL(java.lang.String viewURL) throws java.lang.IllegalStateException
Can also be called with no arguments to reload the view from the existing
viewURL
.
viewURL
- URL to retrieve view from. Default value is null
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.String getViewURL()
public void setHttpMethod(java.lang.String httpMethod)
httpMethod
- httpMethod Default value is "GET"public java.lang.String getHttpMethod()
public void setAllowCaching(java.lang.Boolean allowCaching) throws java.lang.IllegalStateException
Set to true to allow browser caching if the browser would normally do so, in other words, if the HTTP headers returned with the response indicate that the response can be cached.
allowCaching
- allowCaching Default value is false
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getAllowCaching()
Set to true to allow browser caching if the browser would normally do so, in other words, if the HTTP headers returned with the response indicate that the response can be cached.
public Canvas getView()
public void viewLoaded(Canvas view)
view
- the view that was loaded
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |