|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ujorm.wicket.component.form.FieldProvider<U>
public class FieldProvider<U extends Ujo>
Field Factory
| Field Summary | |
|---|---|
static String |
PASSWORD_KEY_NAME
Password key name to create a component PasswordField |
| Constructor Summary | |
|---|---|
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 |
|
| Method Summary | ||
|---|---|---|
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. |
|
|
add(Key<? super U,T> key)
Add new field to a repeating view |
|
|
add(Key<? super U,T> key,
Class<? extends Field> fieldClass)
Create a field of the required instance and set the result into container. |
|
|
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 |
|
|
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 |
|
|
addValidator(Key<? super U,T> key,
org.apache.wicket.validation.IValidator<T> validator)
Set a visible attribute for a required filed. |
|
|
addValidator(Key<? super U,T> key,
Validator<T> validator)
Add a validator for a required filed. |
|
|
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 Field<?> |
findFirstField()
Find first enabled field with a non-null Key or return the null. |
|
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 |
|
|
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 |
|
|
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. |
|
|
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'. |
|
protected String |
newChildId()
Generates a child component id |
|
void |
onChange(Key<? super U,?> source)
Refresh component |
|
void |
onChange(Key<? super U,?> source,
String action)
Refresh component |
|
void |
requestFocus(org.apache.wicket.ajax.AjaxRequestTarget target)
Set a focus to the first component by default |
|
void |
setDomain(U domain)
Copy domain attributes to fields and clone the arguments to internal parameters. |
|
|
setEnabled(Key<? super U,T> key,
boolean enabled)
Set an enabled attribute for a required filed. |
|
|
setValue(Key<? super U,T> key,
T value)
Set Value |
|
|
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. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PASSWORD_KEY_NAME
| Constructor Detail |
|---|
public FieldProvider(String repeatingViewId)
public FieldProvider(org.apache.wicket.markup.repeater.RepeatingView repeatingView)
public FieldProvider(org.apache.wicket.markup.repeater.RepeatingView repeatingView,
Map<String,Field> fields)
repeatingView - a repeating viewsfields - Serializable field map| Method Detail |
|---|
public void add(Field field)
true.
protected String newChildId()
public <T> void add(Key<? super U,T> key)
public void add(Class<? super U> domainClass)
public void add(KeyList<? super U> fields)
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> T getValue(Key<? super U,T> key)
public <T> void setValue(Key<? super U,T> key,
T value)
public <T> void setValue(Key<? super U,T> key,
T value,
org.apache.wicket.ajax.AjaxRequestTarget target)
public Collection<Field> getFields()
public <F extends Field> F getField(Key<? super U,?> key)
public <T extends Field> T getLast()
throws ArrayIndexOutOfBoundsException
null always
ArrayIndexOutOfBoundsException - No last filed was found.protected Set<String> getKeyNames()
public org.apache.wicket.markup.repeater.RepeatingView getRepeatingView()
protected OrmHandler getOrmHandler()
protected boolean isMandatory(Key<? super U,?> key)
protected void addValidator(Key<? super U,?> key,
Field field)
public void setDomain(U domain)
protected U cloneDomain(U domain,
OrmSessionProvider session)
throws NoSuchElementException,
IllegalStateException
NoSuchElementException
IllegalStateExceptionprotected 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 void onChange(Key<? super U,?> source)
public void onChange(Key<? super U,?> source,
String action)
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)
public <T> void addCssStyle(Key<? super U,T> key,
String cssStyle)
public void requestFocus(@Nonnull
org.apache.wicket.ajax.AjaxRequestTarget target)
@Nullable protected Field<?> findFirstField()
null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||