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
[email protected]

2014-09-17 16:14 GMT-07:00 Илья Нарыжный <[email protected]>:

> 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
>

Reply via email to