Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

AjaxTabbedPanel and validation for all tabs

$
0
0
Hi all,

I have a complex form for editing existing objects. I am planning to use
AjaxTabbedPanel with adapted ajax links for the tabs to submit the current
tab when the user switches tabs.

There will be a "save" button under the tabbed panel that will save the
entire object.

For new objects, I could force the user to visit all tabs before allowing
them to save, to guarantee that the validators have ran for all form
components and all tabs.

The twist here is that the object, when loaded, may be invalid. But I don't
want to force the user to visit all tabs when editing an existing object
because it will very unfriendly (imagine the user wanting to update just
one field in the first tab and being forced to visit all five tabs before
saving).

So I am looking for a way to make sure that all validators run when the
user clicks "save". As far as I understand there is no way to force all
wicket validators to execute because the request will only contain post
data for the active tab.

Is there a way to solve this? Client side tabs are a solution I guess but
one I'd like to avoid if possible.

I did consider moving my validation logic to a server side validation
method. The problem here is that you cannot leverage wicket's existing
validators and error messages and also it becomes considerably harder to
provide visual feedback for errors (e.g. highlight the components with
errors). On the plus side, you do have a validation method that can be
reused if you have alternate methods for updating the same data (e.g. via a
REST service).

Are there any pointers on using server side validation with wicket forms?

Thanks in advance,
Marios

Viewing all articles
Browse latest Browse all 5648

Trending Articles