You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Holger Stephan <tm...@frogleg.net> on 2004/04/29 22:31:29 UTC

DHTML Menu

I am using a DHTML menu with our Tapestry application. This works fine
with the @Script component. However, it is not efficient to parse and
embed a static 40 some kByte .js file into every page that shows the
menu. In fact it is keeping me currently from using Tapestry on
corporate Internet presences, if there is also a DHTML menu. 

How can I link to a .js file analog to style sheet file linking? 

Thanks!

Holger

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


Re: DHTML Menu

Posted by Holger Stephan <tm...@frogleg.net>.
Paul, you are right. The loads of JavaScript I still saw in my pages
came from somewhere else. 

Thanks for your help. 

Holger

 On Thu, 2004-04-29 at 14:47, Paul Ferraro wrote:
> Huh?  The code below should render the following in your generated HTML 
> file:
> 
> <script src="..."></script>
> 
> Isn't this what you're trying to achieve?
> 
> Paul

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


Re: DHTML Menu

Posted by Paul Ferraro <pm...@columbia.edu>.
Huh?  The code below should render the following in your generated HTML 
file:

<script src="..."></script>

Isn't this what you're trying to achieve?

Paul

Holger Stephan wrote:

>Paul: 
>
>Thanks much for your timely response. Unfortunately the script is still
>put into the HTML page. At least it is no longer parsed. 
>
>Thus I am still looking for a solution that allows me to link a .js file
>to a Tapestry page. 
>
>Thanks!
>
>Holger
>
>On Thu, 2004-04-29 at 13:50, Paul Ferraro wrote:
>  
>
>>Try this:
>>
>><script jwcid="@Any" src="ognl:asset.myScript"/>
>>
>>Define the script asset in your component/page specification:
>>
>><context-asset name="myScript" path="/script.js"></context-asset>
>>
>>Paul
>>
>>Holger Stephan wrote:
>>
>>    
>>
>>>I am using a DHTML menu with our Tapestry application. This works fine
>>>with the @Script component. However, it is not efficient to parse and
>>>embed a static 40 some kByte .js file into every page that shows the
>>>menu. In fact it is keeping me currently from using Tapestry on
>>>corporate Internet presences, if there is also a DHTML menu. 
>>>
>>>How can I link to a .js file analog to style sheet file linking? 
>>>
>>>Thanks!
>>>
>>>Holger
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>> 
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>


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


Re: DHTML Menu

Posted by Holger Stephan <tm...@frogleg.net>.
Paul: 

Thanks much for your timely response. Unfortunately the script is still
put into the HTML page. At least it is no longer parsed. 

Thus I am still looking for a solution that allows me to link a .js file
to a Tapestry page. 

Thanks!

Holger

On Thu, 2004-04-29 at 13:50, Paul Ferraro wrote:
> Try this:
> 
> <script jwcid="@Any" src="ognl:asset.myScript"/>
> 
> Define the script asset in your component/page specification:
> 
> <context-asset name="myScript" path="/script.js"></context-asset>
> 
> Paul
> 
> Holger Stephan wrote:
> 
> >I am using a DHTML menu with our Tapestry application. This works fine
> >with the @Script component. However, it is not efficient to parse and
> >embed a static 40 some kByte .js file into every page that shows the
> >menu. In fact it is keeping me currently from using Tapestry on
> >corporate Internet presences, if there is also a DHTML menu. 
> >
> >How can I link to a .js file analog to style sheet file linking? 
> >
> >Thanks!
> >
> >Holger
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >  
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 

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


RE: DHTML Menu

Posted by Holger Stephan <ho...@frogleg.net>.
Hi Philip, 

If you have really gotten this to work I'd be interested in learning how
you did it. 

I'd love to use Tapestry on some of the sites I am currently working
on...but those extra 40k/page keep me from moving on from *cough*
Struts. 

- Holger

On Thu, 2004-04-29 at 14:41, Filip S. Adamsen wrote:

> Well, I just checked the Shell source, and it seems to me that the changes
> needed to support inclusion of scripts are only minor. I am currently
> hacking around with the Tapestry build file and some external dependencies,
> but I think I have managed to include some rudimentary support for script
> inclusion via the Shell component. Oh, the wonders of OSS...


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


RE: DHTML Menu

Posted by Holger Stephan <tm...@frogleg.net>.
Hi Philip, 

