You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by János Jarecsni <ja...@gmail.com> on 2008/04/14 15:02:01 UTC

include

Hi All,

I'm new to Tapestry technology and to this mailing list, and I have a
question. I'd like to "dynamically" create .TMLs... So instead of having
static pages (Start.tml, Login.tml), I'd like to construct Tapestry pages on
the fly (by including page parts, which are other .tmls). I've been looking
for some "include" component whatsoever, but found nothing. Except for the
PageLayout component, which does something similar, just the other way
around. Could you point me to some workaround or existing solution?

Cheers
Janos

Re: include

Posted by Josh Canfield <jo...@thedailytube.com>.
> This approach is somewhat clumsy when it comes to a portal-like scenario
> where there is no longer a "browse items" "page" but rather the user is
> manipulating components

I guess it depends on how you organize your thoughts... I can see a
pretty clear path to implementing a portal using tapestry as it is
today. You can loop over a single component and have it render
completely different content each time through based on whatever
criteria (time of day, parameter, user preference). If you have
portlets that are remote, then create a component that reads in that
remote portlet and renders the content <t:remotePortlet
config="portlet.config"/>.

Want to support users uploading their own portlets to your server? You
could do server side javascript by integrating Rhino and let that
render the portlet contents...

When you click on a component it gets to handle that click (the remote
portlet is a different beast that one you'll have to think about). If
you want to navigate to a page that expounds on a particular news
story from the news widget then create a <t:pageLink> in your
component pointing to that page. If you want the news story to replace
part of the page, name that part of the page using a <t:zone> and use
an <t:actionLink> to overwrite that content.

A portal isn't dynamic template generation at all, it's static
structure with dynamic behavior ;)

Josh

On Tue, Apr 15, 2008 at 9:25 PM, János Jarecsni
<ja...@gmail.com> wrote:
> Yes, I felt this too :) However, this is no special usage scenario I would
> say, just a bit different usage pattern that calls for a different approach.
> As I see now, the Tapestry framework is well suited to sites, where the user
> travels from Login to Browse items from there to Shopping cart and so on.
> This from a.tml to b.tml from b.tml to c.tml.
>
> This approach is somewhat clumsy when it comes to a portal-like scenario
> where there is no longer a "browse items" "page" but rather the user is
> manipulating components (like clicking on a voter component to show the
> results or clicking on a "top 10 news" component to load one news into the
> "workspace area"). Here the notion of a "page" is no longer really
> meaningful. What you have is a few templates (which specify the layout and
> design) and you'd like to manipulate (load and manage state of) components
> dynamically.
>
> I hope I could make my approach clear enough :)
>
> Cheers,
> Janos
>
>
> On 16/04/2008, Josh Canfield <jo...@thedailytube.com> wrote:
> >
> > > My intention is to move away from the page-centric
> > > approach of Tapestry toward this more dynamic strategy
> >
> >
> > :) I think the statement above says it all. When you try to "move
> > away" from the core approach of a framework then you're asking for a
> > challenge.
> >
> > If you don't mind sharing, what's your usecase? Why won't configurable
> > components suite your need? Are you wanting to pull portions of the
> > templates from a database?
> >
> > Josh
> >
> > On Tue, Apr 15, 2008 at 1:43 PM, János Jarecsni
> >
> > <ja...@gmail.com> wrote:
> > > Hi Josh,
> > >
> > > hm, this would be a pity... it is relatively easy to imagine a scenario
> > > where the component should be "lately bound", I mean resolved only at
> > > runtime. I can imagine generic TMLs which only specify placeholders for
> > > components, and it depends on some configuration what components to link
> > > into those placeholders. My intention is to move away from the
> > page-centric
> > > approach of Tapestry toward this more dynamic strategy, where the page
> > tml
> > > works as a generic template. Hope this is possible somehow... In the
> > worst
> > > case I will compile the TML on the fly using JSP and then forward to
> > > Tapestry? Uh hah :)
> > >
> > > Thanks for the reply!
> > > Janos
> > >
> > >
> > > On 15/04/2008, Josh Canfield <jo...@thedailytube.com> wrote:
> > > >
> > > > Tapestry wants to know about all the components that a page is going
> > > > to render up front. If you want to dynamcially include a component
> > > > you'll have to include that component in the template somewhere so
> > > > that you can get a handle to it.
> > > >
> > > > For instance, you can have a component that has:
> > > >
> > > > <t:delegate to="footerBlock"/>
> > > >
> > > > <t:block id="footerWhite">
> > > > <t:myWhiteFooter/>
> > > > </t:block>
> > > >
> > > > <t:block id="footerRed">
> > > > <t:myRedFooter/>
> > > > </t:block>
> > > >
> > > > then in your component class you can implement
> > > >
> > > > @Parameter
> > > > private String _color;
> > > >
> > > > @Inject
> > > > private Block footerWhite;
> > > >
> > > > @Inject
> > > > private Block footerRed;
> > > >
> > > > Block getFooterBlock() {
> > > > if ( _color.equals("white") ) {
> > > >   return footerWhite;
> > > > } else {
> > > >   return footerRed;
> > > > }
> > > >
> > > > I'm don't know of a way to iterate over all the blocks contained in a
> > > > component...
> > > >
> > > > Josh
> > > >
> > > > On Tue, Apr 15, 2008 at 1:10 PM, János Jarecsni
> > > >
> > > > <ja...@gmail.com> wrote:
> > > >
> > > > > Hi again,
> > > > >
> > > > > is there a way for a little bit more dynamic inclusion of a
> > component?
> > > > >
> > > > > Say instead of <t:footer/> I'd like to iterate through a registry of
> > > > > components and include some of them in a page, like:
> > > > >
> > > > > <t:include-component t:id="someValue"/> (someValue is not a
> > literal).
> > > > >
> > > > > It would be vital for what I'm up to :)
> > > > >
> > > > >
> > > > > Thanks again
> > > > > Janos
> > > > >
> > > > >
> > > > > On 14/04/2008, Michael Gerzabek <mi...@gmx.net> wrote:
> > > > > >
> > > > > > Then I was to fast too! ;-)
> > > > > >
> > > > > > Michael Gerzabek schrieb:
> > > > > >
> > > > > > > Hi Janos,
> > > > > > >
> > > > > > > Could you elaborate a little bit more on what you wanna do?
> > > > > > >
> > > > > > > Have a look at the basic principles of T5 [1], especially
> > Principle
> > > > #1
> > > > > > > might be of interest for you.
> > > > > > >
> > > > > > > Maybe you are just looking on how create dynamic layouts then go
> > to
> > > > the
> > > > > > > mailing list with keywords dynamic and static [2].
> > > > > > >
> > > > > > > Not sure this helps,
> > > > > > > Michael
> > > > > > >
> > > > > > > [1] http://tapestry.apache.org/tapestry5/
> > > > > > > [2]
> > > > > > >
> > > >
> > http://www.nabble.com/forum/Search.jtp?query=T5+static+dynamic&local=y&forum=340&daterange=0&startdate=&enddate=
> > > > > > >
> > > > > > >
> > > > > > > János Jarecsni schrieb:
> > > > > > >
> > > > > > > > Hi All,
> > > > > > > >
> > > > > > > > I'm new to Tapestry technology and to this mailing list, and I
> > > > have a
> > > > > > > > question. I'd like to "dynamically" create .TMLs... So instead
> > of
> > > > > > > > having
> > > > > > > > static pages (Start.tml, Login.tml), I'd like to construct
> > > > Tapestry
> > > > > > > > pages on
> > > > > > > > the fly (by including page parts, which are other .tmls). I've
> > > > been
> > > > > > > > looking
> > > > > > > > for some "include" component whatsoever, but found nothing.
> > Except
> > > > for
> > > > > > > > the
> > > > > > > > PageLayout component, which does something similar, just the
> > other
> > > > way
> > > > > > > > around. Could you point me to some workaround or existing
> > > > solution?
> > > > > > > >
> > > > > > > > Cheers
> > > > > > > > Janos
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > ---------------------------------------------------------------------
> > > > > > > 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
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > >
> > > > --
> > > > TheDailyTube.com. Sign up and get the best new videos on the internet
> > > > delivered fresh to your inbox.
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > >
> > > >
> > >
> >
> >
> >
> >
> > --
> >
> > --
> > TheDailyTube.com. Sign up and get the best new videos on the internet
> > delivered fresh to your inbox.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>



-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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


Re: include

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Hot reloading of classes and templates comes at a cost.

That being said, you can do a lot of things in Tapestry with blocks, 
delegates, render phase methods, and AJAX. It's just a matter of 
learning how to put it all together.

-Filip

