struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: [S2] s:tabbedPanel with remote tabs and javascript on the remote tabs
Date Tue, 03 Apr 2007 17:40:33 GMT
I have a minimum (AFAICT) failure scenario for the
nested-divs-inside-tabbedPanel-divs; it's reasonably
short so I just stuck it in here for now. The
"failure" (which I still suspect is because I just
can't do what I'm trying to do, but it's not clear to
me why not yet) lies in minimalFailureInclude.jsp.

I simplified it so there's no local actions, although
I sanity-checked to make sure using my own actions
resulted in the same failure (it does). If I put
<s:head.../> in minimailFailureInclude.jsp too it
blows up JavaScriptily.

As soon as I set method="execute" I get the following
error and the script in min2Include.jsp never
executes:

Error loading
'/s2samples/forms/"/s2samples/forms/minimal2!execute.action"'
(404
/s2samples/forms/%22/s2samples/forms/minimal2!execute.action%22)

If I remove the method="execute" it works correctly.

d.

=== struts config chunk, nothing weird, 
    DynamicMethodInvocation=true,
    minor formatting to look nice.
===

<action name="minimalFailure">
  <result>
    /WEB-INF/jsp/forms/minimalFailure.jsp
  </result>
</action>

<action name="minInc">
  <result>
    /WEB-INF/jsp/forms/minimalFailureInclude.jsp
  </result>
</action>

<action name="minimal2">
  <result>
    /WEB-INF/jsp/forms/min2Include.jsp
  </result>
</action>

=== minimalFailure.jsp ===

<%@ taglib prefix="s" uri="/struts-tags"%>

<html>
  <head>
    <s:head theme="ajax" debug="true" />
  </head>

  <body>
    <s:tabbedPanel id="tabWrapper" 
                   selectedTab="dynaTab" 
                   theme="simple">
      <s:div label="Static Tab" 
             id="tab1" 
             theme="ajax">
        <h2>Good grief...</h2>
      </s:div>

      <s:div label="DynaTab" 
             id="dynaTab" 
             theme="ajax">
        <h2>Better get an alert()...</h2>

        <s:url action="minInc" id="minIncUrl"/>
        <s:div href="%{minIncUrl}" 
               executeScripts="true" 
               theme="ajax">
          Loading...
        </s:div>
      </s:div>
    </s:tabbedPanel>
  </body>
</html>

=== minimalFailureInclude.jsp ===

<%@ taglib prefix="s" uri="/struts-tags"%>

<h3>I made it here!!!</h3>

<script type="text/javascript">
  alert("Plugh! from minimalFailureInclude.");
</script>

<s:url action="minimal2" 
       id="min2Url" 
       method="execute"/>
<s:div id="min2Div" 
       href="%{min2Url}" 
       theme="ajax" 
       executeScripts="true">
  Loading...
</s:div>

=== min2Include.jsp ===

<h3>MIN 2 INCLUDE</h3>
<script type="text/javascript">
  alert("Plugh! from min2Include.");
</script>

============

--- Dave Newton <newton.dave@yahoo.com> wrote:

> --- Musachy Barroso <musachy@gmail.com> wrote:
> > I already exceeded the "Works for me quota" this
> > week, so I won't say it :),
> > modifying /remotediv/example1.jsp in showcase to:
> > 
> > <s:url id="ajaxTest0" action="AjaxTest"
> > method="execute" />
> > <s:div
> >         theme="ajax"
> >         href="%{ajaxTest0}" />
> > 
> > <s:url id="ajaxTest1" action="AjaxTest!execute"/>
> > <s:div
> >         theme="ajax"
> >         href="%{ajaxTest1}" />
> > 
> > They both work. What is different in your case?
> 
> Mine doesn't :D
> 
> So far the only thing I can think of is that it's
> basically:
> 
> <s:tabbedPanel...>
>   <s:div href="%{...}">
>     <%-- From the remote! --%>
>     <s:div href="%{...}">
> 
> So there's two levels of remote divs inside a
> tabbedPanel and building the deepest URL is where
> the
> method gets hosed.
> 
> Um... I don't have an <s:head theme="ajax"/> in the
> JSP that creates the lowest-level <s:div.../> but I
> thought I did at one point; I'll check that
> tomorrow.
> 
> d.
> 
> 
> 
>  
>
____________________________________________________________________________________
> Finding fabulous fares is fun.  
> Let Yahoo! FareChase search your favorite travel
> sites to find flight and hotel bargains.
> http://farechase.yahoo.com/promo-generic-14795097
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



 
____________________________________________________________________________________
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html 

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


Mime
View raw message