I have a problem with validation on form actually sub-form.
In my website I have some kind of table and "Add row" button (BlockingAjaxSubmitLink). When I try add let say 2 rows, I get validation error (because row in this table has Required=True parameter) and I can't add another row. I tried use simple AjaxLink but it doesn't have reference to form in onClick method and when I complete some rows and click "Add row" this data get lost.
I want to enable validation only after "save" button click.
Any idea how to deal with this problem?
Depending on your structure maybe you are looking after disabling validation using
setDefaultFormProcessing(true);
- http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/markup/html/form/AbstractSubmitLink.html#setDefaultFormProcessing%28boolean%29For now I write some kind of hack
First I set
and next
and my hack...
and I ovveride one method
I know it is ugly solution but I couldn't figure out anything better.. And I couldn't shutdown feedback messages
I do something like you want using an
AjaxLink
. MyAjaxLink
:In this code the
listViewContainer
is aWebMarkupContainer
which contains aListView
holding the table rows.When i click this
AjaxLink
a new object representing a row in my table is added to the database and then the container containing theListView
is being refreshed refreshing theListView
and the new empty object is being fetched from the DB and shown as a new row in my table at the end.