3 Replies Latest reply on Dec 6, 2008 10:04 PM by chris.simons

    Highlighting Validation Errors Across A Tab Panel

    bensashi

      In my application I've got one page with a form split across a number of tabs in a tab panel.  On a submit, I'm displaying any validation errors in a box above the tab panel.  Unfortunately, since this is technically one big form, validation errors are returned for all of the fields on all of the tabs.  I'm looking for a way to somehow highlight which tabs the errors occur on (or otherwise link the error messages to the fields) so that the user will have more information about what fields they need to update.


      The basic layout of the page is like this:



      <a4j:form prependId="false">
          <rich:tabPanel switchType="client" height="300px">
              <rich:tab>
                  <ui:include src="tab1.xhtml"/>
              </rich:tab>
              <rich:tab>
                  <ui:include src="tab2.xhtml"/>
              </rich:tab>
              <rich:tab>
                  <ui:include src="tab3.xhtml"/>
              </rich:tab>
          </rich:tabPanel>
      </a4j:form>





      Any suggestions?

        • 1. Re: Highlighting Validation Errors Across A Tab Panel
          vladimir.kovalyuk

          Look, the user entered something wrong and then switched to another tab. After form submit the current tab is ok and nothing happens until the user swithes to the tab with invalid information and (surprise! surprise!) she founds invalid data in fields. I believe just a few users would guess that they have to find a tab with errors.

          • 2. Re: Highlighting Validation Errors Across A Tab Panel
            jstockton

            I don't have an answer to this question but reducing the problem to an issue with the user is a no-no. There should be a way to tell the user on which tab they have an error not just require them to blindly click on tab after tab to figure it out for themselves.

            • 3. Re: Highlighting Validation Errors Across A Tab Panel

              Personally, using tab panels as a sort of wizard doesn't exactly make sense to me.  I would compartmentalize information on each tab, but I wouldn't spread the information on one form across multiple tabs.  Perhaps if you look at another way of accomplishing the same use case, such as using a faces wizard or a4j:page, you might have better luck.


              Also, if you post this question on the RichFaces forum, you might get more of a response.


              Sorry.