Re: problem submitting a form twice - quickstart joined

2015-07-03 Thread Francois Meillet
1000 thanks !

François 








Le 3 juil. 2015 à 09:47, Sven Meier s...@meiers.net a écrit :

 Hi,
 
 forms are not allowed to be direct children of tr:
 
tr
form wicket:id=form
 td
 
http://stackoverflow.com/questions/5967564/form-inside-a-table
 
 After the first ajax request the browser will reshuffle the dom elements, so 
 that the form is no longer the parent of the input field:
 
tr
form 
 action=./?9-1.IFormSubmitListener-AddItemPanelEdit-form method=post 
 id=form25 wicket:id=form/form
 
td
input type=checkbox id=onOff28 name=onOff 
 checked=checked wicket:id=onOff
 
/td
/tr
 
 Have fun
 Sven
 
 
 On 03.07.2015 00:23, Francois Meillet wrote:
 Wicket version is 7.0.M6
 
 
 Le 2 juil. 2015 à 23:47, Francois Meillet francois.meil...@gmail.com a 
 écrit :
 
 Description
 -
 In the quickstart, the HomePage contains a form.
 
 The form's model is a CompoundPropertyModel(new 
 QuestionUnit(Boolean.TRUE));
 The QuestionUnit class has 2 properties, one is mandatory (string 
 'question').
 Properties use validation annotations.
 
 The validation is done with javax.validation.Validator,
 so a call to BeanValidationConfiguration().configure(this) is done in the 
 application init.
 
 The form contains 2 formcomponents (1 TextField 'question' mandatory and 1 
 CheckBox 'onoff' ) + 1 FeedbackLabel (extends Label).
 If an error occurs when the form is submitted, a call from within the 
 AjaxButton's onError method
 to the FormFieldEnlighter helper class is done.
 
 The FormFieldEnlighter updates the FeedbackLabel's model's value,
 and add an AttributeModifier to the TextField to modify the 'title' 
 attribute.
 Then the textfield and the feedbackLabel are resent via ajax.
 
 When this form is submitted, for the first time, with nothing typed, an 
 error occurs.
 Which is normal.
 The FeedbackLabel displays an error message.
 
 If some characters are typed in the textfield and the form submitted again,
 the textfield is still invalid.
 Which is the problem.
 
 But if, at the first submit with the error, the helper class 
 FormFieldEnlighter does not resent the invalid textfield,
 the second submit works correctly, the form is valid and the ResultPage is 
 displayed.
 
 
 
 What I have found
 -
 Looking at FormComponent - line 755
 ListStringValue list = 
 getRequest().getRequestParameters().getParameterValues(getInputName());
 list is null
 The textfield id is not in the parameters name.
 
 
 
 environnement
 -
 mac osx / jdk 8 / safari  firefox
 
 
 Thanks for your help
 François
 
 
 quickstart.zip
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 



Re: problem submitting a form twice - quickstart joined

2015-07-03 Thread Sven Meier

Hi,

forms are not allowed to be direct children of tr:

tr
form wicket:id=form
 td

http://stackoverflow.com/questions/5967564/form-inside-a-table

After the first ajax request the browser will reshuffle the dom 
elements, so that the form is no longer the parent of the input field:


tr
form 
action=./?9-1.IFormSubmitListener-AddItemPanelEdit-form method=post 
id=form25 wicket:id=form/form


td
input type=checkbox id=onOff28 name=onOff 
checked=checked wicket:id=onOff


/td
/tr

Have fun
Sven


On 03.07.2015 00:23, Francois Meillet wrote:

Wicket version is 7.0.M6


Le 2 juil. 2015 à 23:47, Francois Meillet francois.meil...@gmail.com a écrit :


Description
-
In the quickstart, the HomePage contains a form.

The form's model is a CompoundPropertyModel(new QuestionUnit(Boolean.TRUE));
The QuestionUnit class has 2 properties, one is mandatory (string 'question').
Properties use validation annotations.

The validation is done with javax.validation.Validator,
so a call to BeanValidationConfiguration().configure(this) is done in the 
application init.

The form contains 2 formcomponents (1 TextField 'question' mandatory and 1 
CheckBox 'onoff' ) + 1 FeedbackLabel (extends Label).
If an error occurs when the form is submitted, a call from within the 
AjaxButton's onError method
to the FormFieldEnlighter helper class is done.

The FormFieldEnlighter updates the FeedbackLabel's model's value,
and add an AttributeModifier to the TextField to modify the 'title' attribute.
Then the textfield and the feedbackLabel are resent via ajax.

When this form is submitted, for the first time, with nothing typed, an error 
occurs.
Which is normal.
The FeedbackLabel displays an error message.

If some characters are typed in the textfield and the form submitted again,
the textfield is still invalid.
Which is the problem.

But if, at the first submit with the error, the helper class FormFieldEnlighter 
does not resent the invalid textfield,
the second submit works correctly, the form is valid and the ResultPage is 
displayed.



What I have found
-
Looking at FormComponent - line 755
ListStringValue list = 
getRequest().getRequestParameters().getParameterValues(getInputName());
list is null
The textfield id is not in the parameters name.



environnement
-
mac osx / jdk 8 / safari  firefox


Thanks for your help
François


quickstart.zip


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




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



Re: problem submitting a form twice - quickstart joined

2015-07-02 Thread Francois Meillet
Wicket version is 7.0.M6


Le 2 juil. 2015 à 23:47, Francois Meillet francois.meil...@gmail.com a écrit :

 Description
 -
 In the quickstart, the HomePage contains a form.
 
 The form's model is a CompoundPropertyModel(new QuestionUnit(Boolean.TRUE));
 The QuestionUnit class has 2 properties, one is mandatory (string 'question').
 Properties use validation annotations.
 
 The validation is done with javax.validation.Validator, 
 so a call to BeanValidationConfiguration().configure(this) is done in the 
 application init.
 
 The form contains 2 formcomponents (1 TextField 'question' mandatory and 1 
 CheckBox 'onoff' ) + 1 FeedbackLabel (extends Label).
 If an error occurs when the form is submitted, a call from within the 
 AjaxButton's onError method 
 to the FormFieldEnlighter helper class is done.
 
 The FormFieldEnlighter updates the FeedbackLabel's model's value,
 and add an AttributeModifier to the TextField to modify the 'title' attribute.
 Then the textfield and the feedbackLabel are resent via ajax.
 
 When this form is submitted, for the first time, with nothing typed, an error 
 occurs.
 Which is normal.
 The FeedbackLabel displays an error message.
 
 If some characters are typed in the textfield and the form submitted again,
 the textfield is still invalid.
 Which is the problem.
 
 But if, at the first submit with the error, the helper class 
 FormFieldEnlighter does not resent the invalid textfield, 
 the second submit works correctly, the form is valid and the ResultPage is 
 displayed.
 
 
 
 What I have found
 -
 Looking at FormComponent - line 755 
 ListStringValue list = 
 getRequest().getRequestParameters().getParameterValues(getInputName());
 list is null
 The textfield id is not in the parameters name.
 
 
 
 environnement
 -
 mac osx / jdk 8 / safari  firefox
 
 
 Thanks for your help
 François
 
 
 quickstart.zip


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