|
|||||||||
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 Smart GWT-based user interfaces into a running application.
NOTE: before using a ViewLoader, be sure that you have read about and understood the 'Smart GWT 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 'loading message'
, then performs an RPC to the 'viewURL'
to load components.
The response from the viewURL
should be Smart GWT 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 Smart GWT 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 |
---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
Field Summary |
---|
Fields inherited from class com.smartgwt.client.widgets.BaseWidget |
---|
config, configOnly, id, isElementSet, scClassName |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
ViewLoader()
|
|
ViewLoader(JavaScriptObject jsObj)
|
Method Summary | |
---|---|
protected JavaScriptObject |
create()
|
Boolean |
getAllowCaching()
By default a ViewLoader will explicitly prevent browser caching. |
String |
getHttpMethod()
Selects the HTTP method that will be used when fetching content. |
String |
getLoadingMessage()
Message to show while the view is loading |
static ViewLoader |
getOrCreateRef(JavaScriptObject jsObj)
|
Canvas |
getView()
Retrieve the current view. |
String |
getViewURL()
URL to load components from. |
void |
setAllowCaching(Boolean allowCaching)
By default a ViewLoader will explicitly prevent browser caching. |
void |
setHttpMethod(String httpMethod)
Selects the HTTP method that will be used when fetching content. |
void |
setLoadingMessage(String loadingMessage)
Message to show while the view is loading |
void |
setViewURL(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 |
---|
addDomHandler, addHandler, delegateEvent, doAttachChildren, doDetachChildren, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents |
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, 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(JavaScriptObject jsObj)
Method Detail |
---|
public static ViewLoader getOrCreateRef(JavaScriptObject jsObj)
protected JavaScriptObject create()
create
in class Label
public void setLoadingMessage(String loadingMessage) throws IllegalStateException
loadingMessage
- loadingMessage Default value is "Loading View..."
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getLoadingMessage()
public void setViewURL(String viewURL) throws 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
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getViewURL()
public void setHttpMethod(String httpMethod)
httpMethod
- httpMethod Default value is "GET"public String getHttpMethod()
public void setAllowCaching(Boolean allowCaching) throws 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
IllegalStateException
- this property cannot be changed after the component has been createdpublic 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 |