You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Johannes Geppert <jo...@web.de> on 2008/01/12 12:34:34 UTC

[S2] No JavaScript in TabbedPanel

Hello,

I have a Tabbed Panel and will execute JavaScript in the div Tabs.
But the Scripts will not be executed, I use the parameter 
executeScripts="true".

My TabbedPanel looks like this:

<sx:tabbedpanel  id="editTabs" cssStyle="width: 570px; zindex: 110"
doLayout="false">
<s:url id="descurl" namespace="/" action="editDescription"/>
 <sx:div cssClass="tabs" id="description" indicator="indid"
label="Description" preload="false" href="%{descurl}" executeScripts="true">
    images/indicator.gif 
</sx:div >
<s:url id="newsurl" namespace="/" includeParams="none"  action="editNews"/>
<sx:div cssClass="tabs" id="news" indicator="indin" label="News"
href="%{newsurl}" executeScripts="true" refreshOnShow="true" preload="false"
>
   images/indicator.gif 
</sx:div >
</sx:tabbedpanel>

Is a JavaScript like the one in the ShowCase.
	<script language="JavaScript" type="text/javascript">
			alert('It Works!!');
	</script>

But this JavaScript was never executed, and is not present in the Result.

when I turn Debug on, I become following debug messages:
DEBUG: widget ID collision on ID: description
DEBUG: widget ID collision on ID: news
DEBUG: Error running scripts from content: undefined

What means undefined?

Best Regards
Johannes Geppert

-- 
View this message in context: http://www.nabble.com/-S2--No-JavaScript-in-TabbedPanel-tp14772176p14772176.html
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


Exception handling

Posted by "Zhang, Larry (L.)" <lz...@ford.com>.
Since Struts offers an exception Handler
(org.apache.struts.action.ExceptionHandler ), then I got a question: 

in my action, should I try and catch the exception (in the execute's
method) that may be throwed in business layer and forward to an
ActionForward? Or don't do any try and cath in the action's execute
method just throws to the Exception handler?

Your suggestions are appreciated!

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


Re: [S2] No JavaScript in TabbedPanel

Posted by Johannes Geppert <jo...@web.de>.
I use already the executeScripts parameter but there is no affect.
The Scripts are removed from my result.

<s:url id="descurl" namespace="/" action="editDescription"/>
 <sx:div cssClass="tabs" id="description" indicator="indid"
label="Description" preload="false" href="%{descurl}" executeScripts="true"> 




newton.dave wrote:
> 
> --- Johannes Geppert <jo...@web.de> wrote:
>> yes all <script> tags are removed in my results.
>> What can I do to execute the javascript?
> 
> http://struts.apache.org/2.x/docs/tabbedpanel.html
> 
> executeScripts.
> 
> d.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-S2--No-JavaScript-in-TabbedPanel-tp14772176p14775378.html
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] No JavaScript in TabbedPanel

Posted by Dave Newton <ne...@yahoo.com>.
--- Johannes Geppert <jo...@web.de> wrote:
> yes all <script> tags are removed in my results.
> What can I do to execute the javascript?

http://struts.apache.org/2.x/docs/tabbedpanel.html

executeScripts.

d.


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


Re: [S2] No JavaScript in TabbedPanel

Posted by Johannes Geppert <jo...@web.de>.
yes all <script> tags are removed in my results.
What can I do to execute the javascript?


GF-7 wrote:
> 
> Time ago I noticed that javascript were removed in the pages linked by
> <s:div ..> is this  your case too?
> 

-- 
View this message in context: http://www.nabble.com/-S2--No-JavaScript-in-TabbedPanel-tp14772176p14773194.html
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] No JavaScript in TabbedPanel

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
hmm... take a look at the generated HTML and each tab's div looks 
similar to like:

<div dojotype="struts:BindDiv" scriptseparation="false" executescripts="true" ...>

Also, see the parseContent attribute of the head tag.
http://struts.apache.org/2.x/docs/dojo-head.html

Dojo parses your HTML, extracts the scripts, inserts the nodes into the 
DOM (rather than using innerHTML) and then executes the scripts.  Even 
if the scripts are not visible in the DOM, it's possible that Dojo has 
extracted and executed them - you can test that with a javascript alert.

Otherwise perhaps it's been broken in the latest version but I can't 
think of why.

Johannes Geppert wrote:
> no separateScripts has also no affect, all JavaScript in my result are
> removed.
>
>
> Jeromy Evans - Blue Sky Minds wrote:
>   
>> http://struts.apache.org/2.x/docs/dojo-div.html
>>
>> separateScripts
>>
>> j.
>>
>>     
>
>   


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


Re: [S2] No JavaScript in TabbedPanel

Posted by Johannes Geppert <jo...@web.de>.
but in the showcase is an example of remote divs,
and this works with <script> tags.



GF-7 wrote:
> 
> Johannes i got same problem time ago.
> The <script></script> is removed from page included by s:div and the
> only thing you've is a execution on first page load.. but in few words
> you cannot keep function definition inside the page included with a
> s:div.
> 
> It's really a strange thing.. but it is.
> 
> On Jan 13, 2008 8:46 PM, Johannes Geppert <jo...@web.de> wrote:
>>
>> no, this is the main problem. :-)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-S2--No-JavaScript-in-TabbedPanel-tp14772176p14795575.html
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] No JavaScript in TabbedPanel