On 2008-04-16 07:19, János Jarecsni wrote:
> One more thing... although Tapestry is component oriented (which is a goood
> thing :)), this kind of flexibility (dynamic template generation) which is
> available in JSP is an essential feature to be really flexible. A templating
> framework should allow this level of redirection, or abstraction, that the
> templates are dynamically produced driven by runtime conditions or
> configuration. Otherwise we get a very intelligent and elegant HTML (in
> terms of this kind of staticness). Sorry for the lengthy arguing, but I
> think this issue is vital for Tapestry too (not just me :))
> 
> Cheers,
> Janos
> 
> On 16/04/2008, János Jarecsni <ja...@gmail.com> wrote:
>> Yes, I felt this too :) However, this is no special usage scenario I would
>> say, just a bit different usage pattern that calls for a different approach.
>> As I see now, the Tapestry framework is well suited to sites, where the user
>> travels from Login to Browse items from there to Shopping cart and so on.
>> This from a.tml to b.tml from b.tml to c.tml.
>>
>> This approach is somewhat clumsy when it comes to a portal-like scenario
>> where there is no longer a "browse items" "page" but rather the user is
>> manipulating components (like clicking on a voter component to show the
>> results or clicking on a "top 10 news" component to load one news into the
>> "workspace area"). Here the notion of a "page" is no longer really
>> meaningful. What you have is a few templates (which specify the layout and
>> design) and you'd like to manipulate (load and manage state of) components
>> dynamically.
>>
>> I hope I could make my approach clear enough :)
>>
>> Cheers,
>> Janos
>>
>> On 16/04/2008, Josh Canfield <jo...@thedailytube.com> wrote:
>>>> My intention is to move away from the page-centric
>>>> approach of Tapestry toward this more dynamic strategy
>>>
>>> :) I think the statement above says it all. When you try to "move
>>> away" from the core approach of a framework then you're asking for a
>>> challenge.
>>>
>>> If you don't mind sharing, what's your usecase? Why won't configurable
>>> components suite your need? Are you wanting to pull portions of the
>>> templates from a database?
>>>
>>> Josh
>>>
>>> On Tue, Apr 15, 2008 at 1:43 PM, János Jarecsni
>>>
>>> <ja...@gmail.com> wrote:
>>>> Hi Josh,
>>>>
>>>> hm, this would be a pity... it is relatively easy to imagine a
>>> scenario
>>>> where the component should be "lately bound", I mean resolved only at
>>>> runtime. I can imagine generic TMLs which only specify placeholders
>>> for
>>>> components, and it depends on some configuration what components to
>>> link
>>>> into those placeholders. My intention is to move away from the
>>> page-centric
>>>> approach of Tapestry toward this more dynamic strategy, where the page
>>> tml
>>>> works as a generic template. Hope this is possible somehow... In the
>>> worst
>>>> case I will compile the TML on the fly using JSP and then forward to
>>>> Tapestry? Uh hah :)
>>>>
>>>> Thanks for the reply!
>>>> Janos
>>>>
>>>>
>>>> On 15/04/2008, Josh Canfield <jo...@thedailytube.com> wrote:
>>>>> Tapestry wants to know about all the components that a page is going
>>>>> to render up front. If you want to dynamcially include a component
>>>>> you'll have to include that component in the template somewhere so
>>>>> that you can get a handle to it.
>>>>>
>>>>> For instance, you can have a component that has:
>>>>>
>>>>> <t:delegate to="footerBlock"/>
>>>>>
>>>>> <t:block id="footerWhite">
>>>>> <t:myWhiteFooter/>
>>>>> </t:block>
>>>>>
>>>>> <t:block id="footerRed">
>>>>> <t:myRedFooter/>
>>>>> </t:block>
>>>>>
>>>>> then in your component class you can implement
>>>>>
>>>>> @Parameter
>>>>> private String _color;
>>>>>
>>>>> @Inject
>>>>> private Block footerWhite;
>>>>>
>>>>> @Inject
>>>>> private Block footerRed;
>>>>>
>>>>> Block getFooterBlock() {
>>>>> if ( _color.equals("white") ) {
>>>>>   return footerWhite;
>>>>> } else {
>>>>>   return footerRed;
>>>>> }
>>>>>
>>>>> I'm don't know of a way to iterate over all the blocks contained in
>>> a
>>>>> component...
>>>>>
>>>>> Josh
>>>>>
>>>>> On Tue, Apr 15, 2008 at 1:10 PM, János Jarecsni
>>>>>
>>>>> <ja...@gmail.com> wrote:
>>>>>
>>>>>> Hi again,
>>>>>>
>>>>>> is there a way for a little bit more dynamic inclusion of a
>>> component?
>>>>>> Say instead of <t:footer/> I'd like to iterate through a registry
>>> of
>>>>>> components and include some of them in a page, like:
>>>>>>
>>>>>> <t:include-component t:id="someValue"/> (someValue is not a
>>> literal).
>>>>>> It would be vital for what I'm up to :)
>>>>>>
>>>>>>
>>>>>> Thanks again
>>>>>> Janos
>>>>>>
>>>>>>
>>>>>> On 14/04/2008, Michael Gerzabek <mi...@gmx.net> wrote:
>>>>>>> Then I was to fast too! ;-)
>>>>>>>
>>>>>>> Michael Gerzabek schrieb:
>>>>>>>
>>>>>>>> Hi Janos,
>>>>>>>>
>>>>>>>> Could you elaborate a little bit more on what you wanna do?
>>>>>>>>
>>>>>>>> Have a look at the basic principles of T5 [1], especially
>>> Principle
>>>>> #1
>>>>>>>> might be of interest for you.
>>>>>>>>
>>>>>>>> Maybe you are just looking on how create dynamic layouts then
>>> go to
>>>>> the
>>>>>>>> mailing list with keywords dynamic and static [2].
>>>>>>>>
>>>>>>>> Not sure this helps,
>>>>>>>> Michael
>>>>>>>>
>>>>>>>> [1] http://tapestry.apache.org/tapestry5/
>>>>>>>> [2]
>>>>>>>>
>>> http://www.nabble.com/forum/Search.jtp?query=T5+static+dynamic&local=y&forum=340&daterange=0&startdate=&enddate=
>>>>>>>>
>>>>>>>> János Jarecsni schrieb:
>>>>>>>>
>>>>>>>>> Hi All,
>>>>>>>>>
>>>>>>>>> I'm new to Tapestry technology and to this mailing list, and
>>> I
>>>>> have a
>>>>>>>>> question. I'd like to "dynamically" create .TMLs... So
>>> instead of
>>>>>>>>> having
>>>>>>>>> static pages (Start.tml, Login.tml), I'd like to construct
>>>>> Tapestry
>>>>>>>>> pages on
>>>>>>>>> the fly (by including page parts, which are other .tmls).
>>> I've
>>>>> been
>>>>>>>>> looking
>>>>>>>>> for some "include" component whatsoever, but found nothing.
>>> Except
>>>>> for
>>>>>>>>> the
>>>>>>>>> PageLayout component, which does something similar, just the
>>> other
>>>>> way
>>>>>>>>> around. Could you point me to some workaround or existing
>>>>> solution?
>>>>>>>>> Cheers
>>>>>>>>> Janos
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>> ---------------------------------------------------------------------
>>>>>>>> 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
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> --
>>>>> TheDailyTube.com. Sign up and get the best new videos on the
>>> internet
>>>>> delivered fresh to your inbox.
>>>>>
>>>>>
>>>>>
>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>
>>>
>>>
>>> --
>>>
>>> --
>>> TheDailyTube.com. Sign up and get the best new videos on the internet
>>> delivered fresh to your inbox.
>>>
>>> ---------------------------------------------------------------------
>>> 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: include

Posted by Lance White <la...@logicscope.com>.

Excellent - just what I need to do.

If the block you retrieved containes a component that needed a parameter,
have you any idea how that could be passed using your method below? 

At the moment I can't even see how you can call setters on the page that
holds the block to pull them in that way - all presuming that the page
actually exists as an instance anyway.


Lance


Michael Gerzabek wrote:
> 
> 
> 
> <div t:type="Delegate" t:to="activePayment"/>
> ...
> Confirmation.java
> ...
>     public Object getActivePayment() {
>        
>         // Metadata from PaymentProviderService
>         Provider provider = _paymentService.getProvider();
>         // The T5 page name
>         Page page = _pagePool.checkout( provider.getPaymentPageName() );
>         ComponentPageElement root = page.getRootElement();
>         Block block = root.getBlock( 
> provider.getPaymentConfirmationBlockName() );
>         _pagePool.release( page );
>         return block;
>     }
> ...
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/include-tp16678761p17337401.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: include

Posted by Michael Gerzabek <mi...@gmx.net>.
Hi Janos, List,

Wow, you digged into it ;) At the time there was no need for me to go so 
deep with T5. So I think I cannot help with your conrete approach.

Rather I will share what I did, when I needed to load a Component at 
runtime.

I have a checkout flow that has the opportunity to register different 
payment types. The application itself implements a handful of usual 
payment types. Beside that additional payment types can be added later. 
Payment types can be deployed via a standalone jar file. The application 
will pick it up and dispay an additional payment option for each payment 
type to the user. It's obvious that payment types need to augment the 
checkout flow to collect additional payment data.

Like in any checkout application one of the last pages is a kind of 
cofirmation page where the user can check all his order details. One of 
which of course is the payment data.

My problem with T5 was that I would know only at runtime which payment 
type was selected and that I had to delegate the rendering of the 
payment to some Component.

The answer I found on the list [1] and in the docs [2] was to use the 
<t:delegate/> Component. This implyed to also create a <t:block/> for 
each payment type. And that makes absolute sense. When you implement a 
new payment type you can easily care about how the rendering in a small 
box of a confirmation page will look like. Remember? Static structure.

So the only thing I had to 'invent' on my own was how to get hold of the 
specific block at runtime. In my case this boiled down to aggregate some 
meta-data that help me handle the stuff. The dynamic behaviour.

Here an excerpt from the checkout application:

Confirmation.tml (BTW I like the invisible instrumentation stuff :))
...
<div t:type="Delegate" t:to="activePayment"/>
...
Confirmation.java
...
    public Object getActivePayment() {
       
        // Metadata from PaymentProviderService
        Provider provider = _paymentService.getProvider();
        // The T5 page name
        Page page = _pagePool.checkout( provider.getPaymentPageName() );
        ComponentPageElement root = page.getRootElement();
        Block block = root.getBlock( 
provider.getPaymentConfirmationBlockName() );
        _pagePool.release( page );
        return block;
    }
...

List: I'm not sure about the line

Page page = _pagePool.checkout( provider.getPaymentPageName() );

Lately I saw a different approach in RequestSecurityManagerImpl that uses

Page page = _requestPageCache.get( pageName );

Is the second one better? faster? memory optimized?

Anyway. This does the job for my confirmation page. And somehow it's a 
showcase on how to dynamically load a Component/ Block at runtime.

Hope that helps a little,
Michael

[1] 
http://www.nabble.com/T5%3A-Best-practice-for-rendering-a-dynamic-component-to10765577.html#a10775220
[2] 
http://tapestry.formos.com/nightly/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/Delegate.html


János Jarecsni schrieb:
> Hi Michael,
>
> PagePool cannot give out ComponentPageElements, but PageElementFactory can.
> Still I have the problem :)
> I can now simply describe what I'd like to achieve:
>
> The following is a class of a component:
>
> public class ComponentSlot {
>
>     @Parameter(required = true, defaultPrefix = "literal")
>     private String slotId;
>
>
>     @BeginRender
>     void renderMessage( MarkupWriter writer) {
>          // iterate through a registry of components, looking for components
> registered with this slot
>          // embed those components here one by one
>     }
> }
>
> So, the ComponentSlot would be the logical "container" of some other
> componenets, which would like to show up in this slot (=place holder). Could
> someone tell me roughly what should I do to correctly embed another
> component in the renderMessage method (if it is the right place for it)?
>
> I'd appreciate any answers helping me get closer to the solution :)
>
> cheers,
> janos
>
>   


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


Re: include

Posted by János Jarecsni <ja...@gmail.com>.
Hi Michael,

PagePool cannot give out ComponentPageElements, but PageElementFactory can.
Still I have the problem :)
I can now simply describe what I'd like to achieve:

The following is a class of a component:

public class ComponentSlot {

    @Parameter(required = true, defaultPrefix = "literal")
    private String slotId;


    @BeginRender
    void renderMessage( MarkupWriter writer) {
         // iterate through a registry of components, looking for components
registered with this slot
         // embed those components here one by one
    }
}

So, the ComponentSlot would be the logical "container" of some other
componenets, which would like to show up in this slot (=place holder). Could
someone tell me roughly what should I do to correctly embed another
component in the renderMessage method (if it is the right place for it)?

I'd appreciate any answers helping me get closer to the solution :)

cheers,
janos

