wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Bors <p...@bors.ws>
Subject RE: Nested form submit problem
Date Tue, 28 Aug 2012 15:55:31 GMT
Sounds complicated, why not just setVisible(false) when you want to "delete"
or hide one of those questions (aka form fields)?
Also, I don't think you need to use nested forms here, unless you wrap each
question in a panel and within in a form.

Refer to this wiki page for nested forms and their behavior:
https://cwiki.apache.org/WICKET/nested-forms.html

Is hard to follow the code example you gave but if I understand your
use-case right and if you want to add different questions within a form I
suggest you use a DataTable and a dynamic DataProvider that would be
populated with a list of Panels that hold on to each of the labels and form
fields with the questions you want to show (no need for an inner form unless
you want the question to be answered by itself). When you want to hide one
of them simply call setVisible(false) and use Ajax to refresh the DataTable.
If you want to change the questions, simply change the list of Panels and
make sure each form field has its own model (or use CompoundModel if you
want).

Hope that helps :)

~ Thank you,
  Paul Bors

-----Original Message-----
From: Sandor Feher [mailto:sfeher@bluesystem.hu] 
Sent: Tuesday, August 28, 2012 11:28 AM
To: users@wicket.apache.org
Subject: Nested form submit problem

Hi,

I have the following use case. I have some questionnaires and a couple of
questions belong to every questionnaire.
I created a nested form component contains two forms. First does nothing
just has some buttons (save,delete,cancel,reset) and contains as many child
forms as the number of questions.
So it's fine and almost everything work. My problem is when I want to delete
the items and click delete button then the inner form's onSubmit event also
fires although I set the delete.setDefaultFormProcessing(false) behaviour on
delete button. Same is with reset and cancel button. Both of them fires
inner form's onSubmit event.


http://pastebin.com/zErvmG5J

tia, Sandor



--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Nested-form-submit-problem-tp4651
565.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


Mime
View raw message