public abstract class BindableView<T> extends View
<v:view dataObject="MyDataObject"></gwt:textBox id="textBox1" dataBind="property1.innerProperty"></v:view>
You must annotate your Data Object with DataObject annotation.
@DataObject("MyDataObject")
public class MyDTO
{
...//getters and setters
}
And you can access your BindableView through ViewAccessor.
public interface Views extends ViewAccessor
{
BindableView myViewId();
}
| Modifier and Type | Class and Description |
|---|---|
static interface |
BindableView.PropertyBinder<T>
Interface for data binding between dataObjects and widgets in this view.
|
View.RenderCallback| Modifier and Type | Field and Description |
|---|---|
protected FastMap<BindableView.PropertyBinder<T>> |
binders |
active, attachHandlers, dataBindingHandler, detachHandlers, height, historyHandlers, lazyWidgets, loaded, loadHandlers, orientationHandlers, resizeHandlers, unloadHandlers, widgets, width, windowCloseHandlers, windowClosingHandlers| Constructor and Description |
|---|
BindableView(String id) |
| Modifier and Type | Method and Description |
|---|---|
void |
addWidget(String id,
com.google.gwt.user.client.ui.IsWidget widget,
BindableView.PropertyBinder<T> binder)
Add a widget to this view and use the given binder to bound it with target dataObjet
|
protected abstract T |
createDataObject()
Used by Crux to instantiate target data object
|
T |
getData()
Retrieve a DataObject instance, filled with data received from the widgets on this view.
|
void |
removeWidget(String id,
boolean removeFromDOM)
Removes the given widget from this view.
|
void |
setData(T dataObject)
Update bound widgets on this view with dataObject information
|
addDataObjectBinder, addResizeHandler, addResource, addToHistory, addToHistory, addViewActivateHandler, addViewDeactivateHandler, addViewLoadHandler, addViewUnloadHandler, addWidget, addWidget, addWindowCloseHandler, addWindowClosingHandler, addWindowHistoryChangedHandler, addWindowOrientationChangeHandler, checkRuntimeLazyDependency, cleanLazyDependentWidgets, clearViewObjects, containsResource, containsWidget, copyTo, createDataSource, createWidgets, fireHistoryChangeEvent, fireLoadEvent, fireOrientationEvent, fireResizeEvent, fireUnloadEvent, fireWindowCloseEvent, fireWindowClosingEvent, getContainer, getController, getDataObjectBinder, getDataObjectBinder, getHeight, getId, getIocContainer, getPrefix, getRegisteredControllers, getResource, getTitle, getView, getViewPanel, getWidget, getWidget, getWidget, getWidth, hasHistoryHandlers, hasOrientationChangeHandlers, hasResizeHandlers, hasWindowCloseHandlers, hasWindowClosingHandlers, initializeLazyDependencies, initializeLazyDependentWidget, isActive, isLoaded, isOrientationChangeSupported, listWidgets, listWidgetsId, load, of, prepareViewObjects, read, read, registerDataObjectBinders, registerLoadedView, removeFromContainer, removeWidget, render, setActive, setContainer, setDeactivated, setHeight, setTitle, setWidth, unload, unregisterLoadedView, updateViewHeight, updateViewWidth, widgetsIdList, widgetsList, write, writeAllprotected FastMap<BindableView.PropertyBinder<T>> binders
public BindableView(String id)
id - protected abstract T createDataObject()
public T getData()
public void setData(T dataObject)
dataObject - public void addWidget(String id, com.google.gwt.user.client.ui.IsWidget widget, BindableView.PropertyBinder<T> binder)
id - widget - binder - public void removeWidget(String id, boolean removeFromDOM)
ViewremoveWidget in class Viewid - widget identifierremoveFromDOM - if true, also removes the widget from this parent widgetCopyright © 2015. All rights reserved.