You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "semerau@hotmail.com" <se...@hotmail.com> on 2006/09/20 21:02:00 UTC

Dynamic columns

Anybody know a simple way to dynamically add a column to a table (using Contrib:Table)? I want a table to have a new column with a "Delete" link if the user is an admin. I have it working if I by always including the Delete column and the Delete links only appear for admins, but I want the column itself to only appear for admins.Any help appreciated.
_________________________________________________________________
Express yourself with gadgets on Windows Live Spaces
http://discoverspaces.live.com?source=hmtag1&loc=us

RE: Dynamic Sections on a Page

Posted by Michael Grundvig <mi...@electrotank.com>.
Im sorry, I don't think I explained that well at all (I was barely awake
at the time). What I need is along the lines of a dynamic include in a
JSP. Where the included JSP still executes as always but you are able to
specify the include path itself as a variable. That's what I'm looking to
accomplish. If this can be done with Block and RenderBlock, can you
provide more details? Thanks!

Michael


-----Original Message-----
From: "Firas Adiler" <ta...@idigna.com>
Sent: Thu, September 21, 2006 12:25 pm
To: "Tapestry users" <us...@tapestry.apache.org>
Subject: RE: Dynamic Sections on a Page

Hi,

I think these components are well suited for this kind of job:

http://tapestry.apache.org/tapestry4/tapestry/ComponentReference/RenderBlock
.html
http://tapestry.apache.org/tapestry4/tapestry/ComponentReference/Block.html


</Firas>


-----Original Message-----
From: Mike Grundvig [mailto:mike@electrotank.com]
Sent: Thursday, September 21, 2006 3:41 PM
To: Tapestry users
Subject: Dynamic Sections on a Page

Hi all; first off, I just wanted to express my thanks to the devs and
community for making Tapestry. It's a real piece of art. Thanks!

I'm working on a site that has an admin system to store advertisments. These
advertisements are small HTML blocks that they want inserted into specific
places inside of a page. The entire site is broken into sections and the ads
are tied to all the pages in a section. I know I can make a custom component
and inject my ad service into it and then use that to load the files from
the file system and dump the ad HTML right into the pages but that feels
very clumsy. I want the ad HTML to be valid tapestry pages in their own
right so they can take advantage of all the capabilities of tapestry.

Basically, Id like a component that looks something like this:

<span jwcid="@AdDisplay" adId="1" sectionId="learn">Ad 1 goes here</span>

And that would go on every page with a different section id for all
locations. Then it would do this internally (psuedo code, obviously):

// the url for this ad might be "/ads/blah.html" (yes, I have friendly urls
working)
Template template = getAdService().getTemplate(adId, sectionId);
template.render();

How can I get a page from the tapestry engine via the name or path or some
such in a way that I can dump it into the page? Thanks in advance for any
advice!

Michael




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




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


RE: Dynamic Sections on a Page

Posted by Firas Adiler <ta...@idigna.com>.
Hi,

I think these components are well suited for this kind of job:

http://tapestry.apache.org/tapestry4/tapestry/ComponentReference/RenderBlock
.html
http://tapestry.apache.org/tapestry4/tapestry/ComponentReference/Block.html

 
</Firas>
 

-----Original Message-----
From: Mike Grundvig [mailto:mike@electrotank.com] 
Sent: Thursday, September 21, 2006 3:41 PM
To: Tapestry users
Subject: Dynamic Sections on a Page

Hi all; first off, I just wanted to express my thanks to the devs and
community for making Tapestry. It's a real piece of art. Thanks!

I'm working on a site that has an admin system to store advertisments. These
advertisements are small HTML blocks that they want inserted into specific
places inside of a page. The entire site is broken into sections and the ads
are tied to all the pages in a section. I know I can make a custom component
and inject my ad service into it and then use that to load the files from
the file system and dump the ad HTML right into the pages but that feels
very clumsy. I want the ad HTML to be valid tapestry pages in their own
right so they can take advantage of all the capabilities of tapestry.

Basically, Id like a component that looks something like this:

<span jwcid="@AdDisplay" adId="1" sectionId="learn">Ad 1 goes here</span>

And that would go on every page with a different section id for all
locations. Then it would do this internally (psuedo code, obviously):

// the url for this ad might be "/ads/blah.html" (yes, I have friendly urls
working)
Template template = getAdService().getTemplate(adId, sectionId);
template.render();

How can I get a page from the tapestry engine via the name or path or some
such in a way that I can dump it into the page? Thanks in advance for any
advice!

Michael 




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


Dynamic Sections on a Page

Posted by Mike Grundvig <mi...@electrotank.com>.
Hi all; first off, I just wanted to express my thanks to the devs and 
community for making Tapestry. It's a real piece of art. Thanks!

I'm working on a site that has an admin system to store advertisments. These 
advertisements are small HTML blocks that they want inserted into specific 
places inside of a page. The entire site is broken into sections and the ads 
are tied to all the pages in a section. I know I can make a custom component 
and inject my ad service into it and then use that to load the files from 
the file system and dump the ad HTML right into the pages but that feels 
very clumsy. I want the ad HTML to be valid tapestry pages in their own 
right so they can take advantage of all the capabilities of tapestry.

Basically, Id like a component that looks something like this:

<span jwcid="@AdDisplay" adId="1" sectionId="learn">Ad 1 goes here</span>

And that would go on every page with a different section id for all 
locations. Then it would do this internally (psuedo code, obviously):

// the url for this ad might be "/ads/blah.html" (yes, I have friendly urls 
working)
Template template = getAdService().getTemplate(adId, sectionId);
template.render();

How can I get a page from the tapestry engine via the name or path or some 
such in a way that I can dump it into the page? Thanks in advance for any 
advice!

Michael 



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


Re: Dynamic columns

Posted by Steve Shucker <ss...@vmsinfo.com>.
Just use an ognl expression for the "columns" attribute of the table. 

<table jwcid="@contrib:Table" columns="ognl:'column1, column2, column3' 
+ (isAdminUser ? ',deleteColumn', '')" ...>

Never underestimate the coolness of the terniary operator.

-Steve

semerau@hotmail.com wrote:
> Anybody know a simple way to dynamically add a column to a table (using Contrib:Table)? I want a table to have a new column with a "Delete" link if the user is an admin. I have it working if I by always including the Delete column and the Delete links only appear for admins, but I want the column itself to only appear for admins.Any help appreciated.
> _________________________________________________________________
> Express yourself with gadgets on Windows Live Spaces
> http://discoverspaces.live.com?source=hmtag1&loc=us
>   

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