Posted by GF <ga...@gmail.com>.
Johannes i got same problem time ago.
The <script></script> is removed from page included by s:div and the
only thing you've is a execution on first page load.. but in few words
you cannot keep function definition inside the page included with a
s:div.

It's really a strange thing.. but it is.

On Jan 13, 2008 8:46 PM, Johannes Geppert <jo...@web.de> wrote:
>
> no, this is the main problem. :-)

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


Re: [S2] No JavaScript in TabbedPanel

Posted by Johannes Geppert <jo...@web.de>.
no, this is the main problem. :-)


newton.dave wrote:
> 
> Is your JavaScript executed?
> 
> d.
> 
> --- Johannes Geppert <jo...@web.de> wrote:
> 
>> 
>> in my JSP I've got an JavaScript like this
>> 
>>         <script language="JavaScript" type="text/javascript">
>>                         alert('It Works!!');
>>         </script>
>> But in the result of struts2 the script tags and the content of the tags
>> are
>> removed.
>> 
>> 
>>  
>> 
>> newton.dave wrote:
>> > 
>> > --- Johannes Geppert <jo...@web.de> wrote:
>> >> no separateScripts has also no affect, all JavaScript in my result are
>> >> removed.
>> > 
>> > What, exactly, do you mean by "removed"? If, for example, you put an
>> > 
>> > alert('plugh');
>> > 
>> > in your JavaScript does it not execute?
>> > 
>> > d.
>> > 
>> > 
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> > 
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>>
> http://www.nabble.com/-S2--No-JavaScript-in-TabbedPanel-tp14772176p14789556.html
>> 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
>> 
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-S2--No-JavaScript-in-TabbedPanel-tp14772176p14790115.html
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] No JavaScript in TabbedPanel

Posted by Dave Newton <ne...@yahoo.com>.
Is your JavaScript executed?

d.

--- Johannes Geppert <jo...@web.de> wrote:

> 
> in my JSP I've got an JavaScript like this
> 
>         <script language="JavaScript" type="text/javascript">
>                         alert('It Works!!');
>         </script>
> But in the result of struts2 the script tags and the content of the tags
> are
> removed.
> 
> 
>  
> 
> newton.dave wrote:
> > 
> > --- Johannes Geppert <jo...@web.de> wrote:
> >> no separateScripts has also no affect, all JavaScript in my result are
> >> removed.
> > 
> > What, exactly, do you mean by "removed"? If, for example, you put an
> > 
> > alert('plugh');
> > 
> > in your JavaScript does it not execute?
> > 
> > d.
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context:
>
http://www.nabble.com/-S2--No-JavaScript-in-TabbedPanel-tp14772176p14789556.html
> 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
> 
> 


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


Re: [S2] No JavaScript in TabbedPanel

Posted by Johannes Geppert <jo...@web.de>.
in my JSP I've got an JavaScript like this

        <script language="JavaScript" type="text/javascript">
                        alert('It Works!!');
        </script>
But in the result of struts2 the script tags and the content of the tags are
removed.


 

newton.dave wrote:
> 
> --- Johannes Geppert <jo...@web.de> wrote:
>> no separateScripts has also no affect, all JavaScript in my result are
>> removed.
> 
> What, exactly, do you mean by "removed"? If, for example, you put an
> 
> alert('plugh');
> 
> in your JavaScript does it not execute?
> 
> d.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-S2--No-JavaScript-in-TabbedPanel-tp14772176p14789556.html
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] No JavaScript in TabbedPanel

Posted by Dave Newton <ne...@yahoo.com>.
--- Johannes Geppert <jo...@web.de> wrote:
> no separateScripts has also no affect, all JavaScript in my result are
> removed.

What, exactly, do you mean by "removed"? If, for example, you put an

alert('plugh');

in your JavaScript does it not execute?

d.


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


Re: [S2] No JavaScript in TabbedPanel

Posted by Johannes Geppert <jo...@web.de>.
no separateScripts has also no affect, all JavaScript in my result are
removed.


Jeromy Evans - Blue Sky Minds wrote:
> 
> http://struts.apache.org/2.x/docs/dojo-div.html
> 
> separateScripts
> 
> j.
> 

-- 
View this message in context: http://www.nabble.com/-S2--No-JavaScript-in-TabbedPanel-tp14772176p14784339.html
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] No JavaScript in TabbedPanel

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Dave Newton wrote:
> --- GF <ga...@gmail.com> wrote:
>   
>> Time ago I noticed that javascript were removed in the pages linked by
>> <s:div ..> is this  your case too?
>>     
>
> http://struts.apache.org/2.x/docs/dojo-div.html
>
> executeScripts
>
> d.
>
>   

http://struts.apache.org/2.x/docs/dojo-div.html

separateScripts

j.

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


Re: [S2] No JavaScript in TabbedPanel

Posted by Dave Newton <ne...@yahoo.com>.
--- GF <ga...@gmail.com> wrote:
> Time ago I noticed that javascript were removed in the pages linked by
> <s:div ..> is this  your case too?

http://struts.apache.org/2.x/docs/dojo-div.html

executeScripts

d.


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


Re: [S2] No JavaScript in TabbedPanel

Posted by GF <ga...@gmail.com>.
Time ago I noticed that javascript were removed in the pages linked by
<s:div ..> is this  your case too?

On Jan 12, 2008 12:34 PM, Johannes Geppert <jo...@web.de> wrote:
>
> Hello,
>
> I have a Tabbed Panel and will execute JavaScript in the div Tabs.
> But the Scripts will not be executed, I use the parameter
> executeScripts="true".

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