You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ray Clough <ra...@allthisisthat.com> on 2007/06/13 00:33:46 UTC

(S2) Refreshing an Ajax Div

I've got a page with 2 s:div tags, and the 2nd is loaded by something
occurring in the 1st.  What happens if an exception is thrown in this
process?  Of course, the error page gets loaded into the 2nd div.  This is
not an acceptable result.  Is there any way around this?  What I'd like to
happen is for the app to redirect to the error page.  Can the Ajax, once
invoked, be turned off?  Any ideas?

Thanks,
- Ray Clough
-- 
View this message in context: http://www.nabble.com/%28S2%29-Refreshing-an-Ajax-Div-tf3910831.html#a11088713
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: (S2) Refreshing an Ajax Div

Posted by Musachy Barroso <mu...@gmail.com>.
Well, if your error page has an error status code, then you can use the
notifyTopics, something like

dojo.event.topic.subscribe("/topics", function(data, type, e){
      if(type == "error") {
          //do something
          //to redirect
          window.location ="google.com";
      }
   });

but if the page ha an status code of 200(which it shouldn't anyway), then
there isn't much you can do, except something like the code above, but
checking for "load" instead of "error" and inspecting the returned text
(better set the status to an error code)

musachy

On 6/12/07, Ray Clough <ra...@allthisisthat.com> wrote:
>
>
> I've got a page with 2 s:div tags, and the 2nd is loaded by something
> occurring in the 1st.  What happens if an exception is thrown in this
> process?  Of course, the error page gets loaded into the 2nd div.  This is
> not an acceptable result.  Is there any way around this?  What I'd like to
> happen is for the app to redirect to the error page.  Can the Ajax, once
> invoked, be turned off?  Any ideas?
>
> Thanks,
> - Ray Clough
> --
> View this message in context:
> http://www.nabble.com/%28S2%29-Refreshing-an-Ajax-Div-tf3910831.html#a11088713
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd