Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 13897 invoked from network); 20 Jul 2007 15:58:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Jul 2007 15:58:11 -0000 Received: (qmail 19968 invoked by uid 500); 20 Jul 2007 15:58:07 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 19929 invoked by uid 500); 20 Jul 2007 15:58:07 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 19913 invoked by uid 99); 20 Jul 2007 15:58:07 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Jul 2007 08:58:07 -0700 Received-SPF: pass (herse.apache.org: local policy) Received: from [62.232.64.2] (HELO intranetserver.focus-internal.co.uk) (62.232.64.2) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Jul 2007 08:58:04 -0700 Received: from exchange.focus-internal.co.uk ([172.16.0.19] RDNS failed) by intranetserver.focus-internal.co.uk with Microsoft SMTPSVC(6.0.3790.3959); Fri, 20 Jul 2007 16:57:39 +0100 Received: from exchange.focus-internal.co.uk ([172.16.0.19]) by exchange.focus-internal.co.uk ([172.16.0.19]) with mapi; Fri, 20 Jul 2007 16:57:42 +0100 From: Peter Rawlins To: MyFaces Discussion Date: Fri, 20 Jul 2007 16:57:45 +0100 Subject: RE: [Trinidad] panelTabbed - validation of unvisited tabs Thread-Topic: [Trinidad] panelTabbed - validation of unvisited tabs Thread-Index: AcfKIQXI4gHw6xhFRPi2H+WvUTGJRQAwGi3w Message-ID: References: <6dac79b90707190922h4a408fafp729b2e62ee70b776@mail.gmail.com> In-Reply-To: <6dac79b90707190922h4a408fafp729b2e62ee70b776@mail.gmail.com> Accept-Language: en-US, en-GB Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, en-GB Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 20 Jul 2007 15:57:39.0828 (UTC) FILETIME=[B307F340:01C7CAE6] X-Virus-Checked: Checked by ClamAV on apache.org On 7/19/07, Adam Winer wrote: > > There's two questions here: > (1) Is there a way to validate tabs that have been disclosed, > but aren't disclosed right now? > (2) Is there a way to validate tabs that have never been disclosed. > > For 1, the answer is yes: call processValidators() and > processUpdateModel() on the children of the showDetailItem. > > For 2, the answer is no, you can't. And you can't set the submitted valu= e to "", because > that'll blow up for many renderers. > > What you need here is bean-level validation, not component-level validati= on. > Alternatively, you might disable the button until all tabs have been visi= ted. Adam, thanks for the quick reply. I've got quite a lot of similar pages to create using tabbedPanels, so I'd = like to make the most of the automatic validation based on the declarative = page definition. After careful consideration, I've decided to go with your very last suggest= ion - with a slight tweak :-) I plan to track which tabs have been visited, but leave the button always e= nabled. When the button is pushed, the action will first perform a check that all n= ecessary tabs have been visited, and if not, disclose the next required tab= as appropriate. If the check passes, then the normal button action will b= e performed. I'll be relying on the standard behaviour of not letting the = user get out of the current tab unless it's valid - so I need to ensure tha= t no "immediate" actions switch away from the current tab. Additionally, I expect to use bean-level validation for cross-field validat= ion where the fields are on different tabs. Many thanks for your help. Regards, Peter.