You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Gregor Melhorn <g....@web.de> on 2005/03/08 14:11:20 UTC

Question on custom javascript

Hello tapestry users,

 

I'm rather new to tapestry, so forgive if I might ask some "dumb" questions
:-)

 

I want to create a component that allows me to include a dhtml menu on my
site, with the main level always visible as a table and the sublevels
created by javascript, so users without javascript enabled can access the
deeper layers of the site as well, but will have to click more often. The
menu should be different for the security roles on my site, with
administrators, mods, and several other user roles getting different menus
to see.

 

I thought of using the java dhtml menu script from smartmenus.org, since it
seams pretty mature to me und supports nearly every browser one could think
of.

 

The scripts consists of several .js-files, wich are dynamically loaded
depending on browser type. One of these files includes the menu
specification (styles, menu items, etc.). That's the file I would have to
generate with tapestry. 

 

But how do I do it? 

 

I suppose it should be possible to do it by implementing the .js-file with
menu information as an ordinary page, but this seems kind of wasting
resources to me, or doesn't it? Or do I have to implement some kind of
engine service?

 

And where do I put the check for the user roles? Should I implement
different components for each user type?

 

I don't want to go into the wrong direction from the start, so maybe someone
could give me some hints on how this is best implemented.

 

I'm using Tapestry 3.0.

 

Best regard

 

Gregor Melhorn


Re: Question on custom javascript

Posted by Kent Tong <ke...@cpttm.org.mo>.
Gregor Melhorn <g.melhorn <at> web.de> writes:

> The scripts consists of several .js-files, wich are dynamically loaded
> depending on browser type. One of these files includes the menu
> specification (styles, menu items, etc.). That's the file I would have to
> generate with tapestry. 

You may want to use Krysalis's Menu component:

http://metamorphosis.krysalis.org/krysalis-menu/

> And where do I put the check for the user roles? 

implement PageRenderListener and override pageBeginRender().

> Should I implement different components for each user type?

Yes if the user types are much different. Otherwuse just 
use some Conditional components.



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


Re: Question on custom javascript

Posted by Bryan Lewis <br...@maine.rr.com>.
For starters, try the Tapestry in Action book, chapter 10 and Appendix D.
Or the third entry in the FAQ page at
http://tapestry.sourceforge.net/wiki/index.php/TapestryFAQ .


----- Original Message ----- 
From: "Gregor Melhorn" <g....@web.de>
To: <ta...@jakarta.apache.org>
Sent: Tuesday, March 08, 2005 8:11 AM
Subject: Question on custom javascript


> Hello tapestry users,
>
>
>
> I'm rather new to tapestry, so forgive if I might ask some "dumb"
questions
> :-)
>
>
>
> I want to create a component that allows me to include a dhtml menu on my
> site, with the main level always visible as a table and the sublevels
> created by javascript, so users without javascript enabled can access the
> deeper layers of the site as well, but will have to click more often. The
> menu should be different for the security roles on my site, with
> administrators, mods, and several other user roles getting different menus
> to see.
>
>
>
> I thought of using the java dhtml menu script from smartmenus.org, since
it
> seams pretty mature to me und supports nearly every browser one could
think
> of.
>
>
>
> The scripts consists of several .js-files, wich are dynamically loaded
> depending on browser type. One of these files includes the menu
> specification (styles, menu items, etc.). That's the file I would have to
> generate with tapestry.
>
>
>
> But how do I do it?
>
>
>
> I suppose it should be possible to do it by implementing the .js-file with
> menu information as an ordinary page, but this seems kind of wasting
> resources to me, or doesn't it? Or do I have to implement some kind of
> engine service?
>
>
>
> And where do I put the check for the user roles? Should I implement
> different components for each user type?
>
>
>
> I don't want to go into the wrong direction from the start, so maybe
someone
> could give me some hints on how this is best implemented.
>
>
>
> I'm using Tapestry 3.0.
>
>
>
> Best regard
>
>
>
> Gregor Melhorn
>
>


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