On 16/04/2008, Michael Gerzabek <mi...@gmx.net> wrote:
>
> Hi János,
>
> In your very first mail 2 days ago you say "I'm new to Tapestry technology
> and to this mailing list". I think though I played around with T5 quite some
> time I'm also new to it. So please don't take my word to be the final truth.
> I think there is a simple solution to your problem. Look into
> ComponentPageElement [1]. You can get it via PagePool that you Inject into
> your page.
>
> I also suggest to look into the docs on the concepts of T5. They are quite
> well documented and VERY powerful. I say this because I realized that
> applying thinking patterns originated in the past (JSP, Struts, etc.) might
> not be as helpful in learning a new technology than reading and applying the
> actual docs are. Speaking from my own experiences here.
>
> Regards,
> Michael
>
> [1]
> http://tapestry.formos.com/nightly/tapestry5/apidocs/org/apache/tapestry/internal/structure/ComponentPageElement.html
>
> I would suggest before you go into in-depth application writing
>
> Jarecsni schrieb:
>
> > And one really last thing :) I had a shallow look at wicket to check
> > this
> > feature... There should be some common unconscious conceptual path here,
> > as
> > wicket too misses this. All it has is an Include component to include
> > non-wicket (! :D) content. Why these frameworks are so much reluctant to
> > this? :)
> >
> > J
> >
> > On 16/04/2008, János Jarecsni <ja...@gmail.com> wrote:
> >
> >
> > > One more thing... although Tapestry is component oriented (which is a
> > > goood thing :)), this kind of flexibility (dynamic template
> > > generation)
> > > which is available in JSP is an essential feature to be really
> > > flexible. A
> > > templating framework should allow this level of redirection, or
> > > abstraction,
> > > that the templates are dynamically produced driven by runtime
> > > conditions or
> > > configuration. Otherwise we get a very intelligent and elegant HTML
> > > (in
> > > terms of this kind of staticness). Sorry for the lengthy arguing, but
> > > I
> > > think this issue is vital for Tapestry too (not just me :))
> > >
> > > Cheers,
> > > Janos
> > >
> > > On 16/04/2008, János Jarecsni <ja...@gmail.com> wrote:
> > >
> > >
> > > > Yes, I felt this too :) However, this is no special usage scenario I
> > > > would say, just a bit different usage pattern that calls for a
> > > > different
> > > > approach. As I see now, the Tapestry framework is well suited to
> > > > sites,
> > > > where the user travels from Login to Browse items from there to
> > > > Shopping
> > > > cart and so on. This from a.tml to b.tml from b.tml to c.tml.
> > > >
> > > > This approach is somewhat clumsy when it comes to a portal-like
> > > > scenario
> > > > where there is no longer a "browse items" "page" but rather the user
> > > > is
> > > > manipulating components (like clicking on a voter component to show
> > > > the
> > > > results or clicking on a "top 10 news" component to load one news
> > > > into the
> > > > "workspace area"). Here the notion of a "page" is no longer really
> > > > meaningful. What you have is a few templates (which specify the
> > > > layout and
> > > > design) and you'd like to manipulate (load and manage state of)
> > > > components
> > > > dynamically.
> > > >
> > > > I hope I could make my approach clear enough :)
> > > >
> > > > Cheers,
> > > > Janos
> > > >
> > > >
> > >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: include

Posted by János Jarecsni <ja...@gmail.com>.
Hi Michael,

thanks, you're right, experience with other technologies can be misleading
when learning a new one, especially when the two things are not the same
kind. The hint on ComponentPageElement sounds really promising! I will study
this, and will come back my results!

Thanks again!
Cheers,
janos

On 16/04/2008, Michael Gerzabek <mi...@gmx.net> wrote:
>
> Hi János,
>
> In your very first mail 2 days ago you say "I'm new to Tapestry technology
> and to this mailing list". I think though I played around with T5 quite some
> time I'm also new to it. So please don't take my word to be the final truth.
> I think there is a simple solution to your problem. Look into
> ComponentPageElement [1]. You can get it via PagePool that you Inject into
> your page.
>
> I also suggest to look into the docs on the concepts of T5. They are quite
> well documented and VERY powerful. I say this because I realized that
> applying thinking patterns originated in the past (JSP, Struts, etc.) might
> not be as helpful in learning a new technology than reading and applying the
> actual docs are. Speaking from my own experiences here.
>
> Regards,
> Michael
>
> [1]
> http://tapestry.formos.com/nightly/tapestry5/apidocs/org/apache/tapestry/internal/structure/ComponentPageElement.html
>
> I would suggest before you go into in-depth application writing
>
> Jarecsni schrieb:
>
> > And one really last thing :) I had a shallow look at wicket to check
> > this
> > feature... There should be some common unconscious conceptual path here,
> > as
> > wicket too misses this. All it has is an Include component to include
> > non-wicket (! :D) content. Why these frameworks are so much reluctant to
> > this? :)
> >
> > J
> >
> > On 16/04/2008, János Jarecsni <ja...@gmail.com> wrote:
> >
> >
> > > One more thing... although Tapestry is component oriented (which is a
> > > goood thing :)), this kind of flexibility (dynamic template
> > > generation)
> > > which is available in JSP is an essential feature to be really
> > > flexible. A
> > > templating framework should allow this level of redirection, or
> > > abstraction,
> > > that the templates are dynamically produced driven by runtime
> > > conditions or
> > > configuration. Otherwise we get a very intelligent and elegant HTML
> > > (in
> > > terms of this kind of staticness). Sorry for the lengthy arguing, but
> > > I
> > > think this issue is vital for Tapestry too (not just me :))
> > >
> > > Cheers,
> > > Janos
> > >
> > > On 16/04/2008, János Jarecsni <ja...@gmail.com> wrote:
> > >
> > >
> > > > Yes, I felt this too :) However, this is no special usage scenario I
> > > > would say, just a bit different usage pattern that calls for a
> > > > different
> > > > approach. As I see now, the Tapestry framework is well suited to
> > > > sites,
> > > > where the user travels from Login to Browse items from there to
> > > > Shopping
> > > > cart and so on. This from a.tml to b.tml from b.tml to c.tml.
> > > >
> > > > This approach is somewhat clumsy when it comes to a portal-like
> > > > scenario
> > > > where there is no longer a "browse items" "page" but rather the user
> > > > is
> > > > manipulating components (like clicking on a voter component to show
> > > > the
> > > > results or clicking on a "top 10 news" component to load one news
> > > > into the
> > > > "workspace area"). Here the notion of a "page" is no longer really
> > > > meaningful. What you have is a few templates (which specify the
> > > > layout and
> > > > design) and you'd like to manipulate (load and manage state of)
> > > > components
> > > > dynamically.
> > > >
> > > > I hope I could make my approach clear enough :)
> > > >
> > > > Cheers,
> > > > Janos
> > > >
> > > >
> > >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: include

Posted by Michael Gerzabek <mi...@gmx.net>.
Hi János,

In your very first mail 2 days ago you say "I'm new to Tapestry 
technology and to this mailing list". I think though I played around 
with T5 quite some time I'm also new to it. So please don't take my word 
to be the final truth. I think there is a simple solution to your 
problem. Look into ComponentPageElement [1]. You can get it via PagePool 
that you Inject into your page.

I also suggest to look into the docs on the concepts of T5. They are 
quite well documented and VERY powerful. I say this because I realized 
that applying thinking patterns originated in the past (JSP, Struts, 
etc.) might not be as helpful in learning a new technology than reading 
and applying the actual docs are. Speaking from my own experiences here.

Regards,
Michael

[1] 
http://tapestry.formos.com/nightly/tapestry5/apidocs/org/apache/tapestry/internal/structure/ComponentPageElement.html

I would suggest before you go into in-depth application writing

Jarecsni schrieb:
> And one really last thing :) I had a shallow look at wicket to check this
> feature... There should be some common unconscious conceptual path here, as
> wicket too misses this. All it has is an Include component to include
> non-wicket (! :D) content. Why these frameworks are so much reluctant to
> this? :)
>
> J
>
> On 16/04/2008, János Jarecsni <ja...@gmail.com> wrote:
>   
>> One more thing... although Tapestry is component oriented (which is a
>> goood thing :)), this kind of flexibility (dynamic template generation)
>> which is available in JSP is an essential feature to be really flexible. A
>> templating framework should allow this level of redirection, or abstraction,
>> that the templates are dynamically produced driven by runtime conditions or
>> configuration. Otherwise we get a very intelligent and elegant HTML (in
>> terms of this kind of staticness). Sorry for the lengthy arguing, but I
>> think this issue is vital for Tapestry too (not just me :))
>>
>> Cheers,
>> Janos
>>
>> On 16/04/2008, János Jarecsni <ja...@gmail.com> wrote:
>>     
>>> Yes, I felt this too :) However, this is no special usage scenario I
>>> would say, just a bit different usage pattern that calls for a different
>>> approach. As I see now, the Tapestry framework is well suited to sites,
>>> where the user travels from Login to Browse items from there to Shopping
>>> cart and so on. This from a.tml to b.tml from b.tml to c.tml.
>>>
>>> This approach is somewhat clumsy when it comes to a portal-like scenario
>>> where there is no longer a "browse items" "page" but rather the user is
>>> manipulating components (like clicking on a voter component to show the
>>> results or clicking on a "top 10 news" component to load one news into the
>>> "workspace area"). Here the notion of a "page" is no longer really
>>> meaningful. What you have is a few templates (which specify the layout and
>>> design) and you'd like to manipulate (load and manage state of) components
>>> dynamically.
>>>
>>> I hope I could make my approach clear enough :)
>>>
>>> Cheers,
>>> Janos
>>>       


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


Re: include

Posted by János Jarecsni <ja...@gmail.com>.
And one really last thing :) I had a shallow look at wicket to check this
feature... There should be some common unconscious conceptual path here, as
wicket too misses this. All it has is an Include component to include
non-wicket (! :D) content. Why these frameworks are so much reluctant to
this? :)

J

