Re: AjaxButton OnSubmit Validation Overridden

2010-07-22 Thread Nivedan Nadaraj
Hi All,

I did look up the Nabble archive for key-words like 'AjaxButton onSubmit',
AjaxButton and OnError. I did not get anything that addressed this.So do
bear with me with this is re-post.

I have a field(few fields) for which is setRequired(true).

Below this field(s) I have an WebMarkupContainer that contains a
ListMultipleChoice control with Add and Add buttons. These buttons are of
type AjaxButton.

When I select some items form the ListMultipleChoice control and hit Add or
Add ALL, it triggers the form validation for the 'required fields' and in
this case I have not 'yet' populated them. So instead of onSubmit, it goes
to onError.

How can I get around this? Best practices?

Thanks for the time
Regards
Niv


Re: AjaxButton OnSubmit Validation Overridden

2010-07-22 Thread MattyDE

you could Try to set 

/**
 * Sets the defaultFormProcessing property. When false (default is 
true),
all validation and
 * form updating is bypassed and the onSubmit method of that button is
called directly, and the
 * onSubmit method of the parent form is not called. A common use for 
this
is to create a cancel
 * button.
 * 
 * @param defaultFormProcessing
 *defaultFormProcessing
 * @return This
 */
public final Button setDefaultFormProcessing(boolean 
defaultFormProcessing)

to false on the AjaxButton (Button.class)
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Re-AjaxButton-OnSubmit-Validation-Overridden-tp2298251p2298256.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Re: AjaxButton OnSubmit Validation Overridden

2010-07-22 Thread Nivedan Nadaraj
 Thanks for that, that worked. I have used this feature before for the
Cancel operation. Just did not occur to me.
Cheers


On Thu, Jul 22, 2010 at 3:41 PM, MattyDE ufer.mar...@gmail.com wrote:


 you could Try to set

/**
 * Sets the defaultFormProcessing property. When false (default is
 true),
 all validation and
 * form updating is bypassed and the onSubmit method of that button
 is
 called directly, and the
 * onSubmit method of the parent form is not called. A common use
 for this
 is to create a cancel
 * button.
 *
 * @param defaultFormProcessing
 *defaultFormProcessing
 * @return This
 */
public final Button setDefaultFormProcessing(boolean
 defaultFormProcessing)

 to false on the AjaxButton (Button.class)
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Re-AjaxButton-OnSubmit-Validation-Overridden-tp2298251p2298256.html
 Sent from the Wicket - User mailing list archive at Nabble.com.

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




Re: AjaxButton OnSubmit Validation Overridden

2010-07-22 Thread Nivedan Nadaraj
Although..the Model is not updated on the ListMultipleChoice control. So
when I use the Remove Selected button I get the values from
listControl.getModelObject() this returns a null list.So a NP exception is
thrown.

I turned the defaultFormProcessing back on to the standard one for this'
particular button'. When I provide the required fields with data then it
works as in no NP exception and the model does return the values selected.

Any pointers? Cheers
Niv

On Thu, Jul 22, 2010 at 4:19 PM, Nivedan Nadaraj shravann...@gmail.comwrote:

 Thanks for that, that worked. I have used this feature before for the
 Cancel operation. Just did not occur to me.
 Cheers



 On Thu, Jul 22, 2010 at 3:41 PM, MattyDE ufer.mar...@gmail.com wrote:


 you could Try to set

/**
 * Sets the defaultFormProcessing property. When false (default is
 true),
 all validation and
 * form updating is bypassed and the onSubmit method of that button
 is
 called directly, and the
 * onSubmit method of the parent form is not called. A common use
 for this
 is to create a cancel
 * button.
 *
 * @param defaultFormProcessing
 *defaultFormProcessing
 * @return This
 */
public final Button setDefaultFormProcessing(boolean
 defaultFormProcessing)

 to false on the AjaxButton (Button.class)
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Re-AjaxButton-OnSubmit-Validation-Overridden-tp2298251p2298256.html
 Sent from the Wicket - User mailing list archive at Nabble.com.

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





Re: AjaxButton OnSubmit Validation Overridden

2010-07-22 Thread vov

Hi,

Read
http://www.wicketframework.org/apidocs/wicket/markup/html/form/Form.html
about nested forms.
Also your can put your ListMultipleChoice and buttons to separate Panel
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Re-AjaxButton-OnSubmit-Validation-Overridden-tp2298251p2298343.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Re: AjaxButton OnSubmit Validation Overridden

2010-07-22 Thread Nivedan Nadaraj
Hi
Thanks for that, I guess building the piece of code as a separate
component(panle) helps. This should deal with Multi Select with add/remove
buttons with submit (Default behavior) .
Having the multi-select logic more generic would help in re-use.I think.

Cheers

On Thu, Jul 22, 2010 at 4:58 PM, vov vov...@mail.ru wrote:


 Hi,

 Read
 http://www.wicketframework.org/apidocs/wicket/markup/html/form/Form.html
 about nested forms.
 Also your can put your ListMultipleChoice and buttons to separate Panel
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Re-AjaxButton-OnSubmit-Validation-Overridden-tp2298251p2298343.html
 Sent from the Wicket - User mailing list archive at Nabble.com.

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