Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 71383 invoked from network); 14 Oct 2005 15:57:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Oct 2005 15:57:49 -0000 Received: (qmail 13674 invoked by uid 500); 14 Oct 2005 15:57:40 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 13159 invoked by uid 500); 14 Oct 2005 15:57:37 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 13147 invoked by uid 99); 14 Oct 2005 15:57:37 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Oct 2005 08:57:37 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of hrabago@gmail.com designates 64.233.162.195 as permitted sender) Received: from [64.233.162.195] (HELO zproxy.gmail.com) (64.233.162.195) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Oct 2005 08:57:38 -0700 Received: by zproxy.gmail.com with SMTP id l8so321854nzf for ; Fri, 14 Oct 2005 08:57:15 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=uo21nVpWnNFyw0w11jjvk+Nd/QQGmBz/SgMV2x6bqdg19mGr1kRZ7ODJOL47M/Hi6h03OrIXGlgzrA4dbCy8P02lwDdXZ6eNHqOdHcsN6JRjniwNeUhP98Egc7kF7UZ6I1otm8okOM2Ew6e93Rb28OlPnJ6tVt3q4J5FN8eoeIc= Received: by 10.36.37.20 with SMTP id k20mr3832643nzk; Fri, 14 Oct 2005 08:57:15 -0700 (PDT) Received: by 10.36.118.4 with HTTP; Fri, 14 Oct 2005 08:57:15 -0700 (PDT) Message-ID: <7b809eef0510140857q23aa1eacqc92e626fb15549e9@mail.gmail.com> Date: Fri, 14 Oct 2005 10:57:15 -0500 From: Hubert Rabago To: Struts Users Mailing List Subject: Re: [OT] Struts + AJAX Trumps JSF In-Reply-To: <1db115340510132344h55c2768aj14523590cb99fbe3@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <01f401c5d078$eb686ef0$6401a8c0@vivid.net> <434F4E05.5010603@omnytex.com> <1db115340510132344h55c2768aj14523590cb99fbe3@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 10/14/05, Michael Jouravlev wrote: > > Some nice scripting without Ajax, just Javascript and CSS: > http://www.themaninblue.com/writing/perspective/2005/10/05/form/form4.htm > I wish Struts Validator could be that cool :-) It CAN be. I spent some time last night figuring out the javascript/struts tags portion of it, but now I'll have to actually know how Validator works to hook it up with what I have so far. The idea is you have a set of controls dedicated to a particular field. For starters, this is what I have: First Name
The should be able to support getting its string from resources of course: (Also shows the 'default' key I'm thinking of using if neither text nor key is provided.) Also, a tag to enclose related tags will make things easier:
The resulting HTML would look like: Now when the user submits the form, Validator will go through all fields and figure out which ones pass and which ones are invalid. If a property is invalid: * the label's class can be changed * the span is shown and is used to show a validation error for that propert= y It can be done. I think I'm halfway there, though once I get there all I'll have is a proof-of-concept using a custom set of tags which won't allow you to use custom "id" values. Hubert --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org