public class ScriptableCustomItemComponentRenderAdapter extends CustomItemComponentRenderAdapter
CustomItemComponentRenderAdapter
that will also generate an accompany the component with a Script either in the web page header within the component.scriptComponentId
,
scriptTransformer
,
Serialized FormCustomItemComponentRenderAdapter.ContextualTwoWayTransformer
authorizationModule, modelTransformer
Constructor and Description |
---|
ScriptableCustomItemComponentRenderAdapter() |
ScriptableCustomItemComponentRenderAdapter(ScriptableCustomItemComponentRenderAdapter t) |
Modifier and Type | Method and Description |
---|---|
protected void |
attachScript(org.apache.wicket.Component c,
MetaItem metaItem,
Object modelObject,
User user) |
org.apache.wicket.Component |
getComponent(String componentId,
MetaItem metaItem,
org.apache.wicket.model.IModel rawModel,
Object modelObject,
User user)
Some fields/attribute may require display of options
for selection or Auto-Suggest etc..
|
protected String |
getInstanceId(MetaItem metaItem,
Object modelObject)
Javascript code needs to target its component so each instance will need an instanceId.
|
String |
getScriptComponentId() |
org.apache.commons.collections.Transformer |
getScriptTransformer()
A
Transformer that converts this components state into markup or script and appends it to the component DOM. |
void |
setScriptComponentId(String scriptComponentId) |
void |
setScriptTransformer(org.apache.commons.collections.Transformer scriptTransformer)
A
Transformer that converts this components state into markup or script and appends it to the component DOM. |
filter, getDataList, getLookup, getModelTransformer, markComponentReadOnly, processSubmit, setModelTransformer, translateCurrentSelectionModel
public ScriptableCustomItemComponentRenderAdapter()
public ScriptableCustomItemComponentRenderAdapter(ScriptableCustomItemComponentRenderAdapter t)
protected String getInstanceId(MetaItem metaItem, Object modelObject)
protected void attachScript(org.apache.wicket.Component c, MetaItem metaItem, Object modelObject, User user)
c
- as Component to the final component generated by this Adapterpublic org.apache.wicket.Component getComponent(String componentId, MetaItem metaItem, org.apache.wicket.model.IModel rawModel, Object modelObject, User user)
CustomItemComponentRenderAdapter
HiddenField
getComponent
in class CustomItemComponentRenderAdapter
componentId
- as Sting id for the ComponentmetaItem
- as MetaItem meta data for rendering logicrawModel
- is the current data defined in a IModel
for the MetaItem.
The resultant model in the returned Component may NOT be same as the one passed to the inner component, hence always use the derived one.
This is because there maybe a mismatch in the form of core/raw data and one required for final presentation.
For example the input maybe a Comma Separated list of Strings, however for presentation in a List box we may convert the Model to a ListModel.modelObject
- as Object, that represents the main Entity (overall context)user
- as com.neurosys.security.auth.domain.User for any Authorization related needs @nullable truepublic String getScriptComponentId()
public void setScriptComponentId(String scriptComponentId)
public org.apache.commons.collections.Transformer getScriptTransformer()
Transformer
that converts this components state into markup or script and appends it to the component DOM.
Transformer
takes in a Map is a context which contains the following:
One could you Velocity to render the script using a VelocityTransformerpublic void setScriptTransformer(org.apache.commons.collections.Transformer scriptTransformer)
Transformer
that converts this components state into markup or script and appends it to the component DOM.
Transformer
takes in a Map is a context which contains the following:
One could you Velocity to render the script using a VelocityTransformerCopyright © 2018. All rights reserved.