Hi!

thank you very much for your answer.
Do you think it would generally be better
to use Tiles instead of frameset?
We would like to use the validador-framework
but when we have to use javascript in any case
do you think it would be better not to do this?

Ciao






---------- Initial Header -----------

>From      : "Frank W. Zammetti" [EMAIL PROTECTED]
To          : "Struts Users Mailing List" user@struts.apache.org
Cc          : "user" user@struts.apache.org
Date      : Tue, 6 Sep 2005 10:21:08 -0400 (EDT)
Subject : Re: Problem with a Frameset and Struts







> Hi,
>
> This isn't really a Struts issue per se, it's a frames issue.
>
> When you set the target of the form to display, the response from the
> server is going to go into the bottom frame, regardless of what the
> outcome is (i.e., whether there are errors or not).  This is just how
> frames work.
>
> You can do what you want, but it will require client-side coding.
>
> I would suggest having a third frame with a size of 0 (making it hidden)
> and direct your response to it.  Add some Javascript to the page that is
> returned that fires in response to the onLoad event.  If errors came back,
> copy them over to the search frame, otherwise copy the whole page to
> display.  Let's assume you call the hidden frame "hiddenFrame", and let's
> assume there is a <div> with an ID of "errorDiv" in both the returned page
> and what's in the search frame... Here's what I would do:
>
> <html>
> <head>
> <script>
>  function loadHandler() {
>   if (errorDiv.innerHTML != '') {
>    window.top.search.errorDiv.innerHTML =
>     window.top.hiddenFrame.errorDiv.innerTML;
>   } else {
>    window.top.display.document.open();
>     window.top.display.document.write(
>      window.top.hiddenFrame.document.documentElement.outerHTML);
>    window.top.display.document.close();
>   }
> </script>
> </head>
> <body onLoad="loadHandler();">
> ...
> </body></html>
>
> So, if errors are present in the <div> on the returned page, they will be
> copied over to the <div> in the search frame.  If the <div> is empty on
> the returned page, meaning no errors occurred, the entire page is copied
> over to the display frame.
>
> I'm not sure this is 100% cross-browser, you probably need to use
> getElementById() to make it so, but the basic theory works (I know because
> I do this in a prod app I have).
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
>
> On Tue, September 6, 2005 8:32 am, gollinger said:
> > I have a frameset with two included jsp's.
> >
> > <frameset rows="15%,85%">
> >   <html:frame frameName="search" page="/jsp/awp/search.jsp" />
> >   <html:frame frameName="display" page="/jsp/awp/empty.jsp" />
> > </frameset>
> > </head>
> > </html>
> >
> >
> > this is the first jsp inside the frameset with validation
> >
> > and errors should be displayed there:
> >
> > <html:form action="/show" target="display" >
> >     <tr>
> >       <td width="100">
> >         <html:link page="/jsp/index.jsp">Home</html:link>
> >       </td>
> >       <td colspan="3" align="center"><b>show group</b></td>
> >     </tr>
> >     <tr>
> >       <td><html:text property="abt_id" size="3" value="32"/>
> >       </td>
> >       <td><html:submit/></td>
> >     </tr>
> >     <html:errors/>
> >   </html:form>
> >
> > the large problem that I have is that I want the errors to be displayed in
> > the first jsp (in the part of the frameset above),
> > where the submit button original is!
> > But the effect is that the original page gets duplicated on the screen und
> > the errors were displayed there!
> >
> >
> > Who can give me an advice?
> >
> > Thanks Antonio
> >
> >
> >
> >
> >
> >
> >
> >
> > ____________________________________________________________
> > 6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero!
> > Scaricalo su INTERNET GRATIS 6X http://www.libero.it
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> 



____________________________________________________________
Libero Flat, sempre a 4 Mega a 19,95 euro al mese! 
Abbonati subito su http://www.libero.it




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to