Another way would be to use some JavaScript on the input page that opens
a new window, the popup, and writes the error messages directly to that
using the document.write(...) function. Pretty easy really.
Frank Zammetti wrote:
One way to do this (the only way I can actually think of) is this...
write your logon page as you would normally in Struts, i.e., pretend
your going to display your error message there. That means
re-displaying the user's entries, all that. But, instead of displaying
the messages, open a new window via JavaScript as a result of the pages'
onLoad event, and load into that the error messages (either via
scripting or calling an Action, which means you would have had to
persisted the messages somehow on the server and referenced them, i.e.,
maybe set them in session during the failed logon Action call and
retrieve them for display).
As far as I know, there is no way to send a redirect to the browser
telling it to open the target in a new window from the server, so any
response the server sends has to technically go to the same window that
started the request (unless of course you targeted a new window to begin
with, but it doesn't sound like you can do that). So, your left with
"faking it", that is, you will in fact re-draw the page, but it will
look like a new window is opening with the error messages. If the
appearance is all you want, this should do, but if there's some reason
you can't overwrite your logon page (like maybe some stored data in
script elements that can't be overwritten?) then I think your out of luck.
Frank
From: praveen kulkarni <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: How to display error msgs in a pop up window
Date: Wed, 2 Jun 2004 16:51:21 +0100 (BST)
Hi all,
Sub: How can i get error messages in a pop up window by using STRUTS
I am using Struts and i want to handle all validation error messages
in a new popup window.
Consider Login form with loginID and password as form fields. I want
to check mandatory status at the server side, for this i will put
validate method in the FormBean. FormBean will create Error Object
sends back to Login Page. I've to handle this error object in a new
popup window instead of displaying in the Login page.
bye
PAK
Yahoo! India Matrimony: Find your partner online.
_________________________________________________________________
Check out the coupons and bargains on MSN Offers! http://youroffers.msn.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Nick Heudecker
System Mobile, Inc.
Email: [EMAIL PROTECTED]
Web: http://www.systemmobile.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]