tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mindaugas Genutis <mindau...@elinara.ktu.lt>
Subject Re: Using Javascript in Tapestry
Date Mon, 15 Dec 2003 16:42:33 GMT

Yes, I included the javascript component inside the Border component, 
which has the @Body component inside it. I reference my Javascript component 
like this:

<span jwcid="@Script" script="/js/Menu.script"/>

And the Menu.script looks ... (below). The current situation is: first my 
web app is displayed. Then everything disappears and it tries to draw the 
menu with no <html><body> tags around.

--------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: $ -->
<!DOCTYPE script PUBLIC
        "-//Apache Software Foundation//Tapestry Script Specification 
3.0//EN"
        "http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd">
<script>
<include-script resource-path="/js/menu.js"/>
<include-script resource-path="/js/menu_items.js"/>
<include-script resource-path="/js/menu_tpl.js"/>
<initialization>
    new menu (MENU_ITEMS, MENU_POS);
</initialization>
</script>
--------------------------------------------------------------------

> Does your page have the Body component? Your page should have the Body component for
the script to 
> render properly.
> 
> -Harish
> 
> Mindaugas Genutis wrote:
> 
> > My code looks just like you specified. The *.js files are in the 
> > WEB-INF/classes/js/ directory.
> > 
> > However, the output is very strange. At first, I see my web app. Then it 
> > disappears and the menu is outputted with JavaScript debugging errors. No 
> > <html> and <body> tags are around that HTML.
> > 
> > I've also tried to wrap the 'include' scripts with <body> and 'CDATA' as 
> > specified in the Tutorial. Nothing helps. The menu isn't outputted. Though 
> > the *.js files are located.
> > 
> > 
> >>Try the following...
> >>
> >><?xml version="1.0" encoding="UTF-8"?>
> >><!-- $Id: $ -->
> >><!DOCTYPE script PUBLIC
> >>	"-//Apache Software Foundation//Tapestry Script Specification 3.0//EN"
> >>	"http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd">
> >>
> >><script>
> >>
> >><include-script resource-path="/js/menu.js"/>
> >><include-script resource-path="/js/menu_items.js"/>
> >><include-script resource-path="/js/menu_tpl.js"/>
> >>
> >><initialization>
> >>    new menu (MENU_ITEMS, MENU_POS);
> >></initialization>
> >>
> >></script>
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 

-- 
Kaunas Regional Distance Education Center
Programmer
Phone: +370 674 05232
WWW: http://distance.ktu.lt


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


Mime
View raw message