On 16/04/2008, János Jarecsni <ja...@gmail.com> wrote:
>
> One more thing... although Tapestry is component oriented (which is a
> goood thing :)), this kind of flexibility (dynamic template generation)
> which is available in JSP is an essential feature to be really flexible. A
> templating framework should allow this level of redirection, or abstraction,
> that the templates are dynamically produced driven by runtime conditions or
> configuration. Otherwise we get a very intelligent and elegant HTML (in
> terms of this kind of staticness). Sorry for the lengthy arguing, but I
> think this issue is vital for Tapestry too (not just me :))
>
> Cheers,
> Janos
>
> On 16/04/2008, János Jarecsni <ja...@gmail.com> wrote:
> >
> > Yes, I felt this too :) However, this is no special usage scenario I
> > would say, just a bit different usage pattern that calls for a different
> > approach. As I see now, the Tapestry framework is well suited to sites,
> > where the user travels from Login to Browse items from there to Shopping
> > cart and so on. This from a.tml to b.tml from b.tml to c.tml.
> >
> > This approach is somewhat clumsy when it comes to a portal-like scenario
> > where there is no longer a "browse items" "page" but rather the user is
> > manipulating components (like clicking on a voter component to show the
> > results or clicking on a "top 10 news" component to load one news into the
> > "workspace area"). Here the notion of a "page" is no longer really
> > meaningful. What you have is a few templates (which specify the layout and
> > design) and you'd like to manipulate (load and manage state of) components
> > dynamically.
> >
> > I hope I could make my approach clear enough :)
> >
> > Cheers,
> > Janos
> >
> > On 16/04/2008, Josh Canfield <jo...@thedailytube.com> wrote:
> > >
> > > > My intention is to move away from the page-centric
> > > > approach of Tapestry toward this more dynamic strategy
> > >
> > >
> > > :) I think the statement above says it all. When you try to "move
> > > away" from the core approach of a framework then you're asking for a
> > > challenge.
> > >
> > > If you don't mind sharing, what's your usecase? Why won't configurable
> > > components suite your need? Are you wanting to pull portions of the
> > > templates from a database?
> > >
> > > Josh
> > >
> > > On Tue, Apr 15, 2008 at 1:43 PM, János Jarecsni
> > >
> > > <ja...@gmail.com> wrote:
> > > > Hi Josh,
> > > >
> > > > hm, this would be a pity... it is relatively easy to imagine a
> > > scenario
> > > > where the component should be "lately bound", I mean resolved only
> > > at
> > > > runtime. I can imagine generic TMLs which only specify placeholders
> > > for
> > > > components, and it depends on some configuration what components to
> > > link
> > > > into those placeholders. My intention is to move away from the
> > > page-centric
> > > > approach of Tapestry toward this more dynamic strategy, where the
> > > page tml
> > > > works as a generic template. Hope this is possible somehow... In the
> > > worst
> > > > case I will compile the TML on the fly using JSP and then forward to
> > > > Tapestry? Uh hah :)
> > > >
> > > > Thanks for the reply!
> > > > Janos
> > > >
> > > >
> > > > On 15/04/2008, Josh Canfield <jo...@thedailytube.com> wrote:
> > > > >
> > > > > Tapestry wants to know about all the components that a page is
> > > going
> > > > > to render up front. If you want to dynamcially include a component
> > > > > you'll have to include that component in the template somewhere so
> > > > > that you can get a handle to it.
> > > > >
> > > > > For instance, you can have a component that has:
> > > > >
> > > > > <t:delegate to="footerBlock"/>
> > > > >
> > > > > <t:block id="footerWhite">
> > > > > <t:myWhiteFooter/>
> > > > > </t:block>
> > > > >
> > > > > <t:block id="footerRed">
> > > > > <t:myRedFooter/>
> > > > > </t:block>
> > > > >
> > > > > then in your component class you can implement
> > > > >
> > > > > @Parameter
> > > > > private String _color;
> > > > >
> > > > > @Inject
> > > > > private Block footerWhite;
> > > > >
> > > > > @Inject
> > > > > private Block footerRed;
> > > > >
> > > > > Block getFooterBlock() {
> > > > > if ( _color.equals("white") ) {
> > > > >   return footerWhite;
> > > > > } else {
> > > > >   return footerRed;
> > > > > }
> > > > >
> > > > > I'm don't know of a way to iterate over all the blocks contained
> > > in a
> > > > > component...
> > > > >
> > > > > Josh
> > > > >
> > > > > On Tue, Apr 15, 2008 at 1:10 PM, János Jarecsni
> > > > >
> > > > > <ja...@gmail.com> wrote:
> > > > >
> > > > > > Hi again,
> > > > > >
> > > > > > is there a way for a little bit more dynamic inclusion of a
> > > component?
> > > > > >
> > > > > > Say instead of <t:footer/> I'd like to iterate through a
> > > registry of
> > > > > > components and include some of them in a page, like:
> > > > > >
> > > > > > <t:include-component t:id="someValue"/> (someValue is not a
> > > literal).
> > > > > >
> > > > > > It would be vital for what I'm up to :)
> > > > > >
> > > > > >
> > > > > > Thanks again
> > > > > > Janos
> > > > > >
> > > > > >
> > > > > > On 14/04/2008, Michael Gerzabek <mi...@gmx.net>
> > > wrote:
> > > > > > >
> > > > > > > Then I was to fast too! ;-)
> > > > > > >
> > > > > > > Michael Gerzabek schrieb:
> > > > > > >
> > > > > > > > Hi Janos,
> > > > > > > >
> > > > > > > > Could you elaborate a little bit more on what you wanna do?
> > > > > > > >
> > > > > > > > Have a look at the basic principles of T5 [1], especially
> > > Principle
> > > > > #1
> > > > > > > > might be of interest for you.
> > > > > > > >
> > > > > > > > Maybe you are just looking on how create dynamic layouts
> > > then go to
> > > > > the
> > > > > > > > mailing list with keywords dynamic and static [2].
> > > > > > > >
> > > > > > > > Not sure this helps,
> > > > > > > > Michael
> > > > > > > >
> > > > > > > > [1] http://tapestry.apache.org/tapestry5/
> > > > > > > > [2]
> > > > > > > >
> > > > >
> > > http://www.nabble.com/forum/Search.jtp?query=T5+static+dynamic&local=y&forum=340&daterange=0&startdate=&enddate=
> > > > > > > >
> > > > > > > >
> > > > > > > > János Jarecsni schrieb:
> > > > > > > >
> > > > > > > > > Hi All,
> > > > > > > > >
> > > > > > > > > I'm new to Tapestry technology and to this mailing list,
> > > and I
> > > > > have a
> > > > > > > > > question. I'd like to "dynamically" create .TMLs... So
> > > instead of
> > > > > > > > > having
> > > > > > > > > static pages (Start.tml, Login.tml), I'd like to construct
> > > > > Tapestry
> > > > > > > > > pages on
> > > > > > > > > the fly (by including page parts, which are other .tmls).
> > > I've
> > > > > been
> > > > > > > > > looking
> > > > > > > > > for some "include" component whatsoever, but found
> > > nothing. Except
> > > > > for
> > > > > > > > > the
> > > > > > > > > PageLayout component, which does something similar, just
> > > the other
> > > > > way
> > > > > > > > > around. Could you point me to some workaround or existing
> > > > > solution?
> > > > > > > > >
> > > > > > > > > Cheers
> > > > > > > > > Janos
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > >
> > > ---------------------------------------------------------------------
> > > > > > > > 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
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > >
> > > > > --
> > > > > TheDailyTube.com. Sign up and get the best new videos on the
> > > internet
> > > > > delivered fresh to your inbox.
> > > > >
> > > > >
> > > > >
> > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > >
> > > --
> > >
> > > --
> > > TheDailyTube.com. Sign up and get the best new videos on the internet
> > > delivered fresh to your inbox.
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> >
>

Re: include

Posted by János Jarecsni <ja...@gmail.com>.
One more thing... although Tapestry is component oriented (which is a goood
thing :)), this kind of flexibility (dynamic template generation) which is
available in JSP is an essential feature to be really flexible. A templating
framework should allow this level of redirection, or abstraction, that the
templates are dynamically produced driven by runtime conditions or
configuration. Otherwise we get a very intelligent and elegant HTML (in
terms of this kind of staticness). Sorry for the lengthy arguing, but I
think this issue is vital for Tapestry too (not just me :))

Cheers,
Janos

On 16/04/2008, János Jarecsni <ja...@gmail.com> wrote:
>
> Yes, I felt this too :) However, this is no special usage scenario I would
> say, just a bit different usage pattern that calls for a different approach.
> As I see now, the Tapestry framework is well suited to sites, where the user
> travels from Login to Browse items from there to Shopping cart and so on.
> This from a.tml to b.tml from b.tml to c.tml.
>
> This approach is somewhat clumsy when it comes to a portal-like scenario
> where there is no longer a "browse items" "page" but rather the user is
> manipulating components (like clicking on a voter component to show the
> results or clicking on a "top 10 news" component to load one news into the
> "workspace area"). Here the notion of a "page" is no longer really
> meaningful. What you have is a few templates (which specify the layout and
> design) and you'd like to manipulate (load and manage state of) components
> dynamically.
>
> I hope I could make my approach clear enough :)
>
> Cheers,
> Janos
>
> On 16/04/2008, Josh Canfield <jo...@thedailytube.com> wrote:
> >
> > > My intention is to move away from the page-centric
> > > approach of Tapestry toward this more dynamic strategy
> >
> >
> > :) I think the statement above says it all. When you try to "move
> > away" from the core approach of a framework then you're asking for a
> > challenge.
> >
> > If you don't mind sharing, what's your usecase? Why won't configurable
> > components suite your need? Are you wanting to pull portions of the
> > templates from a database?
> >
> > Josh
> >
> > On Tue, Apr 15, 2008 at 1:43 PM, János Jarecsni
> >
> > <ja...@gmail.com> wrote:
> > > Hi Josh,
> > >
> > > hm, this would be a pity... it is relatively easy to imagine a
> > scenario
> > > where the component should be "lately bound", I mean resolved only at
> > > runtime. I can imagine generic TMLs which only specify placeholders
> > for
> > > components, and it depends on some configuration what components to
> > link
> > > into those placeholders. My intention is to move away from the
> > page-centric
> > > approach of Tapestry toward this more dynamic strategy, where the page
> > tml
> > > works as a generic template. Hope this is possible somehow... In the
> > worst
> > > case I will compile the TML on the fly using JSP and then forward to
> > > Tapestry? Uh hah :)
> > >
> > > Thanks for the reply!
> > > Janos
> > >
> > >
> > > On 15/04/2008, Josh Canfield <jo...@thedailytube.com> wrote:
> > > >
> > > > Tapestry wants to know about all the components that a page is going
> > > > to render up front. If you want to dynamcially include a component
> > > > you'll have to include that component in the template somewhere so
> > > > that you can get a handle to it.
> > > >
> > > > For instance, you can have a component that has:
> > > >
> > > > <t:delegate to="footerBlock"/>
> > > >
> > > > <t:block id="footerWhite">
> > > > <t:myWhiteFooter/>
> > > > </t:block>
> > > >
> > > > <t:block id="footerRed">
> > > > <t:myRedFooter/>
> > > > </t:block>
> > > >
> > > > then in your component class you can implement
> > > >
> > > > @Parameter
> > > > private String _color;
> > > >
> > > > @Inject
> > > > private Block footerWhite;
> > > >
> > > > @Inject
> > > > private Block footerRed;
> > > >
> > > > Block getFooterBlock() {
> > > > if ( _color.equals("white") ) {
> > > >   return footerWhite;
> > > > } else {
> > > >   return footerRed;
> > > > }
> > > >
> > > > I'm don't know of a way to iterate over all the blocks contained in
> > a
> > > > component...
> > > >
> > > > Josh
> > > >
> > > > On Tue, Apr 15, 2008 at 1:10 PM, János Jarecsni
> > > >
> > > > <ja...@gmail.com> wrote:
> > > >
> > > > > Hi again,
> > > > >
> > > > > is there a way for a little bit more dynamic inclusion of a
> > component?
> > > > >
> > > > > Say instead of <t:footer/> I'd like to iterate through a registry
> > of
> > > > > components and include some of them in a page, like:
> > > > >
> > > > > <t:include-component t:id="someValue"/> (someValue is not a
> > literal).
> > > > >
> > > > > It would be vital for what I'm up to :)
> > > > >
> > > > >
> > > > > Thanks again
> > > > > Janos
> > > > >
> > > > >
> > > > > On 14/04/2008, Michael Gerzabek <mi...@gmx.net> wrote:
> > > > > >
> > > > > > Then I was to fast too! ;-)
> > > > > >
> > > > > > Michael Gerzabek schrieb:
> > > > > >
> > > > > > > Hi Janos,
> > > > > > >
> > > > > > > Could you elaborate a little bit more on what you wanna do?
> > > > > > >
> > > > > > > Have a look at the basic principles of T5 [1], especially
> > Principle
> > > > #1
> > > > > > > might be of interest for you.
> > > > > > >
> > > > > > > Maybe you are just looking on how create dynamic layouts then
> > go to
> > > > the
> > > > > > > mailing list with keywords dynamic and static [2].
> > > > > > >
> > > > > > > Not sure this helps,
> > > > > > > Michael
> > > > > > >
> > > > > > > [1] http://tapestry.apache.org/tapestry5/
> > > > > > > [2]
> > > > > > >
> > > >
> > http://www.nabble.com/forum/Search.jtp?query=T5+static+dynamic&local=y&forum=340&daterange=0&startdate=&enddate=
> > > > > > >
> > > > > > >
> > > > > > > János Jarecsni schrieb:
> > > > > > >
> > > > > > > > Hi All,
> > > > > > > >
> > > > > > > > I'm new to Tapestry technology and to this mailing list, and
> > I
> > > > have a
> > > > > > > > question. I'd like to "dynamically" create .TMLs... So
> > instead of
> > > > > > > > having
> > > > > > > > static pages (Start.tml, Login.tml), I'd like to construct
> > > > Tapestry
> > > > > > > > pages on
> > > > > > > > the fly (by including page parts, which are other .tmls).
> > I've
> > > > been
> > > > > > > > looking
> > > > > > > > for some "include" component whatsoever, but found nothing.
> > Except
> > > > for
> > > > > > > > the
> > > > > > > > PageLayout component, which does something similar, just the
> > other
> > > > way
> > > > > > > > around. Could you point me to some workaround or existing
> > > > solution?
> > > > > > > >
> > > > > > > > Cheers
> > > > > > > > Janos
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > > > 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
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > >
> > > > --
> > > > TheDailyTube.com. Sign up and get the best new videos on the
> > internet
> > > > delivered fresh to your inbox.
> > > >
> > > >
> > > >
> > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > >
> > > >
> > >
> >
> >
> >
> >
> > --
> >
> > --
> > TheDailyTube.com. Sign up and get the best new videos on the internet
> > delivered fresh to your inbox.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>

