Posts Tagged ‘TabbedPanel’

XPages: Validation of Tabbed Panels

This article shall start my Blog about the horror we call XPages.

One or another has certainly noticed that, when you use a TabbedPanel on an XPage, the whole validation of the form is screwed. If you change to another tab, where are no fields which should be vaildated, you can save the whole document without filling the mandatory fields on the other tabs.

This is, IBM-typically no bug, it’s a feature.
If the tab is not shown, it isn’t rendered, so he doesn’t exist. Therefore it is clear that the validation of this tab can’t be executed.

IBM knows this problem, there is already an Enhancement-Request since February 2010… unfortunately there hasn’t happen anything
This is the official workaround:

Unfortunately, this isn’t quite elegant.

Here is another solution:

If you add a save-event in the onClick-event of every tab in the tabbedPanel, the XPage tries to save the document everytime you want to change the tab, which fires the validation. The catch is, of cource, you have to accept that the document is saved on every change of the tab. This solution is only vaild, if you have all your mandatory fields on one tab.

Attention: You shouldn’t check “Process Data without validation”. Also you should pay attention, that the document is only saved in the edit-mode.

%d bloggers like this: