public class FieldProvider<U extends Ujo> extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static String |
PASSWORD_KEY_NAME
Password key name to create a component PasswordField
|
| Constructor and Description |
|---|
FieldProvider(org.apache.wicket.markup.repeater.RepeatingView repeatingView)
Default constructor with a repeatingView
|
FieldProvider(org.apache.wicket.markup.repeater.RepeatingView repeatingView,
Map<String,Field> fields)
Final constructor
|
FieldProvider(String repeatingViewId)
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Class<? super U> domainClass)
Add all fields of a domain class to the form
|
void |
add(Field field)
Add any field to a repeating view
and set the OutputMarkupPlaceholderTag to value
true. |
<T> void |
add(Key<? super U,T> key)
Add new field to a repeating view
|
<T extends Ujo> |
add(Key<? super U,T> key,
Class<? extends Field> fieldClass)
Create a field of the required instance and set the result into container.
|
<T extends OrmUjo> |
add(Key<? super U,T> key,
Key<T,?> display,
org.ujorm.criterion.Criterion<T> crn)
Add a Combo-box for a
|
void |
add(KeyList<? super U> fields)
Add all fields
|
<T> void |
addCssStyle(Key<? super U,T> key,
String cssStyle)
Add a CSS style to the field of required key.
|
protected void |
addValidator(Key<? super U,?> key,
Field field)
Set a validator of the Key to the Field from argument
|
<T> void |
addValidator(Key<? super U,T> key,
org.apache.wicket.validation.IValidator<T> validator)
Set a visible attribute for a required filed.
|
<T> void |
addValidator(Key<? super U,T> key,
Validator<T> validator)
Add a validator for a required filed.
|
<T> void |
addValidatorUnchecked(Key<? super U,T> key,
Validator validator)
Add a validator for a required filed, where the validator have no generic type.
|
protected U |
cloneDomain(U domain,
OrmSessionProvider session)
Clone the domain object or reload the ORM object from database.
|
protected U |
copyToFields(U domain)
Assign values to required component fields in a transaction for a lazy loading case
|
protected int |
getClonedDepth()
Get a default cloned depth for the method
cloneDomain(org.ujorm.Ujo, org.ujorm.wicket.OrmSessionProvider) |
U |
getDomain()
Copy new value to the result and return the result
|
<F extends Field> |
getField(Key<? super U,?> key)
Returns the related Field
|
Collection<Field> |
getFields()
Return all fields
|
U |
getInputDomain()
Get original domain
|
protected Set<String> |
getKeyNames()
Return all keys in a String format
|
<T extends Field> |
getLast()
Returns the last field or throw an exception
|
protected OrmHandler |
getOrmHandler()
Returns OrmHandler
|
org.apache.wicket.markup.repeater.RepeatingView |
getRepeatingView()
Returns the repeating view
|
int |
getTextAreaLimit()
Returns a minimal text length to create a TextArea component.
|
<T> T |
getValue(Key<? super U,T> key)
Get Value, or returns a default value
|
protected boolean |
isMandatory(Key<? super U,?> key)
Is the key mandatory ?
|
protected boolean |
isPasswordKey(Key<? super U,?> key)
Is the key type of PasswordField ?
The default condition is: the last key name must be 'PASSWORD'.
|
void |
onChange(Key<? super U,?> source)
Refresh component
|
void |
onChange(Key<? super U,?> source,
String action)
Refresh component
|
void |
setDomain(U domain)
Copy domain attributes to fields and clone the arguments to internal parameters.
|
<T> void |
setEnabled(Key<? super U,T> key,
boolean enabled)
Set an enabled attribute for a required filed.
|
<T> void |
setValue(Key<? super U,T> key,
T value)
Set Value
|
<T> void |
setValue(Key<? super U,T> key,
T value,
org.apache.wicket.ajax.AjaxRequestTarget target)
Set Value and repaint the component
|
void |
setVisible(Key<? super U,?> key,
boolean visible)
Set a visible attribute for a required filed.
|
public static final String PASSWORD_KEY_NAME
public FieldProvider(String repeatingViewId)
public FieldProvider(org.apache.wicket.markup.repeater.RepeatingView repeatingView)
public void add(Field field)
true.public <T extends Ujo> void add(Key<? super U,T> key, Class<? extends Field> fieldClass)
T - Ujo typekey - Related KeyfieldClass - Class must have got a one argument constructor type of Key.public <T extends OrmUjo> void add(Key<? super U,T> key, Key<T,?> display, org.ujorm.criterion.Criterion<T> crn)
public <T> void setValue(Key<? super U,T> key, T value, org.apache.wicket.ajax.AjaxRequestTarget target)
public Collection<Field> getFields()
public <T extends Field> T getLast() throws ArrayIndexOutOfBoundsException
null alwaysArrayIndexOutOfBoundsException - No last filed was found.public org.apache.wicket.markup.repeater.RepeatingView getRepeatingView()
protected OrmHandler getOrmHandler()
protected void addValidator(Key<? super U,?> key, Field field)
public void setDomain(U domain)
protected U cloneDomain(U domain, OrmSessionProvider session) throws NoSuchElementException, IllegalStateException
protected int getClonedDepth()
cloneDomain(org.ujorm.Ujo, org.ujorm.wicket.OrmSessionProvider)protected U copyToFields(U domain)
public U getDomain()
public U getInputDomain()
public int getTextAreaLimit()
protected boolean isPasswordKey(Key<? super U,?> key)
public <T> void setEnabled(Key<? super U,T> key, boolean enabled)
public void setVisible(Key<? super U,?> key, boolean visible)
public <T> void addValidator(Key<? super U,T> key, Validator<T> validator)
public <T> void addValidatorUnchecked(Key<? super U,T> key, Validator validator)
#setValidator(org.ujorm.Key, org.ujorm.Validator)public <T> void addValidator(Key<? super U,T> key, org.apache.wicket.validation.IValidator<T> validator)
Copyright © 2014. All Rights Reserved.