Re: include

Posted by János Jarecsni <ja...@gmail.com>.
Yes, I felt this too :) However, this is no special usage scenario I would
say, just a bit different usage pattern that calls for a different approach.
As I see now, the Tapestry framework is well suited to sites, where the user
travels from Login to Browse items from there to Shopping cart and so on.
This from a.tml to b.tml from b.tml to c.tml.

This approach is somewhat clumsy when it comes to a portal-like scenario
where there is no longer a "browse items" "page" but rather the user is
manipulating components (like clicking on a voter component to show the
results or clicking on a "top 10 news" component to load one news into the
"workspace area"). Here the notion of a "page" is no longer really
meaningful. What you have is a few templates (which specify the layout and
design) and you'd like to manipulate (load and manage state of) components
dynamically.

I hope I could make my approach clear enough :)

Cheers,
Janos

On 16/04/2008, Josh Canfield <jo...@thedailytube.com> wrote:
>
> > My intention is to move away from the page-centric
> > approach of Tapestry toward this more dynamic strategy
>
>
> :) I think the statement above says it all. When you try to "move
> away" from the core approach of a framework then you're asking for a
> challenge.
>
> If you don't mind sharing, what's your usecase? Why won't configurable
> components suite your need? Are you wanting to pull portions of the
> templates from a database?
>
> Josh
>
> On Tue, Apr 15, 2008 at 1:43 PM, János Jarecsni
>
> <ja...@gmail.com> wrote:
> > Hi Josh,
> >
> > hm, this would be a pity... it is relatively easy to imagine a scenario
> > where the component should be "lately bound", I mean resolved only at
> > runtime. I can imagine generic TMLs which only specify placeholders for
> > components, and it depends on some configuration what components to link
> > into those placeholders. My intention is to move away from the
> page-centric
> > approach of Tapestry toward this more dynamic strategy, where the page
> tml
> > works as a generic template. Hope this is possible somehow... In the
> worst
> > case I will compile the TML on the fly using JSP and then forward to
> > Tapestry? Uh hah :)
> >
> > Thanks for the reply!
> > Janos
> >
> >
> > On 15/04/2008, Josh Canfield <jo...@thedailytube.com> wrote:
> > >
> > > Tapestry wants to know about all the components that a page is going
> > > to render up front. If you want to dynamcially include a component
> > > you'll have to include that component in the template somewhere so
> > > that you can get a handle to it.
> > >
> > > For instance, you can have a component that has:
> > >
> > > <t:delegate to="footerBlock"/>
> > >
> > > <t:block id="footerWhite">
> > > <t:myWhiteFooter/>
> > > </t:block>
> > >
> > > <t:block id="footerRed">
> > > <t:myRedFooter/>
> > > </t:block>
> > >
> > > then in your component class you can implement
> > >
> > > @Parameter
> > > private String _color;
> > >
> > > @Inject
> > > private Block footerWhite;
> > >
> > > @Inject
> > > private Block footerRed;
> > >
> > > Block getFooterBlock() {
> > > if ( _color.equals("white") ) {
> > >   return footerWhite;
> > > } else {
> > >   return footerRed;
> > > }
> > >
> > > I'm don't know of a way to iterate over all the blocks contained in a
> > > component...
> > >
> > > Josh
> > >
> > > On Tue, Apr 15, 2008 at 1:10 PM, János Jarecsni
> > >
> > > <ja...@gmail.com> wrote:
> > >
> > > > Hi again,
> > > >
> > > > is there a way for a little bit more dynamic inclusion of a
> component?
> > > >
> > > > Say instead of <t:footer/> I'd like to iterate through a registry of
> > > > components and include some of them in a page, like:
> > > >
> > > > <t:include-component t:id="someValue"/> (someValue is not a
> literal).
> > > >
> > > > It would be vital for what I'm up to :)
> > > >
> > > >
> > > > Thanks again
> > > > Janos
> > > >
> > > >
> > > > On 14/04/2008, Michael Gerzabek <mi...@gmx.net> wrote:
> > > > >
> > > > > Then I was to fast too! ;-)
> > > > >
> > > > > Michael Gerzabek schrieb:
> > > > >
> > > > > > Hi Janos,
> > > > > >
> > > > > > Could you elaborate a little bit more on what you wanna do?
> > > > > >
> > > > > > Have a look at the basic principles of T5 [1], especially
> Principle
> > > #1
> > > > > > might be of interest for you.
> > > > > >
> > > > > > Maybe you are just looking on how create dynamic layouts then go
> to
> > > the
> > > > > > mailing list with keywords dynamic and static [2].
> > > > > >
> > > > > > Not sure this helps,
> > > > > > Michael
> > > > > >
> > > > > > [1] http://tapestry.apache.org/tapestry5/
> > > > > > [2]
> > > > > >
> > >
> http://www.nabble.com/forum/Search.jtp?query=T5+static+dynamic&local=y&forum=340&daterange=0&startdate=&enddate=
> > > > > >
> > > > > >
> > > > > > János Jarecsni schrieb:
> > > > > >
> > > > > > > Hi All,
> > > > > > >
> > > > > > > I'm new to Tapestry technology and to this mailing list, and I
> > > have a
> > > > > > > question. I'd like to "dynamically" create .TMLs... So instead
> of
> > > > > > > having
> > > > > > > static pages (Start.tml, Login.tml), I'd like to construct
> > > Tapestry
> > > > > > > pages on
> > > > > > > the fly (by including page parts, which are other .tmls). I've
> > > been
> > > > > > > looking
> > > > > > > for some "include" component whatsoever, but found nothing.
> Except
> > > for
> > > > > > > the
> > > > > > > PageLayout component, which does something similar, just the
> other
> > > way
> > > > > > > around. Could you point me to some workaround or existing
> > > solution?
> > > > > > >
> > > > > > > Cheers
> > > > > > > Janos
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > ---------------------------------------------------------------------
> > > > > > 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
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > >
> > > --
> > >
> > > --
> > > TheDailyTube.com. Sign up and get the best new videos on the internet
> > > delivered fresh to your inbox.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> >
>
>
>
>
> --
>
> --
> TheDailyTube.com. Sign up and get the best new videos on the internet
> delivered fresh to your inbox.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: include

Posted by Josh Canfield <jo...@thedailytube.com>.
> My intention is to move away from the page-centric
> approach of Tapestry toward this more dynamic strategy

:) I think the statement above says it all. When you try to "move
away" from the core approach of a framework then you're asking for a
challenge.

If you don't mind sharing, what's your usecase? Why won't configurable
components suite your need? Are you wanting to pull portions of the
templates from a database?

Josh

