You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by lucast <lu...@hotmail.com> on 2014/02/14 18:14:00 UTC

getting values from FormComponentPanel outside form.onSubmit()

Dear forum,

I have implemented a FormComponentPanel as suggested both in the Apache
Wicket Cookbook (chapter 2) and  wicket guide (chapter 12.8)
<http://wicket.apache.org/guide/guide/forms2.html#forms2_8>  .

Before I submit the form, I would like to have the option of adding the
content from FormComponentPanel to a list.

I have made use of AjaxButton and  I have set 
AjaxButton.setDefaultFormProcessing( false).

In order to get value from FormComponentPanel when performing 
form.onSubmit(), one calls FormComponentPanel.getConvertedInput(), which in
turns calls FormComponentPanel.convertInput().

The problem is that if I call FormComponentPanel.getConvertedInput() from
inside AjaxButton.onSubmit(), FormComponentPanel.convertInput() is never
called.

My question is, how can I get the contents from FormComponentPanel using a
AjaxSubmitLink or AjaxButton without having to go via form.onSubmit()?

Is there, perhaps another form component that I could use to achieve my
goal?

Thanks in advance,
Lucas

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/getting-values-from-FormComponentPanel-outside-form-onSubmit-tp4664462.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: getting values from FormComponentPanel outside form.onSubmit()

Posted by Sven Meier <sv...@meiers.net>.
>FormComponentPanel.getConvertedInput(), which in turns calls FormComponentPanel.convertInput().

Not true.

See FormComponentPanel#onEvent() on how to properly process a single FormComponent.

Regards
Sven



On 02/14/2014 06:14 PM, lucast wrote:
> Dear forum,
>
> I have implemented a FormComponentPanel as suggested both in the Apache
> Wicket Cookbook (chapter 2) and  wicket guide (chapter 12.8)
> <http://wicket.apache.org/guide/guide/forms2.html#forms2_8>  .
>
> Before I submit the form, I would like to have the option of adding the
> content from FormComponentPanel to a list.
>
> I have made use of AjaxButton and  I have set
> AjaxButton.setDefaultFormProcessing( false).
>
> In order to get value from FormComponentPanel when performing
> form.onSubmit(), one calls FormComponentPanel.getConvertedInput(), which in
> turns calls FormComponentPanel.convertInput().
>
> The problem is that if I call FormComponentPanel.getConvertedInput() from
> inside AjaxButton.onSubmit(), FormComponentPanel.convertInput() is never
> called.
>
> My question is, how can I get the contents from FormComponentPanel using a
> AjaxSubmitLink or AjaxButton without having to go via form.onSubmit()?
>
> Is there, perhaps another form component that I could use to achieve my
> goal?
>
> Thanks in advance,
> Lucas
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/getting-values-from-FormComponentPanel-outside-form-onSubmit-tp4664462.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: getting values from FormComponentPanel outside form.onSubmit()

Posted by lucast <lu...@hotmail.com>.
Hi Sven and Richter,
Thank you for your replies.

What I am trying to achieve is a refreshing view, with fields that are
editable, and rows that can be removed, as shown on  Wicket Examples ->
Repeaters -> Contacts Editor - based on the previous example, but with
editable values
<http://www.wicket-library.com/wicket-examples-6.0.x/repeater/wicket/bookmarkable/org.apache.wicket.examples.repeater.FormPage?1>  

But in addition to those functionality, have one of having the list being
expandable instead of just contractile. 

That would be inside a form, with other fields, that's why I have been
setting the AjaxSubmitLink.setDefaultFormProcessing( false ).

I am making use of FormComponentPanel.onEvent(), as suggested, but the only
way to get the values from text fields is by using TextField.getInput(). 

TextField.getConvertedInput() will return null unless it is done via form
submit. Maybe I am missing something.

Thanks,
Lucas


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/getting-values-from-FormComponentPanel-outside-form-onSubmit-tp4664462p4664498.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: getting values from FormComponentPanel outside form.onSubmit()

Posted by "Richter, Marvin" <Ma...@jestadigital.com>.
Why wouldn’t you just use the defaultFormProcessing an add the converted value of the FormComponentPanel to the list inside your onSubmit method?

Best,
Marvin


Am 14.02.2014 um 18:14 schrieb lucast <lu...@hotmail.com>:

> Dear forum,
> 
> I have implemented a FormComponentPanel as suggested both in the Apache
> Wicket Cookbook (chapter 2) and  wicket guide (chapter 12.8)
> <http://wicket.apache.org/guide/guide/forms2.html#forms2_8>  .
> 
> Before I submit the form, I would like to have the option of adding the
> content from FormComponentPanel to a list.
> 
> I have made use of AjaxButton and  I have set 
> AjaxButton.setDefaultFormProcessing( false).
> 
> In order to get value from FormComponentPanel when performing 
> form.onSubmit(), one calls FormComponentPanel.getConvertedInput(), which in
> turns calls FormComponentPanel.convertInput().
> 
> The problem is that if I call FormComponentPanel.getConvertedInput() from
> inside AjaxButton.onSubmit(), FormComponentPanel.convertInput() is never
> called.
> 
> My question is, how can I get the contents from FormComponentPanel using a
> AjaxSubmitLink or AjaxButton without having to go via form.onSubmit()?
> 
> Is there, perhaps another form component that I could use to achieve my
> goal?
> 
> Thanks in advance,
> Lucas
> 
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/getting-values-from-FormComponentPanel-outside-form-onSubmit-tp4664462.html
> Sent from the Users forum mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org