I'd be interested in learning how you did it. 

I'd love to use Tapestry on some of the sites I am currently working
on...but those extra 40k/page keep me from moving on from *cough*
Struts. 

- Holger



On Thu, 2004-04-29 at 14:41, Filip S. Adamsen wrote:
> Well, I just checked the Shell source, and it seems to me that the changes
> needed to support inclusion of scripts are only minor. I am currently
> hacking around with the Tapestry build file and some external dependencies,
> but I think I have managed to include some rudimentary support for script
> inclusion via the Shell component. Oh, the wonders of OSS...


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


RE: DHTML Menu

Posted by Holger Stephan <tm...@frogleg.net>.
Sweet! Thanks Howard, this is the solution I was looking for. BTW,
<include-script> is part of the root <script> element. But it works
beautifully.

- Holger


On Thu, 2004-04-29 at 15:14, Howard M. Lewis Ship wrote:
> It's already in there; its part of the Body component. Tapestry script specifications (the .script
> files) can include static javascript libraries.
> 
> http://jakarta.apache.org/tapestry/doc/TapestryUsersGuide/script-spec.include-script.html


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


RE: DHTML Menu

Posted by "Filip S. Adamsen" <fi...@stubkjaer-adamsen.dk>.
Too bad I didn't notice... But well, it's past midnight, and I haven't got
any coffee all day! Thanks for the tip, Howard. As always, you came to the
rescue.

-Filip S. Adamsen

-----Original Message-----
From: Howard M. Lewis Ship [mailto:hlship@comcast.net] 
Sent: Friday, April 30, 2004 12:15 AM
To: 'Tapestry users'
Subject: RE: DHTML Menu

It's already in there; its part of the Body component. Tapestry script
specifications (the .script
files) can include static javascript libraries.

http://jakarta.apache.org/tapestry/doc/TapestryUsersGuide/script-spec.includ
e-script.html

--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Tapestry: Java Web Components 
Creator, HiveMind
http://howardlewisship.com


> -----Original Message-----
> From: Filip S. Adamsen [mailto:filip@stubkjaer-adamsen.dk] 
> Sent: Thursday, April 29, 2004 5:41 PM
> To: 'Tapestry users'
> Subject: RE: DHTML Menu
> 
> 
> Yeah, you could do that, but should basic functionality like 
> this not be
> embedded in the framework like the inclusion of style sheets? 
> Since the
> current implementation supports style sheets through the 
> style sheet and
> style sheets parameters, I guess it would not be all that 
> difficult to add
> similar script and scripts parameters.
> 
> [A 'few' minutes later]
> 
> Well, I just checked the Shell source, and it seems to me 
> that the changes
> needed to support inclusion of scripts are only minor. I am currently
> hacking around with the Tapestry build file and some external 
> dependencies,
> but I think I have managed to include some rudimentary 
> support for script
> inclusion via the Shell component. Oh, the wonders of OSS...
> 
> -Filip S. Adamsen
> 
> -----Original Message-----
> From: Paul Ferraro [mailto:pmf8@columbia.edu] 
> Sent: Thursday, April 29, 2004 10:51 PM
> To: Tapestry users
> Subject: Re: DHTML Menu
> 
> Try this:
> 
> <script jwcid="@Any" src="ognl:asset.myScript"/>
> 
> Define the script asset in your component/page specification:
> 
> <context-asset name="myScript" path="/script.js"></context-asset>
> 
> Paul
> 
> Holger Stephan wrote:
> 
> >I am using a DHTML menu with our Tapestry application. This 
> works fine
> >with the @Script component. However, it is not efficient to parse and
> >embed a static 40 some kByte .js file into every page that shows the
> >menu. In fact it is keeping me currently from using Tapestry on
> >corporate Internet presences, if there is also a DHTML menu. 
> >
> >How can I link to a .js file analog to style sheet file linking? 
> >
> >Thanks!
> >
> >Holger
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: 
> tapestry-user-help@jakarta.apache.org
> >
> >  
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


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




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


RE: DHTML Menu

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
It's already in there; its part of the Body component. Tapestry script specifications (the .script
files) can include static javascript libraries.

http://jakarta.apache.org/tapestry/doc/TapestryUsersGuide/script-spec.include-script.html

--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Tapestry: Java Web Components 
Creator, HiveMind
http://howardlewisship.com


> -----Original Message-----
> From: Filip S. Adamsen [mailto:filip@stubkjaer-adamsen.dk] 
> Sent: Thursday, April 29, 2004 5:41 PM
> To: 'Tapestry users'
> Subject: RE: DHTML Menu
> 
> 
> Yeah, you could do that, but should basic functionality like 
> this not be
> embedded in the framework like the inclusion of style sheets? 
> Since the
> current implementation supports style sheets through the 
> style sheet and
> style sheets parameters, I guess it would not be all that 
> difficult to add
> similar script and scripts parameters.
> 
> [A 'few' minutes later]
> 
> Well, I just checked the Shell source, and it seems to me 
> that the changes
> needed to support inclusion of scripts are only minor. I am currently
> hacking around with the Tapestry build file and some external 
> dependencies,
> but I think I have managed to include some rudimentary 
> support for script
> inclusion via the Shell component. Oh, the wonders of OSS...
> 
> -Filip S. Adamsen
> 
> -----Original Message-----
> From: Paul Ferraro [mailto:pmf8@columbia.edu] 
> Sent: Thursday, April 29, 2004 10:51 PM
> To: Tapestry users
> Subject: Re: DHTML Menu
> 
> Try this:
> 
> <script jwcid="@Any" src="ognl:asset.myScript"/>
> 
> Define the script asset in your component/page specification:
> 
> <context-asset name="myScript" path="/script.js"></context-asset>
> 
> Paul
> 
> Holger Stephan wrote:
> 
> >I am using a DHTML menu with our Tapestry application. This 
> works fine
> >with the @Script component. However, it is not efficient to parse and
> >embed a static 40 some kByte .js file into every page that shows the
> >menu. In fact it is keeping me currently from using Tapestry on
> >corporate Internet presences, if there is also a DHTML menu. 
> >
> >How can I link to a .js file analog to style sheet file linking? 
> >
> >Thanks!
> >
> >Holger
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: 
> tapestry-user-help@jakarta.apache.org
> >
> >  
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


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


RE: DHTML Menu

Posted by "Filip S. Adamsen" <fi...@stubkjaer-adamsen.dk>.
Yeah, you could do that, but should basic functionality like this not be
embedded in the framework like the inclusion of style sheets? Since the
current implementation supports style sheets through the style sheet and
style sheets parameters, I guess it would not be all that difficult to add
similar script and scripts parameters.

[A 'few' minutes later]

Well, I just checked the Shell source, and it seems to me that the changes
needed to support inclusion of scripts are only minor. I am currently
hacking around with the Tapestry build file and some external dependencies,
but I think I have managed to include some rudimentary support for script
inclusion via the Shell component. Oh, the wonders of OSS...

-Filip S. Adamsen

-----Original Message-----
From: Paul Ferraro [mailto:pmf8@columbia.edu] 
Sent: Thursday, April 29, 2004 10:51 PM
To: Tapestry users
Subject: Re: DHTML Menu

Try this:

<script jwcid="@Any" src="ognl:asset.myScript"/>

Define the script asset in your component/page specification:

<context-asset name="myScript" path="/script.js"></context-asset>

Paul

Holger Stephan wrote:

>I am using a DHTML menu with our Tapestry application. This works fine
>with the @Script component. However, it is not efficient to parse and
>embed a static 40 some kByte .js file into every page that shows the
>menu. In fact it is keeping me currently from using Tapestry on
>corporate Internet presences, if there is also a DHTML menu. 
>
>How can I link to a .js file analog to style sheet file linking? 
>
>Thanks!
>
>Holger
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>


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




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


Re: DHTML Menu

Posted by Paul Ferraro <pm...@columbia.edu>.
Try this:

<script jwcid="@Any" src="ognl:asset.myScript"/>

Define the script asset in your component/page specification:

<context-asset name="myScript" path="/script.js"></context-asset>

Paul

Holger Stephan wrote:

>I am using a DHTML menu with our Tapestry application. This works fine
>with the @Script component. However, it is not efficient to parse and
>embed a static 40 some kByte .js file into every page that shows the
>menu. In fact it is keeping me currently from using Tapestry on
>corporate Internet presences, if there is also a DHTML menu. 
>
>How can I link to a .js file analog to style sheet file linking? 
>
>Thanks!
>
>Holger
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>


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