You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Илья Нарыжный <ph...@ydn.ru> on 2014/09/18 01:14:41 UTC
Please make FormComponent.convertInput() public
Guys,
Please consider making of FormComponent.convertInput() public.
I have following situation:
By ajax I should send whole form to server side. defaultProcessing=false,
but during processing I should know actual entered value to a specific
component.
Once that mentod is protected - it can't be done without "hacks".
P.S. Are you accepting Pull Ruquests on github.com?
Thanks,
Ilia
Re: Please make FormComponent.convertInput() public
Posted by Martin Grigorov <mg...@apache.org>.
Related - http://markmail.org/message/5alfu36fgivzp2dt.
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Fri, Sep 19, 2014 at 1:45 PM, Andrea Del Bene <an...@gmail.com>
wrote:
> If I understand correctly you submit form disabling default processing. In
> this way Wicket retains fields value without validating them but also
> without converting input. But you also need to convert the input value of
> the desired field. Right? I guess you have to do it because raw input is
> not enough for you.
> You should open an improvement issue on Jira (https://issues.apache.org/
> jira/browse/WICKET) to discuss this change.
>
> Thank you.
>
> Guys,
>>
>> My intent is following:
>> Some form components should be shown or hiden dynamically according to
>> entered information and(!!!) without touching underling models. Whole form
>> content should be refreshed.
>> To achive that I use following approach:
>> 1) AjaxFormSubmitBehavior with event="change" to recieve form on server
>> side
>> 2) With the aid of FormComponent.hasRawInput() I can understand where to
>> get actual value for the component: either by
>> convertInput()->getConvertedInput() or directly from a model.
>> 3) [HACK] if value should be taken from form component with the aid of
>> reflection I'm invoking convertInput()
>> Method convertInputMethod =
>> FormComponent.class.getDeclaredMethod("convertInput");
>> convertInputMethod.setAccessible(true);
>> convertInputMethod.invoke(formComponent);
>>
>> I can't use "validate" because there are some validators on a components
>> and they should be fired after actual data submition.
>>
>> Currently, whole that stack is working perfectly as expected. But that
>> little hack is confusing me a bit:)
>>
>> P.S. Sorry for sending that in parallel: can't subscribe for
>> dev@wicket.apache.org
>>
>> 2014-09-17 16:14 GMT-07:00 Илья Нарыжный <ph...@ydn.ru>:
>>
>> Guys,
>>>
>>> Please consider making of FormComponent.convertInput() public.
>>> I have following situation:
>>> By ajax I should send whole form to server side. defaultProcessing=false,
>>> but during processing I should know actual entered value to a specific
>>> component.
>>> Once that mentod is protected - it can't be done without "hacks".
>>>
>>> P.S. Are you accepting Pull Ruquests on github.com?
>>>
>>> Thanks,
>>>
>>> Ilia
>>>
>>>
>
Re: Please make FormComponent.convertInput() public
Posted by Andrea Del Bene <an...@gmail.com>.
If I understand correctly you submit form disabling default processing.
In this way Wicket retains fields value without validating them but also
without converting input. But you also need to convert the input value
of the desired field. Right? I guess you have to do it because raw input
is not enough for you.
You should open an improvement issue on Jira
(https://issues.apache.org/jira/browse/WICKET) to discuss this change.
Thank you.
> Guys,
>
> My intent is following:
> Some form components should be shown or hiden dynamically according to
> entered information and(!!!) without touching underling models. Whole form
> content should be refreshed.
> To achive that I use following approach:
> 1) AjaxFormSubmitBehavior with event="change" to recieve form on server side
> 2) With the aid of FormComponent.hasRawInput() I can understand where to
> get actual value for the component: either by
> convertInput()->getConvertedInput() or directly from a model.
> 3) [HACK] if value should be taken from form component with the aid of
> reflection I'm invoking convertInput()
> Method convertInputMethod =
> FormComponent.class.getDeclaredMethod("convertInput");
> convertInputMethod.setAccessible(true);
> convertInputMethod.invoke(formComponent);
>
> I can't use "validate" because there are some validators on a components
> and they should be fired after actual data submition.
>
> Currently, whole that stack is working perfectly as expected. But that
> little hack is confusing me a bit:)
>
> P.S. Sorry for sending that in parallel: can't subscribe for
> dev@wicket.apache.org
>
> 2014-09-17 16:14 GMT-07:00 Илья Нарыжный <ph...@ydn.ru>:
>
>> Guys,
>>
>> Please consider making of FormComponent.convertInput() public.
>> I have following situation:
>> By ajax I should send whole form to server side. defaultProcessing=false,
>> but during processing I should know actual entered value to a specific
>> component.
>> Once that mentod is protected - it can't be done without "hacks".
>>
>> P.S. Are you accepting Pull Ruquests on github.com?
>>
>> Thanks,
>>
>> Ilia
>>
Re: Please make FormComponent.convertInput() public
Posted by Илья Нарыжный <ph...@ydn.ru>.
Guys,
My intent is following:
Some form components should be shown or hiden dynamically according to
entered information and(!!!) without touching underling models. Whole form
content should be refreshed.
To achive that I use following approach:
1) AjaxFormSubmitBehavior with event="change" to recieve form on server side
2) With the aid of FormComponent.hasRawInput() I can understand where to
get actual value for the component: either by
convertInput()->getConvertedInput() or directly from a model.
3) [HACK] if value should be taken from form component with the aid of
reflection I'm invoking convertInput()
Method convertInputMethod =
FormComponent.class.getDeclaredMethod("convertInput");
convertInputMethod.setAccessible(true);
convertInputMethod.invoke(formComponent);
I can't use "validate" because there are some validators on a components
and they should be fired after actual data submition.
Currently, whole that stack is working perfectly as expected. But that
little hack is confusing me a bit:)
P.S. Sorry for sending that in parallel: can't subscribe for
dev@wicket.apache.org
2014-09-17 16:14 GMT-07:00 Илья Нарыжный <ph...@ydn.ru>:
> Guys,
>
> Please consider making of FormComponent.convertInput() public.
> I have following situation:
> By ajax I should send whole form to server side. defaultProcessing=false,
> but during processing I should know actual entered value to a specific
> component.
> Once that mentod is protected - it can't be done without "hacks".
>
> P.S. Are you accepting Pull Ruquests on github.com?
>
> Thanks,
>
> Ilia
>
Re: Please make FormComponent.convertInput() public
Posted by Sven Meier <sv...@meiers.net>.
Hi,
you'll have to give us more information on what you're trying to do,
before we can decide API changes.
Regards
Sven
On 09/18/2014 01:14 AM, Илья Нарыжный wrote:
> Guys,
>
> Please consider making of FormComponent.convertInput() public.
> I have following situation:
> By ajax I should send whole form to server side. defaultProcessing=false,
> but during processing I should know actual entered value to a specific
> component.
> Once that mentod is protected - it can't be done without "hacks".
>
> P.S. Are you accepting Pull Ruquests on github.com?
>
> Thanks,
>
> Ilia
>
Re: Please make FormComponent.convertInput() public
Posted by Andrea Del Bene <an...@gmail.com>.
Hi,
which kind of hack are you using? Behavior
AjaxFormComponentUpdatingBehavior does a similar thing. It uses the
following code:
formComponent.inputChanged();
formComponent.validate();
then you can call formComponent.getConvertedValue() to get current value
if validation succeeded.
> Guys,
>
> Please consider making of FormComponent.convertInput() public.
> I have following situation:
> By ajax I should send whole form to server side. defaultProcessing=false,
> but during processing I should know actual entered value to a specific
> component.
> Once that mentod is protected - it can't be done without "hacks".
>
> P.S. Are you accepting Pull Ruquests on github.com?
>
> Thanks,
>
> Ilia
>