struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Earl <ste...@Infogain.co.uk>
Subject RE: redirect html:errors to popup window
Date Fri, 08 Feb 2002 09:10:46 GMT
Well,

A slightly different way that we've tried here (I've been scrapping with a
similar issue for a few days now) was to set a 'Window-target' inside the
header on the HttpResponse object when you're within your action class.

Add the following code to your Action class once you've figured out that you
do have some action errors to display

httpResponse.setAttribute("Window-target", "name_of_a_frame");


Under Netscape this causes the page identified by your struts-config file to
be loaded in the target window/frame you've specified. Probably not quite as
flexible as Sean's suggestion but it does seem to work. Unfortunately, it
doesn't work for IE5 (as the Window-target meta tag seems to be Netscape
specific).

More depressing for me is that it doesn't work within Mozilla either, and
that's what my client uses....so back to the drawing board.....

__________________________________ 
Steve Earl

InfoGain Limited, 23-25 Marlow Road, Maidenhead, Berkshire SL6 7AA, UK
email: stevee@infogain.co.uk
Tel: +44 (0)1628 580 600 
Fax: +44 (0)1628 580 610
Mobile: +44 (0)779 026 3645

Disclaimer:  Neither this e-mail nor any attachment places any legal or
contractual obligations on InfoGain Limited. Any reproduction, disclosure or
dissemination beyond the intended addressees is strictly prohibited save for
the legitimate business purposes of InfoGain Limited and its clients or
partners.
__________________________________ 


-----Original Message-----
From: Sean Willson [mailto:sean.willson@divine.com]
Sent: Friday, February 08, 2002 2:06 AM
To: Struts Users Mailing List
Subject: Re: redirect html:errors to popup window


redirect html:errors to popup windowThe only way I think you could do this
is via JavaScript ... you could use this tag set:

<logic:messagesPresent >... </logic:messagesPresent>

to determine if there are errors, if so open a popup window, save the handle
... and then within this tag:

<html:messages id="error">...</html:messages>

append to that window the error messages. The JavaScript isn't that hard but
that is honestly the only way I think you could do it. It would look
something like this:

<logic:messagesPresent >
<script>
var newWindow = open window here with the size and controls you want
<html:messages id="error">
append to the window the contents of '<bean:write name="error"
filter="false"/>'
</html:messages>
</script>
</logic:messagesPresent>

Anyone have any other ideas.

Sean

----- Original Message -----
From: jcanter@isochron.com
To: struts-user@jakarta.apache.org
Sent: Thursday, February 07, 2002 3:47 PM
Subject: redirect html:errors to popup window

Any suggestions on how to redirect <html:errors/> output to a popup window
rather than the page that the form is located on?
Thanks, Jim Canter
--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message