Ok, I thought the validation happens before the conversion. So the
converter must also validate the raw input. Feels a little bit strange
but is ok.
Complains meens that I get the following exception message:
Component [cripsFld] (path =
[14:panel:formular:formGroup4Crips:formGroup4Crips_body:cripsFld]) must
be applied to a tag of type [input], not: '<textarea
class="form-control" id="cripsFld" wicket:id="cripsFld" style="resize:
none" placeholder="List of CRIP addresses" autocomplete="off">' (line 0,
column 0)
Oliver
Am 28.05.14 15:23, schrieb Sven Meier:
Hi,
Wicket calls validators after conversion, thus if you have
TextArea<Collection<String>>, your validator has to be
IValidator<Collection<String>>.
Let your CripBlockConverter do the format checking, I don't see the need
for your converter.
>But now Wicket complains
'Complains' means what?
Sven
On 05/28/2014 03:20 PM, Oliver B. Fischer wrote:
I solved now this problem by subclassing TextArea and over-writing
convertInput().
But now Wicket complains if I reference this field as <textarea ...>
in my HTML template. I must declare it as <input...> but I need a
<textarea/>
Does someone know how to achive this?
Bye,
Oliver
Am 28.05.14 14:27, schrieb Oliver B. Fischer:
Hi,
I use a |TextArea| component in a form so that users can enter a set of
IP addresses. The target model is of type |Collection<String>|. I have
written a validator to validate the raw user input an a converter to
convert the string input into a collection of strings
(|Collection<String>|).
Now I cannot set the model for the used |TextArea| instance it has a
different object type then |String|.
Any idea how to handle this?
|public class MyForm<FormModel>
{
private final TextArea<String> cripField;
}
// The validator is validating the raw string
public class CripBlockValidator implements IValidator<String>
{/*...*/}
// The converter coverts the string input into a subtype of List<String>
public class CripBlockConverter extends AbstractConverter<IPList>
{/*...*/}
|
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]