Martin,
    That is correct, the stuts error tag cannot actually invoke a JavaScript
method, however it can write one out to the screen and have the browser
throw such an error at run time of the page.  I will be posting a follow up
thread to explain what throwError() (the JavaScript form my response) might
do with a sample set of code.  Without violating any code ownership issues
for the specific implimentation developed for the site listed below, the
general concept and a sample modified implimentation will be available in a
new thread I am going to post in a few hours.  Please see the "JavaScript
with html:errors - new STRUTS validation" thread coming up very soon, I am
just putting the finishing touches on the files.

Thanks,
Adam S. Grohs
[EMAIL PROTECTED]


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, September 29, 2001 1:08 PM
Subject: Re: Javascruot with html:errors


> Adam,
>
> This is an interesting idea. I'd certainly be interested in hearing more
> about what throwError() does, and what happens when more than one error
> occurs on a page.
>
> I still claim that you are not actually calling JavaScript from the tag,
> though. You may be generating it, but you're not actually calling it.
> However, perhaps this is what the original poster was asking for. :-)
>
> --
> Martin Cooper
>
>
> ----- Original Message -----
> From: "Adam Grohs" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, September 29, 2001 8:30 AM
> Subject: Re: Javascruot with html:errors
>
>
> > This response is not necessarily true.  It is possible to call a
> particular
> > JavaScript method or function from the <html:errors /> tag.  I worked on
a
> > team from iXL, Inc. and we have just completed a very sophisticated
error
> > handling mechanism for www.hallmarkstories.com that allows errors to be
> > thrown by an action class through the struts error tag and then each
error
> > that is thrown refers to a specific key in the AppResource.properties
file
> > that invokes a Javascript method for throwing a client side error.  This
> > allows both server-side and client-side validation to be handled by one
> set
> > of presentation layer code.  I would be very happy to explain the
details
> > further if you would like more information.
> >
> >     Ex.
> >         error.header=<script language="JavaScript">
> >            error.email.invalid=throwError("Please enter a valid email
> > address")
> >         error.header=</script>
> >
> > Adam S. Grohs
> >
> > ----- Original Message -----
> > From: <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, September 24, 2001 12:06 AM
> > Subject: Re: Javascruot with html:errors
> >
> >
> > > If I understand what you're asking, it's not possible. JavaScript is
> > > executed at the client (e.g. the browser), while JSP, including the
> > > <html:errors> tag, is executed on the server.
> > >
> > > --
> > > Martin Cooper
> > >
> > >
> > > ----- Original Message -----
> > > From: "Francois Duchaussoy" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Sunday, September 23, 2001 9:13 PM
> > > Subject: Javascruot with html:errors
> > >
> > >
> > > > Hi,
> > > >
> > > > Would anyone know how to call a javascript method from a
> <html:errors/>
> > > tag?
> > > > Basically I would like to highlight a field where an error occurs...
> > > >
> > > > Any ideas??
> > > > Francois.
> > >
> > >
> > >
> >
>
>
>

Reply via email to