T - as input Type to the whole processpublic class SimpleDynamicFieldsRenderAdapter<T> extends Object implements CustomTemplateRenderAdapter<T,org.apache.wicket.model.IModel,org.apache.wicket.Component,org.apache.wicket.MarkupContainer>
CustomTemplateRenderAdapter.Nothingnothing| Constructor and Description |
|---|
SimpleDynamicFieldsRenderAdapter() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.wicket.Component |
getComponentForType(MetaItem metaItem,
String fieldComponentName,
org.apache.wicket.model.IModel model,
org.apache.wicket.MarkupContainer container,
T modelObject,
User user)
One can override to customize specific components or impose some manual override over what is dynamically
generated.
|
String |
getItemRefId(MetaItem metaItem)
When rendering Items, for Feedback we may want to target
messages to sections in the form.
|
Object |
processItem(T entity,
MetaItem metaItem,
org.apache.wicket.Component coreEntityDataField,
User user,
Object... contextParams)
For each meta item handle processing on submit and derive the value to be submitted/persisted back
|
void |
reset()
During Ajax calls a Render Adapter maybe called multiple times.
|
public org.apache.wicket.Component getComponentForType(MetaItem metaItem, String fieldComponentName, org.apache.wicket.model.IModel model, org.apache.wicket.MarkupContainer container, T modelObject, User user)
Field and ContentFacetMeta
exist then ContentFacetMeta is given preference as it is defined by Config in a Template
StaticImageComponent - Renders the image and the ability to upload a new oneHiddenField - A reference to some values. the values can be derived from other input support defined on the UI.HiddenField - Supports an array of comma separated values (Strings)HiddenField - If an Object is being used then it will be marshaled/serialized into JSON format automatically and processed as such.HiddenField - If an Array of Object(s) is being used then it will be marshaled/serialized into JSON format automatically and processed as such.
Usage Sample :
<wicket:panel>
<tr wicket:id="items">
<td><span wicket:id="fieldName" /><div wicket:id="feedback" style='background-color:#EEEEEE'></div></td>
<td><div wicket:id="productField"></div></td>
</tr>
<!-- Specific complex types -->
<wicket:fragment wicket:id="REF_colors">
Color(s): -- Deprecated, colors now ARRAY type
<input wicket:id="input" type='hidden' />
</wicket:fragment>
<wicket:fragment wicket:id="ARRAY_colors">
Color(s):
<input wicket:id="input" type='hidden' />
</wicket:fragment>
<wicket:fragment wicket:id="JSON_size">
Size:
<input wicket:id="input" type='hidden' />
</wicket:fragment>
<wicket:fragment wicket:id="JSON_ARRAY_relatedGroups">
Related Groups:
<input wicket:id="input" type='hidden' />
</wicket:fragment>
</wicket:panel>
getComponentForType in interface CustomTemplateRenderAdapter<T,org.apache.wicket.model.IModel,org.apache.wicket.Component,org.apache.wicket.MarkupContainer>metaItem - as MetaItemfieldComponentName - as the rendering fieldComponentName or Id (of the component to be created)model - as MODEL of the value extracted from the original modelObject for the MetaItem.
This is a variable that would typically be extracted from the modeObject using the MetaItem,
however there is complex logic that can vary and hence is expected to be provided to this method.container - as CONTAINER_COMPONENT containing the produced componentmodelObject - as the core domain Object/Entityuser - as com.neurosys.security.auth.domain.User for any Authorization related needs @nullable trueProductDetailsTemplatePanel#getComponentForType(MetaItem, String, MODEL, CONTAINER_COMPONENT, com.neurosys.products.domain.Product)public Object processItem(T entity, MetaItem metaItem, org.apache.wicket.Component coreEntityDataField, User user, Object... contextParams) throws Exception
CustomTemplateRenderAdapterprocessItem in interface CustomTemplateRenderAdapter<T,org.apache.wicket.model.IModel,org.apache.wicket.Component,org.apache.wicket.MarkupContainer>CustomTemplateRenderAdapter.Nothing (nothing). Nothing should not be persisted or used, it implies it should be ignored.Exceptionpublic String getItemRefId(MetaItem metaItem)
CustomTemplateRenderAdapterMetaItemgetItemRefId in interface CustomTemplateRenderAdapter<T,org.apache.wicket.model.IModel,org.apache.wicket.Component,org.apache.wicket.MarkupContainer>metaItem - as MetaItempublic void reset()
CustomTemplateRenderAdapterreset in interface CustomTemplateRenderAdapter<T,org.apache.wicket.model.IModel,org.apache.wicket.Component,org.apache.wicket.MarkupContainer>Copyright © 2018. All rights reserved.