On Tue, Apr 15, 2008 at 1:43 PM, János Jarecsni
<ja...@gmail.com> wrote:
> Hi Josh,
>
> hm, this would be a pity... it is relatively easy to imagine a scenario
> where the component should be "lately bound", I mean resolved only at
> runtime. I can imagine generic TMLs which only specify placeholders for
> components, and it depends on some configuration what components to link
> into those placeholders. My intention is to move away from the page-centric
> approach of Tapestry toward this more dynamic strategy, where the page tml
> works as a generic template. Hope this is possible somehow... In the worst
> case I will compile the TML on the fly using JSP and then forward to
> Tapestry? Uh hah :)
>
> Thanks for the reply!
> Janos
>
>
> On 15/04/2008, Josh Canfield <jo...@thedailytube.com> wrote:
> >
> > Tapestry wants to know about all the components that a page is going
> > to render up front. If you want to dynamcially include a component
> > you'll have to include that component in the template somewhere so
> > that you can get a handle to it.
> >
> > For instance, you can have a component that has:
> >
> > <t:delegate to="footerBlock"/>
> >
> > <t:block id="footerWhite">
> > <t:myWhiteFooter/>
> > </t:block>
> >
> > <t:block id="footerRed">
> > <t:myRedFooter/>
> > </t:block>
> >
> > then in your component class you can implement
> >
> > @Parameter
> > private String _color;
> >
> > @Inject
> > private Block footerWhite;
> >
> > @Inject
> > private Block footerRed;
> >
> > Block getFooterBlock() {
> > if ( _color.equals("white") ) {
> >   return footerWhite;
> > } else {
> >   return footerRed;
> > }
> >
> > I'm don't know of a way to iterate over all the blocks contained in a
> > component...
> >
> > Josh
> >
> > On Tue, Apr 15, 2008 at 1:10 PM, János Jarecsni
> >
> > <ja...@gmail.com> wrote:
> >
> > > Hi again,
> > >
> > > is there a way for a little bit more dynamic inclusion of a component?
> > >
> > > Say instead of <t:footer/> I'd like to iterate through a registry of
> > > components and include some of them in a page, like:
> > >
> > > <t:include-component t:id="someValue"/> (someValue is not a literal).
> > >
> > > It would be vital for what I'm up to :)
> > >
> > >
> > > Thanks again
> > > Janos
> > >
> > >
> > > On 14/04/2008, Michael Gerzabek <mi...@gmx.net> wrote:
> > > >
> > > > Then I was to fast too! ;-)
> > > >
> > > > Michael Gerzabek schrieb:
> > > >
> > > > > Hi Janos,
> > > > >
> > > > > Could you elaborate a little bit more on what you wanna do?
> > > > >
> > > > > Have a look at the basic principles of T5 [1], especially Principle
> > #1
> > > > > might be of interest for you.
> > > > >
> > > > > Maybe you are just looking on how create dynamic layouts then go to
> > the
> > > > > mailing list with keywords dynamic and static [2].
> > > > >
> > > > > Not sure this helps,
> > > > > Michael
> > > > >
> > > > > [1] http://tapestry.apache.org/tapestry5/
> > > > > [2]
> > > > >
> > http://www.nabble.com/forum/Search.jtp?query=T5+static+dynamic&local=y&forum=340&daterange=0&startdate=&enddate=
> > > > >
> > > > >
> > > > > János Jarecsni schrieb:
> > > > >
> > > > > > Hi All,
> > > > > >
> > > > > > I'm new to Tapestry technology and to this mailing list, and I
> > have a
> > > > > > question. I'd like to "dynamically" create .TMLs... So instead of
> > > > > > having
> > > > > > static pages (Start.tml, Login.tml), I'd like to construct
> > Tapestry
> > > > > > pages on
> > > > > > the fly (by including page parts, which are other .tmls). I've
> > been
> > > > > > looking
> > > > > > for some "include" component whatsoever, but found nothing. Except
> > for
> > > > > > the
> > > > > > PageLayout component, which does something similar, just the other
> > way
> > > > > > around. Could you point me to some workaround or existing
> > solution?
> > > > > >
> > > > > > Cheers
> > > > > > Janos
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > 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
> > > >
> > > >
> > >
> >
> >
> >
> >
> > --
> >
> > --
> > TheDailyTube.com. Sign up and get the best new videos on the internet
> > delivered fresh to your inbox.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>



-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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


Re: include

Posted by nicholas Krul <ni...@gmail.com>.
Wasn't there something about being able to push components onto the render
stack at runtime?

ahh:
http://www.nabble.com/T5%3A-Pushing-Multiple-Components-into-Render-Queue-td16699167.html#a16706639

might help. on thet5 website there are page lifecycle methods, I guess you
hook in there (renderBody?)

All my stuff is pretty straight forwards, so I really don't see why you
can't use joshes example... but requirements are requirements.

good luck

On Tue, Apr 15, 2008 at 9:56 PM, Adam Zimowski <zi...@gmail.com> wrote:

> If you succeed with that, could you share it with the list? I'd also
> be very interested in something like this. Perhpas it could be the
> start to a useful 3rd party lib.
>
> On Tue, Apr 15, 2008 at 3:47 PM, János Jarecsni
> <ja...@gmail.com> wrote:
> > "In the worst case I will compile the TML on the fly using JSP and then
> >  forward to Tapestry"
> >
> >  I mean I will use JSP to _generate_ the TML (my use of the word compile
> may
> >  not be the best here :))
> >
> >  Cheers,
> >  Janos
> >
> >
> >
> >  On 15/04/2008, János Jarecsni <ja...@gmail.com> wrote:
> >  >
> >  > Hi Josh,
> >  >
> >  > hm, this would be a pity... it is relatively easy to imagine a
> scenario
> >  > where the component should be "lately bound", I mean resolved only at
> >  > runtime. I can imagine generic TMLs which only specify placeholders
> for
> >  > components, and it depends on some configuration what components to
> link
> >  > into those placeholders. My intention is to move away from the
> page-centric
> >  > approach of Tapestry toward this more dynamic strategy, where the
> page tml
> >  > works as a generic template. Hope this is possible somehow... In the
> worst
> >  > case I will compile the TML on the fly using JSP and then forward to
> >  > Tapestry? Uh hah :)
> >  >
> >  > Thanks for the reply!
> >  > Janos
> >  >
> >  > On 15/04/2008, Josh Canfield <jo...@thedailytube.com> wrote:
> >  > >
> >  > > Tapestry wants to know about all the components that a page is
> going
> >  > > to render up front. If you want to dynamcially include a component
> >  > > you'll have to include that component in the template somewhere so
> >  > > that you can get a handle to it.
> >  > >
> >  > > For instance, you can have a component that has:
> >  > >
> >  > > <t:delegate to="footerBlock"/>
> >  > >
> >  > > <t:block id="footerWhite">
> >  > > <t:myWhiteFooter/>
> >  > > </t:block>
> >  > >
> >  > > <t:block id="footerRed">
> >  > > <t:myRedFooter/>
> >  > > </t:block>
> >  > >
> >  > > then in your component class you can implement
> >  > >
> >  > > @Parameter
> >  > > private String _color;
> >  > >
> >  > > @Inject
> >  > > private Block footerWhite;
> >  > >
> >  > > @Inject
> >  > > private Block footerRed;
> >  > >
> >  > > Block getFooterBlock() {
> >  > > if ( _color.equals("white") ) {
> >  > >   return footerWhite;
> >  > > } else {
> >  > >   return footerRed;
> >  > > }
> >  > >
> >  > > I'm don't know of a way to iterate over all the blocks contained in
> a
> >  > > component...
> >  > >
> >  > > Josh
> >  > >
> >  > > On Tue, Apr 15, 2008 at 1:10 PM, János Jarecsni
> >  > >
> >  > > <ja...@gmail.com> wrote:
> >  > >
> >  > > > Hi again,
> >  > > >
> >  > > > is there a way for a little bit more dynamic inclusion of a
> component?
> >  > > >
> >  > > > Say instead of <t:footer/> I'd like to iterate through a registry
> of
> >  > > > components and include some of them in a page, like:
> >  > > >
> >  > > > <t:include-component t:id="someValue"/> (someValue is not a
> literal).
> >  > > >
> >  > > > It would be vital for what I'm up to :)
> >  > > >
> >  > > >
> >  > > > Thanks again
> >  > > > Janos
> >  > > >
> >  > > >
> >  > > > On 14/04/2008, Michael Gerzabek <mi...@gmx.net> wrote:
> >  > > > >
> >  > > > > Then I was to fast too! ;-)
> >  > > > >
> >  > > > > Michael Gerzabek schrieb:
> >  > > > >
> >  > > > > > Hi Janos,
> >  > > > > >
> >  > > > > > Could you elaborate a little bit more on what you wanna do?
> >  > > > > >
> >  > > > > > Have a look at the basic principles of T5 [1], especially
> >  > > Principle #1
> >  > > > > > might be of interest for you.
> >  > > > > >
> >  > > > > > Maybe you are just looking on how create dynamic layouts then
> go
> >  > > to the
> >  > > > > > mailing list with keywords dynamic and static [2].
> >  > > > > >
> >  > > > > > Not sure this helps,
> >  > > > > > Michael
> >  > > > > >
> >  > > > > > [1] http://tapestry.apache.org/tapestry5/
> >  > > > > > [2]
> >  > > > > >
> >  > >
> http://www.nabble.com/forum/Search.jtp?query=T5+static+dynamic&local=y&forum=340&daterange=0&startdate=&enddate=
> >  > > > > >
> >  > > > > >
> >  > > > > > János Jarecsni schrieb:
> >  > > > > >
> >  > > > > > > Hi All,
> >  > > > > > >
> >  > > > > > > I'm new to Tapestry technology and to this mailing list,
> and I
> >  > > have a
> >  > > > > > > question. I'd like to "dynamically" create .TMLs... So
> instead
> >  > > of
> >  > > > > > > having
> >  > > > > > > static pages (Start.tml, Login.tml), I'd like to construct
> >  > > Tapestry
> >  > > > > > > pages on
> >  > > > > > > the fly (by including page parts, which are other .tmls).
> I've
> >  > > been
> >  > > > > > > looking
> >  > > > > > > for some "include" component whatsoever, but found nothing.
> >  > > Except for
> >  > > > > > > the
> >  > > > > > > PageLayout component, which does something similar, just
> the
> >  > > other way
> >  > > > > > > around. Could you point me to some workaround or existing
> >  > > solution?
> >  > > > > > >
> >  > > > > > > Cheers
> >  > > > > > > Janos
> >  > > > > > >
> >  > > > > > >
> >  > > > > > >
> >  > > > > >
> >  > > > > >
> >  > > > > >
> >  > >
> ---------------------------------------------------------------------
> >  > > > > > 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
> >  > > > >
> >  > > > >
> >  > > >
> >  > >
> >  > >
> >  > >
> >  > >
> >  > > --
> >  > >
> >  > > --
> >  > > TheDailyTube.com. Sign up and get the best new videos on the
> internet
> >  > > delivered fresh to your inbox.
> >  > >
> >  > >
> >  > >
> ---------------------------------------------------------------------
> >  > > 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: include

Posted by Adam Zimowski <zi...@gmail.com>.
If you succeed with that, could you share it with the list? I'd also
be very interested in something like this. Perhpas it could be the
start to a useful 3rd party lib.

On Tue, Apr 15, 2008 at 3:47 PM, János Jarecsni
<ja...@gmail.com> wrote:
> "In the worst case I will compile the TML on the fly using JSP and then
>  forward to Tapestry"
>
>  I mean I will use JSP to _generate_ the TML (my use of the word compile may
>  not be the best here :))
>
>  Cheers,
>  Janos
>
>
>
>  On 15/04/2008, János Jarecsni <ja...@gmail.com> wrote:
>  >
>  > Hi Josh,
>  >
>  > hm, this would be a pity... it is relatively easy to imagine a scenario
>  > where the component should be "lately bound", I mean resolved only at
>  > runtime. I can imagine generic TMLs which only specify placeholders for
>  > components, and it depends on some configuration what components to link
>  > into those placeholders. My intention is to move away from the page-centric
>  > approach of Tapestry toward this more dynamic strategy, where the page tml
>  > works as a generic template. Hope this is possible somehow... In the worst
>  > case I will compile the TML on the fly using JSP and then forward to
>  > Tapestry? Uh hah :)
>  >
>  > Thanks for the reply!
>  > Janos
>  >
>  > On 15/04/2008, Josh Canfield <jo...@thedailytube.com> wrote:
>  > >
>  > > Tapestry wants to know about all the components that a page is going
>  > > to render up front. If you want to dynamcially include a component
>  > > you'll have to include that component in the template somewhere so
>  > > that you can get a handle to it.
>  > >
>  > > For instance, you can have a component that has:
>  > >
>  > > <t:delegate to="footerBlock"/>
>  > >
>  > > <t:block id="footerWhite">
>  > > <t:myWhiteFooter/>
>  > > </t:block>
>  > >
>  > > <t:block id="footerRed">
>  > > <t:myRedFooter/>
>  > > </t:block>
>  > >
>  > > then in your component class you can implement
>  > >
>  > > @Parameter
>  > > private String _color;
>  > >
>  > > @Inject
>  > > private Block footerWhite;
>  > >
>  > > @Inject
>  > > private Block footerRed;
>  > >
>  > > Block getFooterBlock() {
>  > > if ( _color.equals("white") ) {
>  > >   return footerWhite;
>  > > } else {
>  > >   return footerRed;
>  > > }
>  > >
>  > > I'm don't know of a way to iterate over all the blocks contained in a
>  > > component...
>  > >
>  > > Josh
>  > >
>  > > On Tue, Apr 15, 2008 at 1:10 PM, János Jarecsni
>  > >
>  > > <ja...@gmail.com> wrote:
>  > >
>  > > > Hi again,
>  > > >
>  > > > is there a way for a little bit more dynamic inclusion of a component?
>  > > >
>  > > > Say instead of <t:footer/> I'd like to iterate through a registry of
>  > > > components and include some of them in a page, like:
>  > > >
>  > > > <t:include-component t:id="someValue"/> (someValue is not a literal).
>  > > >
>  > > > It would be vital for what I'm up to :)
>  > > >
>  > > >
>  > > > Thanks again
>  > > > Janos
>  > > >
>  > > >
>  > > > On 14/04/2008, Michael Gerzabek <mi...@gmx.net> wrote:
>  > > > >
>  > > > > Then I was to fast too! ;-)
>  > > > >
>  > > > > Michael Gerzabek schrieb:
>  > > > >
>  > > > > > Hi Janos,
>  > > > > >
>  > > > > > Could you elaborate a little bit more on what you wanna do?
>  > > > > >
>  > > > > > Have a look at the basic principles of T5 [1], especially
>  > > Principle #1
>  > > > > > might be of interest for you.
>  > > > > >
>  > > > > > Maybe you are just looking on how create dynamic layouts then go
>  > > to the
>  > > > > > mailing list with keywords dynamic and static [2].
>  > > > > >
>  > > > > > Not sure this helps,
>  > > > > > Michael
>  > > > > >
>  > > > > > [1] http://tapestry.apache.org/tapestry5/
>  > > > > > [2]
>  > > > > >
>  > > http://www.nabble.com/forum/Search.jtp?query=T5+static+dynamic&local=y&forum=340&daterange=0&startdate=&enddate=
>  > > > > >
>  > > > > >
>  > > > > > János Jarecsni schrieb:
>  > > > > >
>  > > > > > > Hi All,
>  > > > > > >
>  > > > > > > I'm new to Tapestry technology and to this mailing list, and I
>  > > have a
>  > > > > > > question. I'd like to "dynamically" create .TMLs... So instead
>  > > of
>  > > > > > > having
>  > > > > > > static pages (Start.tml, Login.tml), I'd like to construct
>  > > Tapestry
>  > > > > > > pages on
>  > > > > > > the fly (by including page parts, which are other .tmls). I've
>  > > been
>  > > > > > > looking
>  > > > > > > for some "include" component whatsoever, but found nothing.
>  > > Except for
>  > > > > > > the
>  > > > > > > PageLayout component, which does something similar, just the
>  > > other way
>  > > > > > > around. Could you point me to some workaround or existing
>  > > solution?
>  > > > > > >
>  > > > > > > Cheers
>  > > > > > > Janos
>  > > > > > >
>  > > > > > >
>  > > > > > >
>  > > > > >
>  > > > > >
>  > > > > >
>  > > ---------------------------------------------------------------------
>  > > > > > 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
>  > > > >
>  > > > >
>  > > >
>  > >
>  > >
>  > >
>  > >
>  > > --
>  > >
>  > > --
>  > > TheDailyTube.com. Sign up and get the best new videos on the internet
>  > > delivered fresh to your inbox.
>  > >
>  > >
>  > > ---------------------------------------------------------------------
>  > > 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: include

Posted by János Jarecsni <ja...@gmail.com>.
"In the worst case I will compile the TML on the fly using JSP and then
forward to Tapestry"

I mean I will use JSP to _generate_ the TML (my use of the word compile may
not be the best here :))

Cheers,
Janos

On 15/04/2008, János Jarecsni <ja...@gmail.com> wrote:
>
> Hi Josh,
>
> hm, this would be a pity... it is relatively easy to imagine a scenario
> where the component should be "lately bound", I mean resolved only at
> runtime. I can imagine generic TMLs which only specify placeholders for
> components, and it depends on some configuration what components to link
> into those placeholders. My intention is to move away from the page-centric
> approach of Tapestry toward this more dynamic strategy, where the page tml
> works as a generic template. Hope this is possible somehow... In the worst
> case I will compile the TML on the fly using JSP and then forward to
> Tapestry? Uh hah :)
>
> Thanks for the reply!
> Janos
>
> On 15/04/2008, Josh Canfield <jo...@thedailytube.com> wrote:
> >
> > Tapestry wants to know about all the components that a page is going
> > to render up front. If you want to dynamcially include a component
> > you'll have to include that component in the template somewhere so
> > that you can get a handle to it.
> >
> > For instance, you can have a component that has:
> >
> > <t:delegate to="footerBlock"/>
> >
> > <t:block id="footerWhite">
> > <t:myWhiteFooter/>
> > </t:block>
> >
> > <t:block id="footerRed">
> > <t:myRedFooter/>
> > </t:block>
> >
> > then in your component class you can implement
> >
> > @Parameter
> > private String _color;
> >
> > @Inject
> > private Block footerWhite;
> >
> > @Inject
> > private Block footerRed;
> >
> > Block getFooterBlock() {
> > if ( _color.equals("white") ) {
> >   return footerWhite;
> > } else {
> >   return footerRed;
> > }
> >
> > I'm don't know of a way to iterate over all the blocks contained in a
> > component...
> >
> > Josh
> >
> > On Tue, Apr 15, 2008 at 1:10 PM, János Jarecsni
> >
> > <ja...@gmail.com> wrote:
> >
> > > Hi again,
> > >
> > > is there a way for a little bit more dynamic inclusion of a component?
> > >
> > > Say instead of <t:footer/> I'd like to iterate through a registry of
> > > components and include some of them in a page, like:
> > >
> > > <t:include-component t:id="someValue"/> (someValue is not a literal).
> > >
> > > It would be vital for what I'm up to :)
> > >
> > >
> > > Thanks again
> > > Janos
> > >
> > >
> > > On 14/04/2008, Michael Gerzabek <mi...@gmx.net> wrote:
> > > >
> > > > Then I was to fast too! ;-)
> > > >
> > > > Michael Gerzabek schrieb:
> > > >
> > > > > Hi Janos,
> > > > >
> > > > > Could you elaborate a little bit more on what you wanna do?
> > > > >
> > > > > Have a look at the basic principles of T5 [1], especially
> > Principle #1
> > > > > might be of interest for you.
> > > > >
> > > > > Maybe you are just looking on how create dynamic layouts then go
> > to the
> > > > > mailing list with keywords dynamic and static [2].
> > > > >
> > > > > Not sure this helps,
> > > > > Michael
> > > > >
> > > > > [1] http://tapestry.apache.org/tapestry5/
> > > > > [2]
> > > > >
> > http://www.nabble.com/forum/Search.jtp?query=T5+static+dynamic&local=y&forum=340&daterange=0&startdate=&enddate=
> > > > >
> > > > >
> > > > > János Jarecsni schrieb:
> > > > >
> > > > > > Hi All,
> > > > > >
> > > > > > I'm new to Tapestry technology and to this mailing list, and I
> > have a
> > > > > > question. I'd like to "dynamically" create .TMLs... So instead
> > of
> > > > > > having
> > > > > > static pages (Start.tml, Login.tml), I'd like to construct
> > Tapestry
> > > > > > pages on
> > > > > > the fly (by including page parts, which are other .tmls). I've
> > been
> > > > > > looking
> > > > > > for some "include" component whatsoever, but found nothing.
> > Except for
> > > > > > the
> > > > > > PageLayout component, which does something similar, just the
> > other way
> > > > > > around. Could you point me to some workaround or existing
> > solution?
> > > > > >
> > > > > > Cheers
> > > > > > Janos
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > 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
> > > >
> > > >
> > >
> >
> >
> >
> >
> > --
> >
> > --
> > TheDailyTube.com. Sign up and get the best new videos on the internet
> > delivered fresh to your inbox.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>

Re: include

Posted by János Jarecsni <ja...@gmail.com>.
Hi Josh,

hm, this would be a pity... it is relatively easy to imagine a scenario
where the component should be "lately bound", I mean resolved only at
runtime. I can imagine generic TMLs which only specify placeholders for
components, and it depends on some configuration what components to link
into those placeholders. My intention is to move away from the page-centric
approach of Tapestry toward this more dynamic strategy, where the page tml
works as a generic template. Hope this is possible somehow... In the worst
case I will compile the TML on the fly using JSP and then forward to
Tapestry? Uh hah :)

Thanks for the reply!
Janos

On 15/04/2008, Josh Canfield <jo...@thedailytube.com> wrote:
>
> Tapestry wants to know about all the components that a page is going
> to render up front. If you want to dynamcially include a component
> you'll have to include that component in the template somewhere so
> that you can get a handle to it.
>
> For instance, you can have a component that has:
>
> <t:delegate to="footerBlock"/>
>
> <t:block id="footerWhite">
> <t:myWhiteFooter/>
> </t:block>
>
> <t:block id="footerRed">
> <t:myRedFooter/>
> </t:block>
>
> then in your component class you can implement
>
> @Parameter
> private String _color;
>
> @Inject
> private Block footerWhite;
>
> @Inject
> private Block footerRed;
>
> Block getFooterBlock() {
> if ( _color.equals("white") ) {
>   return footerWhite;
> } else {
>   return footerRed;
> }
>
> I'm don't know of a way to iterate over all the blocks contained in a
> component...
>
> Josh
>
> On Tue, Apr 15, 2008 at 1:10 PM, János Jarecsni
>
> <ja...@gmail.com> wrote:
>
> > Hi again,
> >
> > is there a way for a little bit more dynamic inclusion of a component?
> >
> > Say instead of <t:footer/> I'd like to iterate through a registry of
> > components and include some of them in a page, like:
> >
> > <t:include-component t:id="someValue"/> (someValue is not a literal).
> >
> > It would be vital for what I'm up to :)
> >
> >
> > Thanks again
> > Janos
> >
> >
> > On 14/04/2008, Michael Gerzabek <mi...@gmx.net> wrote:
> > >
> > > Then I was to fast too! ;-)
> > >
> > > Michael Gerzabek schrieb:
> > >
> > > > Hi Janos,
> > > >
> > > > Could you elaborate a little bit more on what you wanna do?
> > > >
> > > > Have a look at the basic principles of T5 [1], especially Principle
> #1
> > > > might be of interest for you.
> > > >
> > > > Maybe you are just looking on how create dynamic layouts then go to
> the
> > > > mailing list with keywords dynamic and static [2].
> > > >
> > > > Not sure this helps,
> > > > Michael
> > > >
> > > > [1] http://tapestry.apache.org/tapestry5/
> > > > [2]
> > > >
> http://www.nabble.com/forum/Search.jtp?query=T5+static+dynamic&local=y&forum=340&daterange=0&startdate=&enddate=
> > > >
> > > >
> > > > János Jarecsni schrieb:
> > > >
> > > > > Hi All,
> > > > >
> > > > > I'm new to Tapestry technology and to this mailing list, and I
> have a
> > > > > question. I'd like to "dynamically" create .TMLs... So instead of
> > > > > having
> > > > > static pages (Start.tml, Login.tml), I'd like to construct
> Tapestry
> > > > > pages on
> > > > > the fly (by including page parts, which are other .tmls). I've
> been
> > > > > looking
> > > > > for some "include" component whatsoever, but found nothing. Except
> for
> > > > > the
> > > > > PageLayout component, which does something similar, just the other
> way
> > > > > around. Could you point me to some workaround or existing
> solution?
> > > > >
> > > > > Cheers
> > > > > Janos
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > 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
> > >
> > >
> >
>
>
>
>
> --
>
> --
> TheDailyTube.com. Sign up and get the best new videos on the internet
> delivered fresh to your inbox.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: include

Posted by Josh Canfield <jo...@thedailytube.com>.
Tapestry wants to know about all the components that a page is going
to render up front. If you want to dynamcially include a component
you'll have to include that component in the template somewhere so
that you can get a handle to it.

For instance, you can have a component that has:

<t:delegate to="footerBlock"/>

<t:block id="footerWhite">
<t:myWhiteFooter/>
</t:block>

<t:block id="footerRed">
<t:myRedFooter/>
</t:block>

then in your component class you can implement

@Parameter
private String _color;

@Inject
private Block footerWhite;

@Inject
private Block footerRed;

Block getFooterBlock() {
if ( _color.equals("white") ) {
  return footerWhite;
} else {
  return footerRed;
}

I'm don't know of a way to iterate over all the blocks contained in a
component...

Josh

On Tue, Apr 15, 2008 at 1:10 PM, János Jarecsni
<ja...@gmail.com> wrote:
> Hi again,
>
> is there a way for a little bit more dynamic inclusion of a component?
>
> Say instead of <t:footer/> I'd like to iterate through a registry of
> components and include some of them in a page, like:
>
> <t:include-component t:id="someValue"/> (someValue is not a literal).
>
> It would be vital for what I'm up to :)
>
>
> Thanks again
> Janos
>
>
> On 14/04/2008, Michael Gerzabek <mi...@gmx.net> wrote:
> >
> > Then I was to fast too! ;-)
> >
> > Michael Gerzabek schrieb:
> >
> > > Hi Janos,
> > >
> > > Could you elaborate a little bit more on what you wanna do?
> > >
> > > Have a look at the basic principles of T5 [1], especially Principle #1
> > > might be of interest for you.
> > >
> > > Maybe you are just looking on how create dynamic layouts then go to the
> > > mailing list with keywords dynamic and static [2].
> > >
> > > Not sure this helps,
> > > Michael
> > >
> > > [1] http://tapestry.apache.org/tapestry5/
> > > [2]
> > > http://www.nabble.com/forum/Search.jtp?query=T5+static+dynamic&local=y&forum=340&daterange=0&startdate=&enddate=
> > >
> > >
> > > János Jarecsni schrieb:
> > >
> > > > Hi All,
> > > >
> > > > I'm new to Tapestry technology and to this mailing list, and I have a
> > > > question. I'd like to "dynamically" create .TMLs... So instead of
> > > > having
> > > > static pages (Start.tml, Login.tml), I'd like to construct Tapestry
> > > > pages on
> > > > the fly (by including page parts, which are other .tmls). I've been
> > > > looking
> > > > for some "include" component whatsoever, but found nothing. Except for
> > > > the
> > > > PageLayout component, which does something similar, just the other way
> > > > around. Could you point me to some workaround or existing solution?
> > > >
> > > > Cheers
> > > > Janos
> > > >
> > > >
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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
> >
> >
>



-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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


Re: include

Posted by János Jarecsni <ja...@gmail.com>.
Hi again,

is there a way for a little bit more dynamic inclusion of a component?

Say instead of <t:footer/> I'd like to iterate through a registry of
components and include some of them in a page, like:

<t:include-component t:id="someValue"/> (someValue is not a literal).

It would be vital for what I'm up to :)


Thanks again
Janos

On 14/04/2008, Michael Gerzabek <mi...@gmx.net> wrote:
>
> Then I was to fast too! ;-)
>
> Michael Gerzabek schrieb:
>
> > Hi Janos,
> >
> > Could you elaborate a little bit more on what you wanna do?
> >
> > Have a look at the basic principles of T5 [1], especially Principle #1
> > might be of interest for you.
> >
> > Maybe you are just looking on how create dynamic layouts then go to the
> > mailing list with keywords dynamic and static [2].
> >
> > Not sure this helps,
> > Michael
> >
> > [1] http://tapestry.apache.org/tapestry5/
> > [2]
> > http://www.nabble.com/forum/Search.jtp?query=T5+static+dynamic&local=y&forum=340&daterange=0&startdate=&enddate=
> >
> >
> > János Jarecsni schrieb:
> >
> > > Hi All,
> > >
> > > I'm new to Tapestry technology and to this mailing list, and I have a
> > > question. I'd like to "dynamically" create .TMLs... So instead of
> > > having
> > > static pages (Start.tml, Login.tml), I'd like to construct Tapestry
> > > pages on
> > > the fly (by including page parts, which are other .tmls). I've been
> > > looking
> > > for some "include" component whatsoever, but found nothing. Except for
> > > the
> > > PageLayout component, which does something similar, just the other way
> > > around. Could you point me to some workaround or existing solution?
> > >
> > > Cheers
> > > Janos
> > >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > 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: include

Posted by Michael Gerzabek <mi...@gmx.net>.
Then I was to fast too! ;-)

Michael Gerzabek schrieb:
> Hi Janos,
>
> Could you elaborate a little bit more on what you wanna do?
>
> Have a look at the basic principles of T5 [1], especially Principle #1 
> might be of interest for you.
>
> Maybe you are just looking on how create dynamic layouts then go to 
> the mailing list with keywords dynamic and static [2].
>
> Not sure this helps,
> Michael
>
> [1] http://tapestry.apache.org/tapestry5/
> [2] 
> http://www.nabble.com/forum/Search.jtp?query=T5+static+dynamic&local=y&forum=340&daterange=0&startdate=&enddate= 
>
>
>
> János Jarecsni schrieb:
>> Hi All,
>>
>> I'm new to Tapestry technology and to this mailing list, and I have a
>> question. I'd like to "dynamically" create .TMLs... So instead of having
>> static pages (Start.tml, Login.tml), I'd like to construct Tapestry 
>> pages on
>> the fly (by including page parts, which are other .tmls). I've been 
>> looking
>> for some "include" component whatsoever, but found nothing. Except 
>> for the
>> PageLayout component, which does something similar, just the other way
>> around. Could you point me to some workaround or existing solution?
>>
>> Cheers
>> Janos
>>
>>   
>
>
> ---------------------------------------------------------------------
> 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: include

Posted by Michael Gerzabek <mi...@gmx.net>.
Hi Janos,

Could you elaborate a little bit more on what you wanna do?

Have a look at the basic principles of T5 [1], especially Principle #1 
might be of interest for you.

Maybe you are just looking on how create dynamic layouts then go to the 
mailing list with keywords dynamic and static [2].

Not sure this helps,
Michael

[1] http://tapestry.apache.org/tapestry5/
[2] 
http://www.nabble.com/forum/Search.jtp?query=T5+static+dynamic&local=y&forum=340&daterange=0&startdate=&enddate=


János Jarecsni schrieb:
> Hi All,
>
> I'm new to Tapestry technology and to this mailing list, and I have a
> question. I'd like to "dynamically" create .TMLs... So instead of having
> static pages (Start.tml, Login.tml), I'd like to construct Tapestry pages on
> the fly (by including page parts, which are other .tmls). I've been looking
> for some "include" component whatsoever, but found nothing. Except for the
> PageLayout component, which does something similar, just the other way
> around. Could you point me to some workaround or existing solution?
>
> Cheers
> Janos
>
>   


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


Re: include

Posted by János Jarecsni <ja...@gmail.com>.
Hi All,

this is solved :) sorry, I was too quick and forgot to search the mail
archives. Really, this is not an issue with tapestry. Page parts should be
components and then including them is this easy:

<t:Footer/>

like for including a Footer component to show standard footer.

(And don't forget that the .TML and .java should both reside in a components
package)

Case closed. Tapestry is cool :)

Cheers,
Janos

On 14/04/2008, János Jarecsni <ja...@gmail.com> wrote:
>
> Hi All,
>
> I'm new to Tapestry technology and to this mailing list, and I have a
> question. I'd like to "dynamically" create .TMLs... So instead of having
> static pages (Start.tml, Login.tml), I'd like to construct Tapestry pages on
> the fly (by including page parts, which are other .tmls). I've been looking
> for some "include" component whatsoever, but found nothing. Except for the
> PageLayout component, which does something similar, just the other way
> around. Could you point me to some workaround or existing solution?
>
> Cheers
> Janos
>