|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cruxframework.crux.core.client.screen.views.View
org.cruxframework.crux.core.client.screen.views.BindableView<T>
public abstract class BindableView<T>
BindableViews are Views that support data binding to given data objects. You can define a BindableView using the dataObject attribute on view declaration.
<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();
}
| Nested Class Summary | |
|---|---|
static interface |
BindableView.PropertyBinder<T>
Interface for data binding between dataObjects and widgets in this view. |
| Nested classes/interfaces inherited from class org.cruxframework.crux.core.client.screen.views.View |
|---|
View.RenderCallback |
| Field Summary | |
|---|---|
protected FastMap<BindableView.PropertyBinder<T>> |
binders
|
| Fields inherited from class org.cruxframework.crux.core.client.screen.views.View |
|---|
active, attachHandlers, detachHandlers, height, historyHandlers, lazyWidgets, loaded, loadHandlers, orientationHandlers, resizeHandlers, unloadHandlers, widgets, width, windowCloseHandlers, windowClosingHandlers |
| Constructor Summary | |
|---|---|
BindableView(String id)
|
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected FastMap<BindableView.PropertyBinder<T>> binders
| Constructor Detail |
|---|
public BindableView(String id)
id - | Method Detail |
|---|
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)
View
removeWidget in class Viewid - widget identifierremoveFromDOM - if true, also removes the widget from this parent widget
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||