|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hivemind.impl.BaseLocatable org.apache.tapestry.AbstractComponent org.apache.tapestry.dojo.AbstractWidget net.sf.tacos.components.dojo.GenericWidget net.sf.tacos.components.dojo.DojoWidget
public abstract class DojoWidget
Implementation of any dojo widget as a tapestry component.
The formal parameter dojoType
is used to determine which dojo widget to create.
Informal parameters are used as javascript properties to create widget with.
Please have a look into the http://dojotoolkit.org/api
for further information about the widget properties. A simple example is the dojo Clock widget:
<div jwcid="@dojo:Widget" dojoType="Clock" timeZoneOffset="5" labelColor="#fff"/>
The formal parameter isContainer
allows a widget to have children.
All the widgets within the body of a container are added as childs. For example dojo tabs:
<div jwcid="@dojo:Widget" dojoType="TabContainer" isContainer="true"> <div jwcid="@dojo:Widget" dojoType="ContentPane" label="Athens">Athens</div> <div jwcid="@dojo:Widget" dojoType="ContentPane" label="Moscow">Moscow</div> </div>
DojoWidget allows you to connect any client side event to a listener method. Please see the dojo api for further information about the events fired by the particular widget. To connect a client side even just use the informal parameter with the corresponding name. For example, specifying a component definition such as:
<div jwcid="@dojo:Widget" dojoType="..." onClick="listener:onClick" onMouseDown="listener:onMouseDown"/>
It's possible to specify a list of events for which to generate non async requests specifying the dojo events list in the noAsync parameter as a comma separated list. This is particularly useful with menu/button widget that most of the times need normal requests to be generated.
<div jwcid="@dojo:Widget" dojoType="MenuItem2" onClick="listener:onMenuClick" noAsync="onClick"/>Furthermore it is poossible to connect a client side event to a javascript function. For this purpose use the prefix
callback
. For example:
<div jwcid="@dojo:Widget" dojoType="SliderHorizontal" onValueChanged="callback:sliderCallback"/>
Whereby sliderCallback
is a javascript function:
function sliderCallback(value) { alert(value); }
Field Summary | |
---|---|
static String |
CONTAINER_ATTRIBUTE
|
Fields inherited from class org.apache.tapestry.AbstractComponent |
---|
_body, _bodyCount |
Constructor Summary | |
---|---|
DojoWidget()
|
Method Summary | |
---|---|
void |
addChild(org.apache.tapestry.dojo.IWidget widget)
Adds a child IWidget to a container. |
Map |
getAsyncListenerBindings()
Returns a Map of the bindings implementing
the IActionListener interface for which
to generate async requests. |
protected Map |
getBindingsByClass(Collection names,
Class clazz)
Filters the Map of the bindings of the component
and returns a Map of bindings the specified Class parameter
is assignable from. |
Map |
getCallbackBindings()
Returns a Map of the bindings implementing
the ICallbackFunction interface. |
abstract List |
getChildren()
Returns a list of children widgetIds. |
boolean |
getContainerState()
If the current component is a container. |
abstract String |
getDojoType()
Returns the type of the dojo widget |
abstract org.apache.tapestry.engine.IEngineService |
getEngine()
Injected engine service . |
Map |
getListenerBindings()
Returns a Map of the bindings implementing
the IActionListener interface for which to
generate non async requests. |
abstract org.apache.tapestry.listener.ListenerInvoker |
getListenerInvoker()
Injected listener invoker. |
abstract String |
getNoAsync()
Returns widget events for which to generate no async requests |
String |
getNoAsyncEventUrl(String eventName)
Returns the url to use for a non async event |
abstract Object |
getParameters()
Returns listener parameters |
abstract org.apache.tapestry.IScript |
getScript()
Injected script. |
abstract String |
getStyle()
Returns the style. |
void |
renderWidget(org.apache.tapestry.IMarkupWriter writer,
org.apache.tapestry.IRequestCycle cycle)
|
void |
trigger(org.apache.tapestry.IRequestCycle cycle)
Invoked by the direct service to trigger the application-specific action by notifying the listener . |
Methods inherited from class net.sf.tacos.components.dojo.GenericWidget |
---|
getIsContainer, getNeverDestroy, renderComponent |
Methods inherited from class org.apache.tapestry.dojo.AbstractWidget |
---|
getDestroy, setDestroy |
Methods inherited from class org.apache.tapestry.AbstractComponent |
---|
addAsset, addBody, addComponent, checkActiveLock, cleanupAfterRender, enterActiveState, equals, finishLoad, finishLoad, generateClientId, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getBoundId, getClientId, getComponent, getComponents, getContainedComponent, getContainedRenderers, getContainer, getEventInvoker, getExtendedId, getId, getIdPath, getInnerRenderers, getListeners, getMessages, getNamespace, getPage, getRenderWorker, getSpecification, getSpecifiedId, getTemplateTagName, hasEvents, hashCode, isInActiveState, isParameterBound, isRendering, isStateful, pageEndRender, peekClientId, prepareForRender, render, renderBody, renderIdAttribute, renderInformalParameters, setBinding, setClientId, setContainedComponent, setContainer, setHasEvents, setId, setNamespace, setPage, setTemplateTagName, toString, triggerEvent |
Methods inherited from class org.apache.hivemind.impl.BaseLocatable |
---|
getLocation, setLocation |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.tapestry.IDirect |
---|
isStateful |
Methods inherited from interface org.apache.tapestry.IComponent |
---|
addAsset, addBody, addComponent, enterActiveState, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getClientId, getComponent, getComponents, getContainedComponent, getContainer, getEventInvoker, getExtendedId, getId, getIdPath, getListeners, getMessages, getNamespace, getPage, getSpecification, getSpecifiedId, getTemplateTagName, isRendering, peekClientId, renderBody, setBinding, setClientId, setContainedComponent, setContainer, setId, setNamespace, setPage, setTemplateTagName |
Methods inherited from interface org.apache.tapestry.IRender |
---|
render |
Methods inherited from interface org.apache.hivemind.LocationHolder |
---|
setLocation |
Methods inherited from interface org.apache.hivemind.Locatable |
---|
getLocation |
Methods inherited from interface org.apache.tapestry.IDynamicInvoker |
---|
getUpdateComponents, isAsync, isJson |
Methods inherited from interface org.apache.tapestry.IDirectEvent |
---|
isStateful, triggerEvent |
Field Detail |
---|
public static final String CONTAINER_ATTRIBUTE
Constructor Detail |
---|
public DojoWidget()
Method Detail |
---|
public boolean getContainerState()
getContainerState
in class GenericWidget
public void renderWidget(org.apache.tapestry.IMarkupWriter writer, org.apache.tapestry.IRequestCycle cycle)
renderWidget
in interface org.apache.tapestry.dojo.IWidget
public void addChild(org.apache.tapestry.dojo.IWidget widget)
IWidget
to a container.
addChild
in interface IDojoContainer
widget
- child to addpublic Map getListenerBindings()
Map
of the bindings
implementing
the IActionListener
interface for which to
generate non async requests.
public Map getAsyncListenerBindings()
Map
of the bindings
implementing
the IActionListener
interface for which
to generate async requests.
public Map getCallbackBindings()
Map
of the bindings
implementing
the ICallbackFunction
interface.
protected Map getBindingsByClass(Collection names, Class clazz)
Map
of the bindings
of the component
and returns a Map
of bindings
the specified Class parameter
is assignable from.
names
- names of the bindingsclazz
- class to determine if it is assignable from the bindingspublic String getNoAsyncEventUrl(String eventName)
public void trigger(org.apache.tapestry.IRequestCycle cycle)
listener
.
trigger
in interface org.apache.tapestry.IDirect
public abstract org.apache.tapestry.IScript getScript()
public abstract org.apache.tapestry.engine.IEngineService getEngine()
public abstract org.apache.tapestry.listener.ListenerInvoker getListenerInvoker()
public abstract String getStyle()
public abstract String getDojoType()
public abstract Object getParameters()
public abstract String getNoAsync()
public abstract List getChildren()
GenericWidget.getIsContainer()
returns false
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |