You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by gaz jones <ga...@gmail.com> on 2006/01/26 11:46:19 UTC

tapestry not really component based?

hi,

i have already posted a question about this regarding dynamic insertion of
content into the page, but i thought i would bring it up again because i
think not being able to do so violates the DRY principle (O_o).
for example, if i have a component inheriting from AbstractComponent and i
want to put a page link in the page, i have to (if i understand it
correctly):

add a reference to the engine service in the component:

@InjectObject("engine-service:page")
public abstract IEngineService getPageService();

then in renderComponent...

writer.begin("a");
ILink link = getPageService().getLink(true, "MyGreatPage");
writer.attribute("href", link.getURL());
writer.print("Go to my great page");
writer.end("a");

when what i SHOULD be able to do, if tapestry were truly a component based
framework is:

in renderComponent...

PageLink pageLink = new PageLink();
pageLink.page = "MyGreatPage";
getPage.addComonent(pageLink); // or something similar

otherwise i am repeating the effort of the original PageLink author am i
not? there may be a better way to do this that i dont know about though
obviously...

not creating a proper hierarchy of components is also causing other
problems, such as processing components when in loops. you cant get at
specific instances of components in the rewind cycle because they all share
the same pooled component - is that correct?

do the authors of the framework have any comments on these points above or
any indication if this will change in the future? you can do both of these
things in other component based web frameworks, and i would see it as a
benefit if you could also do so in tapestry. does anyone else agree?

cheers
gaz

Re: tapestry not really component based?

Posted by Ivano <i....@mclink.it>.

gaz jones wrote:

>thats not _quite_ what i want though, as its not truly dynamic - thats
>including a pre-defined component into the page, not generating a completely
>dynamic one... if i have understood your suggestion, i would need to define
>every component i ever might need in the jwc or using annotations...
>
>  
>
 From what get of your posts I can't understand what you mean  by "not 
truly dynamic".
You suggest substituting:

PageLink pageLink = new PageLink();
pageLink.page = "MyGreatPage";
getPage.addComponent(pageLink); // or something similar

in the renderComponent.

But this looks like an operation to *add* a component to the page, and 
not to *render* it.
To add the component, you simply put it in the page template, in the 
descriptor or through annotations.
And to me this way is better than adding through java code: it lets you 
change the page composition without touching the compiled code.

If you need to create a component to "include" another component than 
you do it the same way. If you think that this means not being dynamic, 
you better consider what you need for a component to be actually *reusable*.
As I see it there are only in two cases:
1. The component knows its exact internal composition to depend on 
expected behaviour, or
2. It should be totally independent of possible subcomponents.

And this is what you get with tapestry.

But maybe I misunderstood your question, and you should consider the 
following.

The renderComponent code:

writer.begin("a");
ILink link = getPageService().getLink(true, "MyGreatPage");
writer.attribute("href", link.getURL());
writer.print("Go to my great page");
writer.end("a");

is only written once by the component's developer and the "MyGreatPage" 
is actually parameterized.

As a user you only add the component to a page in the .jwc and use it in 
the template, passing the destination page as a parameter.
And so you need not write any java code for the page or the component 
you're using.
You only need to declare the components that you really make use of, in 
the .jwc, and this is related to the considerations I previously made.

As for the rewind, it's just a different perspective from what you 
described, and I agree that it takes a little effort to get into. But 
the component pooling is a useful mean to reduce the application from 
burdening the system, cause you need not create as many resources, 
reusing existing ones, and that's what pooling exists for.
The difference is that you don't have a "global" page structure that you 
could navigate to find subcomponents. But this too can be an advantage 
since you decouple yourself from thinking in terms of how the components 
are placed within the page. This really helps when you change the page's 
composition in any way, without being forced to change the listener's 
code to adapt to the new page layout.
Moreover you don't need to actually manage the iteration code to examine 
dynamic lists of components. The framework creates the loop variable and 
iterates through the list for you.

Ivano Pagano

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


Re: tapestry not really component based?

Posted by Norbert Sándor <de...@erinors.com>.
As I know this issue is to be solved in 4.1 (correct me if I'm wrong).
There was a post about this on the devlist, ie. rewriting the rewind phase 
to something similar you wrote here.
(Although accessing the rendered components as a tree is not a 
"Tapestry-way" approach, so probably only the internal handling of the 
rewind cycle would change, but for example the rendered component instances 
embedded in a For would not be available as a list... We'll see what happens 
in 4.1...)

Regards,
Norbi

----- Original Message ----- 
From: "gaz jones" <ga...@gmail.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Thursday, January 26, 2006 1:08 PM
Subject: Re: tapestry not really component based?


its basically the same thing touched on in the earlier post titled "[TAP 4]
Components in loops" posted earlier in the week...
it appears to be because tapestry components are all pooled, and there is no
component "hierarchy" when you are in rewind phase, you cant get hold of
components to fiddle with them. asp.net solves this problem by (i guess not
having it in the first place lol) having a true component hierarchy in the
postBack phase (same as rewind), and you can get hold of components using an
index based approach. for example, a table of editable rows would be
accessible by getting the table component by id, and then using indexes to
get the correct row and column or whatever the components were...

this just doesnt seem possible in tapestry and would seem to rule out doing
very complex forms, ie forms with looped components within them that you
need to validate and do lots of stuff with in rewind. :( i would be
interested to know what any of the authors think about this - none of them
commented on the "[TAP 4] Components in loops" thread... they are keeping
quiet O_o.

if craig david were here, he would say "can i get a
reeeeeeeeeeeeeeee-wind"...

...but he's not.
**
On 1/26/06, Ron Piterman <rp...@gmx.net> wrote:
>
> "the fear" is very good LoL...
> but without reason -
> so, whats is the problem with the rewind ?
>
> gaz jones wrote:
> > thats not _quite_ what i want though, as its not truly dynamic - thats
> > including a pre-defined component into the page, not generating a
> completely
> > dynamic one... if i have understood your suggestion, i would need to
> define
> > every component i ever might need in the jwc or using annotations...
> >
> > whatever the case, this isnt the real major problem - as annoying as it
> may
> > be. its the 2nd point that causes most grief... accessing loooped
> components
> > in the rewind phase. that gives me _the fear_
> >
> > On 1/26/06, Ron Piterman <rp...@gmx.net> wrote:
> >
> >>you don't need to, you add the PageLink to your component using the .jwc
> >>or annotation, and then call
> >>
> >>getComponents().getComponent("myPageLink").render(writer,cycle);
> >>
> >>Cheers,
> >>Ron
> >>
> >>
> >>
> >>gaz jones wrote:
> >>
> >>>you CANT add a PageLink component to your page using java in a
> component
> >>>inheriting from AbstractComponent. that is the problem (or one of
> >>
> >>them)...
> >>
> >>>its the 2nd issue that is the real stinker though...
> >>>
> >>>On 1/26/06, Ron Piterman <rp...@gmx.net> wrote:
> >>>
> >>>
> >>>>Maybe I am too long in Tapestry develpement, but I really can't see
> the
> >>>>problem here.
> >>>>
> >>>>If you want to link to a page, you add a PageLink component to your
> >>>>page, done.
> >>>>
> >>>>If you want the page name the link references to be dynamic, you make
> >>>>the page parameter binding of the PageLink component read its value
> from
> >>>>a property in your page's / component's class using ognl. done.
> >>>>
> >>>>So what is really the probelm?
> >>>>
> >>>>Cheers,
> >>>>Ron
> >>>>
> >>>>
> >>>>gaz jones wrote:
> >>>>
> >>>>
> >>>>>hi,
> >>>>>
> >>>>>i have already posted a question about this regarding dynamic
> insertion
> >>>>
> >>>>of
> >>>>
> >>>>
> >>>>>content into the page, but i thought i would bring it up again
> because
> >>
> >>i
> >>
> >>>>>think not being able to do so violates the DRY principle (O_o).
> >>>>>for example, if i have a component inheriting from AbstractComponent
> >>
> >>and
> >>
> >>>>i
> >>>>
> >>>>
> >>>>>want to put a page link in the page, i have to (if i understand it
> >>>>>correctly):
> >>>>>
> >>>>>add a reference to the engine service in the component:
> >>>>>
> >>>>>@InjectObject("engine-service:page")
> >>>>>public abstract IEngineService getPageService();
> >>>>>
> >>>>>then in renderComponent...
> >>>>>
> >>>>>writer.begin("a");
> >>>>>ILink link = getPageService().getLink(true, "MyGreatPage");
> >>>>>writer.attribute("href", link.getURL());
> >>>>>writer.print("Go to my great page");
> >>>>>writer.end("a");
> >>>>>
> >>>>>when what i SHOULD be able to do, if tapestry were truly a component
> >>>>
> >>>>based
> >>>>
> >>>>
> >>>>>framework is:
> >>>>>
> >>>>>in renderComponent...
> >>>>>
> >>>>>PageLink pageLink = new PageLink();
> >>>>>pageLink.page = "MyGreatPage";
> >>>>>getPage.addComonent(pageLink); // or something similar
> >>>>>
> >>>>>otherwise i am repeating the effort of the original PageLink author
> am
> >>
> >>i
> >>
> >>>>>not? there may be a better way to do this that i dont know about
> though
> >>>>>obviously...
> >>>>>
> >>>>>not creating a proper hierarchy of components is also causing other
> >>>>>problems, such as processing components when in loops. you cant get
> at
> >>>>>specific instances of components in the rewind cycle because they all
> >>>>
> >>>>share
> >>>>
> >>>>
> >>>>>the same pooled component - is that correct?
> >>>>>
> >>>>>do the authors of the framework have any comments on these points
> above
> >>>>
> >>>>or
> >>>>
> >>>>
> >>>>>any indication if this will change in the future? you can do both of
> >>>>
> >>>>these
> >>>>
> >>>>
> >>>>>things in other component based web frameworks, and i would see it as
> a
> >>>>>benefit if you could also do so in tapestry. does anyone else agree?
> >>>>>
> >>>>>cheers
> >>>>>gaz
> >>>>>
> >>>>
> >>>>
> >>>>---------------------------------------------------------------------
> >>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>>>
> >>>>
> >>>
> >>>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>



--------------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.22/239 - Release Date: 2006. 01. 
24.


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


Re: tapestry not really component based?

Posted by gaz jones <ga...@gmail.com>.
its basically the same thing touched on in the earlier post titled "[TAP 4]
Components in loops" posted earlier in the week...
it appears to be because tapestry components are all pooled, and there is no
component "hierarchy" when you are in rewind phase, you cant get hold of
components to fiddle with them. asp.net solves this problem by (i guess not
having it in the first place lol) having a true component hierarchy in the
postBack phase (same as rewind), and you can get hold of components using an
index based approach. for example, a table of editable rows would be
accessible by getting the table component by id, and then using indexes to
get the correct row and column or whatever the components were...

this just doesnt seem possible in tapestry and would seem to rule out doing
very complex forms, ie forms with looped components within them that you
need to validate and do lots of stuff with in rewind. :( i would be
interested to know what any of the authors think about this - none of them
commented on the "[TAP 4] Components in loops" thread... they are keeping
quiet O_o.

if craig david were here, he would say "can i get a
reeeeeeeeeeeeeeee-wind"...

...but he's not.
**
On 1/26/06, Ron Piterman <rp...@gmx.net> wrote:
>
> "the fear" is very good LoL...
> but without reason -
> so, whats is the problem with the rewind ?
>
> gaz jones wrote:
> > thats not _quite_ what i want though, as its not truly dynamic - thats
> > including a pre-defined component into the page, not generating a
> completely
> > dynamic one... if i have understood your suggestion, i would need to
> define
> > every component i ever might need in the jwc or using annotations...
> >
> > whatever the case, this isnt the real major problem - as annoying as it
> may
> > be. its the 2nd point that causes most grief... accessing loooped
> components
> > in the rewind phase. that gives me _the fear_
> >
> > On 1/26/06, Ron Piterman <rp...@gmx.net> wrote:
> >
> >>you don't need to, you add the PageLink to your component using the .jwc
> >>or annotation, and then call
> >>
> >>getComponents().getComponent("myPageLink").render(writer,cycle);
> >>
> >>Cheers,
> >>Ron
> >>
> >>
> >>
> >>gaz jones wrote:
> >>
> >>>you CANT add a PageLink component to your page using java in a
> component
> >>>inheriting from AbstractComponent. that is the problem (or one of
> >>
> >>them)...
> >>
> >>>its the 2nd issue that is the real stinker though...
> >>>
> >>>On 1/26/06, Ron Piterman <rp...@gmx.net> wrote:
> >>>
> >>>
> >>>>Maybe I am too long in Tapestry develpement, but I really can't see
> the
> >>>>problem here.
> >>>>
> >>>>If you want to link to a page, you add a PageLink component to your
> >>>>page, done.
> >>>>
> >>>>If you want the page name the link references to be dynamic, you make
> >>>>the page parameter binding of the PageLink component read its value
> from
> >>>>a property in your page's / component's class using ognl. done.
> >>>>
> >>>>So what is really the probelm?
> >>>>
> >>>>Cheers,
> >>>>Ron
> >>>>
> >>>>
> >>>>gaz jones wrote:
> >>>>
> >>>>
> >>>>>hi,
> >>>>>
> >>>>>i have already posted a question about this regarding dynamic
> insertion
> >>>>
> >>>>of
> >>>>
> >>>>
> >>>>>content into the page, but i thought i would bring it up again
> because
> >>
> >>i
> >>
> >>>>>think not being able to do so violates the DRY principle (O_o).
> >>>>>for example, if i have a component inheriting from AbstractComponent
> >>
> >>and
> >>
> >>>>i
> >>>>
> >>>>
> >>>>>want to put a page link in the page, i have to (if i understand it
> >>>>>correctly):
> >>>>>
> >>>>>add a reference to the engine service in the component:
> >>>>>
> >>>>>@InjectObject("engine-service:page")
> >>>>>public abstract IEngineService getPageService();
> >>>>>
> >>>>>then in renderComponent...
> >>>>>
> >>>>>writer.begin("a");
> >>>>>ILink link = getPageService().getLink(true, "MyGreatPage");
> >>>>>writer.attribute("href", link.getURL());
> >>>>>writer.print("Go to my great page");
> >>>>>writer.end("a");
> >>>>>
> >>>>>when what i SHOULD be able to do, if tapestry were truly a component
> >>>>
> >>>>based
> >>>>
> >>>>
> >>>>>framework is:
> >>>>>
> >>>>>in renderComponent...
> >>>>>
> >>>>>PageLink pageLink = new PageLink();
> >>>>>pageLink.page = "MyGreatPage";
> >>>>>getPage.addComonent(pageLink); // or something similar
> >>>>>
> >>>>>otherwise i am repeating the effort of the original PageLink author
> am
> >>
> >>i
> >>
> >>>>>not? there may be a better way to do this that i dont know about
> though
> >>>>>obviously...
> >>>>>
> >>>>>not creating a proper hierarchy of components is also causing other
> >>>>>problems, such as processing components when in loops. you cant get
> at
> >>>>>specific instances of components in the rewind cycle because they all
> >>>>
> >>>>share
> >>>>
> >>>>
> >>>>>the same pooled component - is that correct?
> >>>>>
> >>>>>do the authors of the framework have any comments on these points
> above
> >>>>
> >>>>or
> >>>>
> >>>>
> >>>>>any indication if this will change in the future? you can do both of
> >>>>
> >>>>these
> >>>>
> >>>>
> >>>>>things in other component based web frameworks, and i would see it as
> a
> >>>>>benefit if you could also do so in tapestry. does anyone else agree?
> >>>>>
> >>>>>cheers
> >>>>>gaz
> >>>>>
> >>>>
> >>>>
> >>>>---------------------------------------------------------------------
> >>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>>>
> >>>>
> >>>
> >>>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

Re: tapestry not really component based?

Posted by Ron Piterman <rp...@gmx.net>.
"the fear" is very good LoL...
but without reason -
so, whats is the problem with the rewind ?

gaz jones wrote:
> thats not _quite_ what i want though, as its not truly dynamic - thats
> including a pre-defined component into the page, not generating a completely
> dynamic one... if i have understood your suggestion, i would need to define
> every component i ever might need in the jwc or using annotations...
> 
> whatever the case, this isnt the real major problem - as annoying as it may
> be. its the 2nd point that causes most grief... accessing loooped components
> in the rewind phase. that gives me _the fear_
> 
> On 1/26/06, Ron Piterman <rp...@gmx.net> wrote:
> 
>>you don't need to, you add the PageLink to your component using the .jwc
>>or annotation, and then call
>>
>>getComponents().getComponent("myPageLink").render(writer,cycle);
>>
>>Cheers,
>>Ron
>>
>>
>>
>>gaz jones wrote:
>>
>>>you CANT add a PageLink component to your page using java in a component
>>>inheriting from AbstractComponent. that is the problem (or one of
>>
>>them)...
>>
>>>its the 2nd issue that is the real stinker though...
>>>
>>>On 1/26/06, Ron Piterman <rp...@gmx.net> wrote:
>>>
>>>
>>>>Maybe I am too long in Tapestry develpement, but I really can't see the
>>>>problem here.
>>>>
>>>>If you want to link to a page, you add a PageLink component to your
>>>>page, done.
>>>>
>>>>If you want the page name the link references to be dynamic, you make
>>>>the page parameter binding of the PageLink component read its value from
>>>>a property in your page's / component's class using ognl. done.
>>>>
>>>>So what is really the probelm?
>>>>
>>>>Cheers,
>>>>Ron
>>>>
>>>>
>>>>gaz jones wrote:
>>>>
>>>>
>>>>>hi,
>>>>>
>>>>>i have already posted a question about this regarding dynamic insertion
>>>>
>>>>of
>>>>
>>>>
>>>>>content into the page, but i thought i would bring it up again because
>>
>>i
>>
>>>>>think not being able to do so violates the DRY principle (O_o).
>>>>>for example, if i have a component inheriting from AbstractComponent
>>
>>and
>>
>>>>i
>>>>
>>>>
>>>>>want to put a page link in the page, i have to (if i understand it
>>>>>correctly):
>>>>>
>>>>>add a reference to the engine service in the component:
>>>>>
>>>>>@InjectObject("engine-service:page")
>>>>>public abstract IEngineService getPageService();
>>>>>
>>>>>then in renderComponent...
>>>>>
>>>>>writer.begin("a");
>>>>>ILink link = getPageService().getLink(true, "MyGreatPage");
>>>>>writer.attribute("href", link.getURL());
>>>>>writer.print("Go to my great page");
>>>>>writer.end("a");
>>>>>
>>>>>when what i SHOULD be able to do, if tapestry were truly a component
>>>>
>>>>based
>>>>
>>>>
>>>>>framework is:
>>>>>
>>>>>in renderComponent...
>>>>>
>>>>>PageLink pageLink = new PageLink();
>>>>>pageLink.page = "MyGreatPage";
>>>>>getPage.addComonent(pageLink); // or something similar
>>>>>
>>>>>otherwise i am repeating the effort of the original PageLink author am
>>
>>i
>>
>>>>>not? there may be a better way to do this that i dont know about though
>>>>>obviously...
>>>>>
>>>>>not creating a proper hierarchy of components is also causing other
>>>>>problems, such as processing components when in loops. you cant get at
>>>>>specific instances of components in the rewind cycle because they all
>>>>
>>>>share
>>>>
>>>>
>>>>>the same pooled component - is that correct?
>>>>>
>>>>>do the authors of the framework have any comments on these points above
>>>>
>>>>or
>>>>
>>>>
>>>>>any indication if this will change in the future? you can do both of
>>>>
>>>>these
>>>>
>>>>
>>>>>things in other component based web frameworks, and i would see it as a
>>>>>benefit if you could also do so in tapestry. does anyone else agree?
>>>>>
>>>>>cheers
>>>>>gaz
>>>>>
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>>
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
> 
> 


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


Re: tapestry not really component based?

Posted by gaz jones <ga...@gmail.com>.
thats not _quite_ what i want though, as its not truly dynamic - thats
including a pre-defined component into the page, not generating a completely
dynamic one... if i have understood your suggestion, i would need to define
every component i ever might need in the jwc or using annotations...

whatever the case, this isnt the real major problem - as annoying as it may
be. its the 2nd point that causes most grief... accessing loooped components
in the rewind phase. that gives me _the fear_

On 1/26/06, Ron Piterman <rp...@gmx.net> wrote:
>
> you don't need to, you add the PageLink to your component using the .jwc
> or annotation, and then call
>
> getComponents().getComponent("myPageLink").render(writer,cycle);
>
> Cheers,
> Ron
>
>
>
> gaz jones wrote:
> > you CANT add a PageLink component to your page using java in a component
> > inheriting from AbstractComponent. that is the problem (or one of
> them)...
> > its the 2nd issue that is the real stinker though...
> >
> > On 1/26/06, Ron Piterman <rp...@gmx.net> wrote:
> >
> >>Maybe I am too long in Tapestry develpement, but I really can't see the
> >>problem here.
> >>
> >>If you want to link to a page, you add a PageLink component to your
> >>page, done.
> >>
> >>If you want the page name the link references to be dynamic, you make
> >>the page parameter binding of the PageLink component read its value from
> >>a property in your page's / component's class using ognl. done.
> >>
> >>So what is really the probelm?
> >>
> >>Cheers,
> >>Ron
> >>
> >>
> >>gaz jones wrote:
> >>
> >>>hi,
> >>>
> >>>i have already posted a question about this regarding dynamic insertion
> >>
> >>of
> >>
> >>>content into the page, but i thought i would bring it up again because
> i
> >>>think not being able to do so violates the DRY principle (O_o).
> >>>for example, if i have a component inheriting from AbstractComponent
> and
> >>
> >>i
> >>
> >>>want to put a page link in the page, i have to (if i understand it
> >>>correctly):
> >>>
> >>>add a reference to the engine service in the component:
> >>>
> >>>@InjectObject("engine-service:page")
> >>>public abstract IEngineService getPageService();
> >>>
> >>>then in renderComponent...
> >>>
> >>>writer.begin("a");
> >>>ILink link = getPageService().getLink(true, "MyGreatPage");
> >>>writer.attribute("href", link.getURL());
> >>>writer.print("Go to my great page");
> >>>writer.end("a");
> >>>
> >>>when what i SHOULD be able to do, if tapestry were truly a component
> >>
> >>based
> >>
> >>>framework is:
> >>>
> >>>in renderComponent...
> >>>
> >>>PageLink pageLink = new PageLink();
> >>>pageLink.page = "MyGreatPage";
> >>>getPage.addComonent(pageLink); // or something similar
> >>>
> >>>otherwise i am repeating the effort of the original PageLink author am
> i
> >>>not? there may be a better way to do this that i dont know about though
> >>>obviously...
> >>>
> >>>not creating a proper hierarchy of components is also causing other
> >>>problems, such as processing components when in loops. you cant get at
> >>>specific instances of components in the rewind cycle because they all
> >>
> >>share
> >>
> >>>the same pooled component - is that correct?
> >>>
> >>>do the authors of the framework have any comments on these points above
> >>
> >>or
> >>
> >>>any indication if this will change in the future? you can do both of
> >>
> >>these
> >>
> >>>things in other component based web frameworks, and i would see it as a
> >>>benefit if you could also do so in tapestry. does anyone else agree?
> >>>
> >>>cheers
> >>>gaz
> >>>
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

Re: tapestry not really component based?

Posted by Ron Piterman <rp...@gmx.net>.
you don't need to, you add the PageLink to your component using the .jwc 
or annotation, and then call

getComponents().getComponent("myPageLink").render(writer,cycle);

Cheers,
Ron



gaz jones wrote:
> you CANT add a PageLink component to your page using java in a component
> inheriting from AbstractComponent. that is the problem (or one of them)...
> its the 2nd issue that is the real stinker though...
> 
> On 1/26/06, Ron Piterman <rp...@gmx.net> wrote:
> 
>>Maybe I am too long in Tapestry develpement, but I really can't see the
>>problem here.
>>
>>If you want to link to a page, you add a PageLink component to your
>>page, done.
>>
>>If you want the page name the link references to be dynamic, you make
>>the page parameter binding of the PageLink component read its value from
>>a property in your page's / component's class using ognl. done.
>>
>>So what is really the probelm?
>>
>>Cheers,
>>Ron
>>
>>
>>gaz jones wrote:
>>
>>>hi,
>>>
>>>i have already posted a question about this regarding dynamic insertion
>>
>>of
>>
>>>content into the page, but i thought i would bring it up again because i
>>>think not being able to do so violates the DRY principle (O_o).
>>>for example, if i have a component inheriting from AbstractComponent and
>>
>>i
>>
>>>want to put a page link in the page, i have to (if i understand it
>>>correctly):
>>>
>>>add a reference to the engine service in the component:
>>>
>>>@InjectObject("engine-service:page")
>>>public abstract IEngineService getPageService();
>>>
>>>then in renderComponent...
>>>
>>>writer.begin("a");
>>>ILink link = getPageService().getLink(true, "MyGreatPage");
>>>writer.attribute("href", link.getURL());
>>>writer.print("Go to my great page");
>>>writer.end("a");
>>>
>>>when what i SHOULD be able to do, if tapestry were truly a component
>>
>>based
>>
>>>framework is:
>>>
>>>in renderComponent...
>>>
>>>PageLink pageLink = new PageLink();
>>>pageLink.page = "MyGreatPage";
>>>getPage.addComonent(pageLink); // or something similar
>>>
>>>otherwise i am repeating the effort of the original PageLink author am i
>>>not? there may be a better way to do this that i dont know about though
>>>obviously...
>>>
>>>not creating a proper hierarchy of components is also causing other
>>>problems, such as processing components when in loops. you cant get at
>>>specific instances of components in the rewind cycle because they all
>>
>>share
>>
>>>the same pooled component - is that correct?
>>>
>>>do the authors of the framework have any comments on these points above
>>
>>or
>>
>>>any indication if this will change in the future? you can do both of
>>
>>these
>>
>>>things in other component based web frameworks, and i would see it as a
>>>benefit if you could also do so in tapestry. does anyone else agree?
>>>
>>>cheers
>>>gaz
>>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
> 
> 


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


Re: tapestry not really component based?

Posted by gaz jones <ga...@gmail.com>.
you CANT add a PageLink component to your page using java in a component
inheriting from AbstractComponent. that is the problem (or one of them)...
its the 2nd issue that is the real stinker though...

On 1/26/06, Ron Piterman <rp...@gmx.net> wrote:
>
> Maybe I am too long in Tapestry develpement, but I really can't see the
> problem here.
>
> If you want to link to a page, you add a PageLink component to your
> page, done.
>
> If you want the page name the link references to be dynamic, you make
> the page parameter binding of the PageLink component read its value from
> a property in your page's / component's class using ognl. done.
>
> So what is really the probelm?
>
> Cheers,
> Ron
>
>
> gaz jones wrote:
> > hi,
> >
> > i have already posted a question about this regarding dynamic insertion
> of
> > content into the page, but i thought i would bring it up again because i
> > think not being able to do so violates the DRY principle (O_o).
> > for example, if i have a component inheriting from AbstractComponent and
> i
> > want to put a page link in the page, i have to (if i understand it
> > correctly):
> >
> > add a reference to the engine service in the component:
> >
> > @InjectObject("engine-service:page")
> > public abstract IEngineService getPageService();
> >
> > then in renderComponent...
> >
> > writer.begin("a");
> > ILink link = getPageService().getLink(true, "MyGreatPage");
> > writer.attribute("href", link.getURL());
> > writer.print("Go to my great page");
> > writer.end("a");
> >
> > when what i SHOULD be able to do, if tapestry were truly a component
> based
> > framework is:
> >
> > in renderComponent...
> >
> > PageLink pageLink = new PageLink();
> > pageLink.page = "MyGreatPage";
> > getPage.addComonent(pageLink); // or something similar
> >
> > otherwise i am repeating the effort of the original PageLink author am i
> > not? there may be a better way to do this that i dont know about though
> > obviously...
> >
> > not creating a proper hierarchy of components is also causing other
> > problems, such as processing components when in loops. you cant get at
> > specific instances of components in the rewind cycle because they all
> share
> > the same pooled component - is that correct?
> >
> > do the authors of the framework have any comments on these points above
> or
> > any indication if this will change in the future? you can do both of
> these
> > things in other component based web frameworks, and i would see it as a
> > benefit if you could also do so in tapestry. does anyone else agree?
> >
> > cheers
> > gaz
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

Re: tapestry not really component based?

Posted by Ron Piterman <rp...@gmx.net>.
Maybe I am too long in Tapestry develpement, but I really can't see the 
problem here.

If you want to link to a page, you add a PageLink component to your 
page, done.

If you want the page name the link references to be dynamic, you make 
the page parameter binding of the PageLink component read its value from 
a property in your page's / component's class using ognl. done.

So what is really the probelm?

Cheers,
Ron


gaz jones wrote:
> hi,
> 
> i have already posted a question about this regarding dynamic insertion of
> content into the page, but i thought i would bring it up again because i
> think not being able to do so violates the DRY principle (O_o).
> for example, if i have a component inheriting from AbstractComponent and i
> want to put a page link in the page, i have to (if i understand it
> correctly):
> 
> add a reference to the engine service in the component:
> 
> @InjectObject("engine-service:page")
> public abstract IEngineService getPageService();
> 
> then in renderComponent...
> 
> writer.begin("a");
> ILink link = getPageService().getLink(true, "MyGreatPage");
> writer.attribute("href", link.getURL());
> writer.print("Go to my great page");
> writer.end("a");
> 
> when what i SHOULD be able to do, if tapestry were truly a component based
> framework is:
> 
> in renderComponent...
> 
> PageLink pageLink = new PageLink();
> pageLink.page = "MyGreatPage";
> getPage.addComonent(pageLink); // or something similar
> 
> otherwise i am repeating the effort of the original PageLink author am i
> not? there may be a better way to do this that i dont know about though
> obviously...
> 
> not creating a proper hierarchy of components is also causing other
> problems, such as processing components when in loops. you cant get at
> specific instances of components in the rewind cycle because they all share
> the same pooled component - is that correct?
> 
> do the authors of the framework have any comments on these points above or
> any indication if this will change in the future? you can do both of these
> things in other component based web frameworks, and i would see it as a
> benefit if you could also do so in tapestry. does anyone else agree?
> 
> cheers
> gaz
> 


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


Re: tapestry not really component based?

Posted by Ron Piterman <rp...@gmx.net>.
while the rewind cycle does make things complicated, this is one of the 
difficalties one really does not have...

I understand the problem theoretically, so - can you give a small 
example to go through with ?

Cheers,
Ron

gaz jones wrote:
> hi,
> 
> i have already posted a question about this regarding dynamic insertion of
> content into the page, but i thought i would bring it up again because i
> think not being able to do so violates the DRY principle (O_o).
> for example, if i have a component inheriting from AbstractComponent and i
> want to put a page link in the page, i have to (if i understand it
> correctly):
> 
> add a reference to the engine service in the component:
> 
> @InjectObject("engine-service:page")
> public abstract IEngineService getPageService();
> 
> then in renderComponent...
> 
> writer.begin("a");
> ILink link = getPageService().getLink(true, "MyGreatPage");
> writer.attribute("href", link.getURL());
> writer.print("Go to my great page");
> writer.end("a");
> 
> when what i SHOULD be able to do, if tapestry were truly a component based
> framework is:
> 
> in renderComponent...
> 
> PageLink pageLink = new PageLink();
> pageLink.page = "MyGreatPage";
> getPage.addComonent(pageLink); // or something similar
> 
> otherwise i am repeating the effort of the original PageLink author am i
> not? there may be a better way to do this that i dont know about though
> obviously...
> 
> not creating a proper hierarchy of components is also causing other
> problems, such as processing components when in loops. you cant get at
> specific instances of components in the rewind cycle because they all share
> the same pooled component - is that correct?
> 
> do the authors of the framework have any comments on these points above or
> any indication if this will change in the future? you can do both of these
> things in other component based web frameworks, and i would see it as a
> benefit if you could also do so in tapestry. does anyone else agree?
> 
> cheers
> gaz
> 


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