NOTE: before using a ViewLoader, be sure that you have read about and understood the {@link com.smartgwt.client.docs.SmartArchitecture 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 {@link com.smartgwt.client.widgets.ViewLoader#getLoadingMessage loading message}, then performs an RPC to the {@link com.smartgwt.client.widgets.ViewLoader#getViewURL viewURL} to load components.
The response from the viewURL shouldbe 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 {@link com.smartgwt.client.docs.XmlTag <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 {@link com.smartgwt.client.docs.PlatformDependencies} for more information. @see com.smartgwt.client.rpc.RPCRequest#getEvalResult
|
|