public class JSONRenderAdapter extends MapRenderAdapter<net.sf.json.JSONObject>
MapRenderAdapter
CustomItemComponentRenderAdapter.ContextualTwoWayTransformer
entityTemplate
authorizationModule, modelTransformer
Constructor and Description |
---|
JSONRenderAdapter()
|
JSONRenderAdapter(JSONRenderAdapter t) |
Modifier and Type | Method and Description |
---|---|
org.apache.wicket.Component |
getComponent(String componentId,
MetaItem metaItem,
org.apache.wicket.model.IModel defaultInputModel,
Object modelObject,
User user)
Some fields/attribute may require display of options
for selection or Auto-Suggest etc..
|
protected net.sf.json.JSONObject |
getMapInstance() |
protected void |
init() |
boolean |
isMerge()
If true it will Scan the entity object for existing changes in data model and merge the current field JSON with that.
JSON tends to be fluid with multiple attributes being re-used across or littered across form. |
void |
setMerge(boolean merge)
If true it will Scan the entity object for existing changes in data model and merge the current field JSON with that.
JSON tends to be fluid with multiple attributes being re-used across or littered across form. |
getEntityTemplate, populateItem, setEntityTemplate
filter, getDataList, getLookup, getModelTransformer, markComponentReadOnly, processSubmit, setModelTransformer, translateCurrentSelectionModel
public JSONRenderAdapter()
public JSONRenderAdapter(JSONRenderAdapter t)
protected void init()
public org.apache.wicket.Component getComponent(String componentId, MetaItem metaItem, org.apache.wicket.model.IModel defaultInputModel, Object modelObject, User user)
MapRenderAdapter
HiddenField
Expect the modelObject as JSONObject
and make a ListView
of all the key, value pairs.getComponent
in class MapRenderAdapter<net.sf.json.JSONObject>
componentId
- as Sting id for the ComponentmetaItem
- as MetaItem meta data for rendering logicdefaultInputModel
- 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 trueprotected net.sf.json.JSONObject getMapInstance()
getMapInstance
in class MapRenderAdapter<net.sf.json.JSONObject>
public boolean isMerge()
public void setMerge(boolean merge)
Copyright © 2018. All rights reserved.