public class SelectRenderAdapter extends CustomItemComponentRenderAdapter
Select
(single or multi-select depends on the ContentType
in MetaItem
)
Select
markup; typically this has a wicket:id="SELECT", you can specify this by something like this in MyDetailsTemplatePanel which is assumed to have a Fragment by the id SELECT defined in it:
<property name="attributes"><map> <entry key="#
{T(com.neurosys.template.model.renderadapters.DefaultWicketTemplateRenderAdapter).ATTRIB_FRAGMENT_ID" value="SELECT" /></map></property>
example 1:
<bean class="com.neurosys.template.model.FacetMeta">
<property name="name" value="1" />
<property name="displayName" value=" or Payment Method" />
<property name="type" value="SELECT" /> <!-- Ensure it picks the SELECT type fragment for Display; if not provided will default to CUSTOM_1 -->
<property name="displayTransformer"><bean class="com.neurosys.etl.common.transformers.RegexReplaceTransformer"> <!-- If scripts are embedded using <script> then replace them -->
<property name="regex"><value><![CDATA[#
{T(java.util.regex.Pattern).compile('_')}]]>
#{T(com.neurosys.ecom.orders.domain.PaymentMethod).ONLINE_SERVICE_PROVIDER}{@code
}
example 2:
{@code
% of Sub Total
Absolute
}
example 3:
{@code
#{T(com.neurosys.ecom.orders.domain.OrderStatus).REQUESTED}{@code
#{T(com.neurosys.ecom.orders.domain.OrderStatus).REMIND_USER_TO_PROCEED}{@code
#{T(com.neurosys.ecom.orders.domain.OrderStatus).FAILED_TRANSACTION_COMPLETE}{@code
#{T(com.neurosys.ecom.orders.domain.OrderStatus).FAILED_TRANSACTION_ERROR}{@code
#{T(com.neurosys.ecom.orders.domain.OrderStatus).IN_PROCESS}{@code
#{T(com.neurosys.ecom.orders.domain.OrderStatus).PLACED_AUTO}{@code
#{T(com.neurosys.ecom.orders.domain.OrderStatus).OFFLINE}{@code
}
ProductDetailsTemplatePanel, {@link ContentDetailsTemplatePanel} etc.
,
Serialized FormCustomItemComponentRenderAdapter.ContextualTwoWayTransformer
authorizationModule, modelTransformer
Constructor and Description |
---|
SelectRenderAdapter() |
SelectRenderAdapter(SelectRenderAdapter t) |
Modifier and Type | Method and Description |
---|---|
org.apache.wicket.Component |
getComponent(String componentId,
MetaItem metaItem,
org.apache.wicket.model.IModel currentDefaultSelectionIds,
Object modelObject,
User user)
Some fields/attribute may require display of options
for selection or Auto-Suggest etc..
|
boolean |
isRemoveNoSelectionOption()
If true will remove default
AbstractSingleSelectChoice .NO_SELECTION_VALUE option. |
protected void |
markComponentReadOnly(org.apache.wicket.Component c) |
void |
setRemoveNoSelectionOption(boolean removeNoSelectionOption)
If true will remove default
AbstractSingleSelectChoice .NO_SELECTION_VALUE option. |
filter, getDataList, getLookup, getModelTransformer, processSubmit, setModelTransformer, translateCurrentSelectionModel
public SelectRenderAdapter()
public SelectRenderAdapter(SelectRenderAdapter t)
protected void markComponentReadOnly(org.apache.wicket.Component c)
markComponentReadOnly
in class CustomItemComponentRenderAdapter
public org.apache.wicket.Component getComponent(String componentId, MetaItem metaItem, org.apache.wicket.model.IModel currentDefaultSelectionIds, Object modelObject, User user)
HiddenField
Some fields/attribute may require display of options
for selection or Auto-Suggest etc..
HiddenField
getComponent
in class CustomItemComponentRenderAdapter
componentId
- as Sting id for the ComponentmetaItem
- as MetaItem meta data for rendering logiccurrentDefaultSelectionIds
- 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 boolean isRemoveNoSelectionOption()
AbstractSingleSelectChoice
.NO_SELECTION_VALUE option.public void setRemoveNoSelectionOption(boolean removeNoSelectionOption)
AbstractSingleSelectChoice
.NO_SELECTION_VALUE option.Copyright © 2018. All rights reserved.