Re: Generated links in a loop

2010-03-30 Thread Kristian Marinkovic
hi peter,

i don't understand your problem entirely...
but have you considered using a EventLink
component instead of generating the link 
manually. then you can easily attach a mixin
that renders some javascript using the 
PagerRender service.

or do you mean a a attribute by saying link property?
in this case you can use the MarkupWriter from the render
event methods to add additional attributes... even in mixins

void beginRender(MarkupWriter writer) {
writer.element().attribute(,...);
}

i guess i'm missing something :)

g,
kris






Von:Peter Stavrinides p.stavrini...@albourne.com
An: Tapestry Mailing List users@tapestry.apache.org
Datum:  30.03.2010 11:47
Betreff:Generated links in a loop



Hi!

Is it possible to attach a mixin on the fly to a 'generated' link? 

I wanted to use component resources:
Link link = resources_.createEventLink(linkId, new Object[] 
{param1,param2}); for generating the link, but there doesn't appear to be 
a way to attach a link property? I feel like I am missing something 
obvious ? ...the only way I know of that might work is using 
renderInformalParameters and writing the mixin JavaScript into the page... 
hmm don't like that too much, is there a better way?

Thanks,
Peter

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




Re: Generated links in a loop

2010-03-30 Thread Peter Stavrinides
Hi Kristian,

Reading through what I wrote, I guess I could be clearer, here is more detailed 
explanation.

I create a model that I attach to a component (a type of custom grid), its 
populated with database records... some of the columns in the grid need to be 
links, and I can create the various types of links (event, page, action etc.) 
as I wish... so far this is all straightforward.

Occasionally I need to generate links that have a mixin attached, my links are 
obviously generated in a loop, and on the fly from the database data.

I am not using a markup writer, but I guess that could be the solution... only 
that would mean also writing out the mixins JavaScript, very possible, but I 
would like to avoid it if there is a better way. 

When generating an event link it would be nice to be able to attach an 
'attribute' (thanks for correcting) to specify a mixin, I know of no way to do 
this dynamically when generating links via Tapestry??

Cheers,
Peter


- Original Message -
From: Kristian Marinkovic kristian.marinko...@porsche.co.at
To: Tapestry users users@tapestry.apache.org
Sent: Tuesday, 30 March, 2010 13:02:51 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: Re: Generated links in a loop

hi peter,

i don't understand your problem entirely...
but have you considered using a EventLink
component instead of generating the link 
manually. then you can easily attach a mixin
that renders some javascript using the 
PagerRender service.

or do you mean a a attribute by saying link property?
in this case you can use the MarkupWriter from the render
event methods to add additional attributes... even in mixins

void beginRender(MarkupWriter writer) {
writer.element().attribute(,...);
}

i guess i'm missing something :)

g,
kris






Von:Peter Stavrinides p.stavrini...@albourne.com
An: Tapestry Mailing List users@tapestry.apache.org
Datum:  30.03.2010 11:47
Betreff:Generated links in a loop



Hi!

Is it possible to attach a mixin on the fly to a 'generated' link? 

I wanted to use component resources:
Link link = resources_.createEventLink(linkId, new Object[] 
{param1,param2}); for generating the link, but there doesn't appear to be 
a way to attach a link property? I feel like I am missing something 
obvious ? ...the only way I know of that might work is using 
renderInformalParameters and writing the mixin JavaScript into the page... 
hmm don't like that too much, is there a better way?

Thanks,
Peter

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



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



Re: Generated links in a loop

2010-03-30 Thread Kristian Marinkovic
so you want to generate a link in a grid and dependending 
on a parameter have a mixin attached.

you can solve it by using a delegate that is directed to a block 
(or component) that  in one case contains a simple eventlink and
in the other case contains a eventlink with the attached mixin

t:block id=eventLinkt:eventlink //t:block
t:block id=eventLinkWithMixint:eventlink 
t:mixins=jsmixin//t:block

that's one of the drawbacks you have, when following the static
structure, dynamic behaviour paradigm. you always have to 
have all posibilities defined in advance. and from my point of 
view it's not always that bad.

hope it helps

g,
kris



Von:Peter Stavrinides p.stavrini...@albourne.com
An: Tapestry users users@tapestry.apache.org
Datum:  30.03.2010 13:05
Betreff:Re: Generated links in a loop



Hi Kristian,

Reading through what I wrote, I guess I could be clearer, here is more 
detailed explanation.

I create a model that I attach to a component (a type of custom grid), its 
populated with database records... some of the columns in the grid need to 
be links, and I can create the various types of links (event, page, action 
etc.) as I wish... so far this is all straightforward.

Occasionally I need to generate links that have a mixin attached, my links 
are obviously generated in a loop, and on the fly from the database data.

I am not using a markup writer, but I guess that could be the solution... 
only that would mean also writing out the mixins JavaScript, very 
possible, but I would like to avoid it if there is a better way. 

When generating an event link it would be nice to be able to attach an 
'attribute' (thanks for correcting) to specify a mixin, I know of no way 
to do this dynamically when generating links via Tapestry??

Cheers,
Peter


- Original Message -
From: Kristian Marinkovic kristian.marinko...@porsche.co.at
To: Tapestry users users@tapestry.apache.org
Sent: Tuesday, 30 March, 2010 13:02:51 GMT +02:00 Athens, Beirut, 
Bucharest, Istanbul
Subject: Re: Generated links in a loop

hi peter,

i don't understand your problem entirely...
but have you considered using a EventLink
component instead of generating the link 
manually. then you can easily attach a mixin
that renders some javascript using the 
PagerRender service.

or do you mean a a attribute by saying link property?
in this case you can use the MarkupWriter from the render
event methods to add additional attributes... even in mixins

void beginRender(MarkupWriter writer) {
writer.element().attribute(,...);
}

i guess i'm missing something :)

g,
kris






Von:Peter Stavrinides p.stavrini...@albourne.com
An: Tapestry Mailing List users@tapestry.apache.org
Datum:  30.03.2010 11:47
Betreff:Generated links in a loop



Hi!

Is it possible to attach a mixin on the fly to a 'generated' link? 

I wanted to use component resources:
Link link = resources_.createEventLink(linkId, new Object[] 
{param1,param2}); for generating the link, but there doesn't appear to be 
a way to attach a link property? I feel like I am missing something 
obvious ? ...the only way I know of that might work is using 
renderInformalParameters and writing the mixin JavaScript into the page... 

hmm don't like that too much, is there a better way?

Thanks,
Peter

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



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




Re: Generated links in a loop

2010-03-30 Thread Thiago H. de Paula Figueiredo
On Tue, 30 Mar 2010 09:08:19 -0300, Kristian Marinkovic  
kristian.marinko...@porsche.co.at wrote:



so you want to generate a link in a grid and dependending
on a parameter have a mixin attached.
you can solve it by using a delegate that is directed to a block
(or component) that  in one case contains a simple eventlink and
in the other case contains a eventlink with the attached mixin


Or passing some parameter to the mixin controlling if it will really do  
something or not. Instead of dynamically applying a mixin or not, you  
always apply the mixin but not always it will do something.



that's one of the drawbacks you have, when following the static
structure, dynamic behaviour paradigm. you always have to
have all posibilities defined in advance. and from my point of
view it's not always that bad.


You're right. You just need to think with the static structure in mind.  
There are solutions for almost any scenario, they just aren't always  
implemented the same way as in dynamic structure frameworks.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.

http://www.arsmachina.com.br

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



Re: Generated links in a loop

2010-03-30 Thread P . Stavrinides
Thanks for the tips Thiago  Kristian they sound promising! I will give them a 
try and let you know...

PS: I do absolutely love the static structure, dynamic behavior of Tapestry!

Cheers,
Peter


 so you want to generate a link in a grid and dependending
 on a parameter have a mixin attached.
 you can solve it by using a delegate that is directed to a block
 (or component) that  in one case contains a simple eventlink and
 in the other case contains a eventlink with the attached mixin

Or passing some parameter to the mixin controlling if it will really do  
something or not. Instead of dynamically applying a mixin or not, you  
always apply the mixin but not always it will do something.

 that's one of the drawbacks you have, when following the static
 structure, dynamic behaviour paradigm. you always have to
 have all posibilities defined in advance. and from my point of
 view it's not always that bad.

You're right. You just need to think with the static structure in mind.  
There are solutions for almost any scenario, they just aren't always  
implemented the same way as in dynamic structure frameworks.

- Original Message -
From: Thiago H. de Paula Figueiredo thiag...@gmail.com
To: Tapestry users users@tapestry.apache.org
Sent: Tuesday, 30 March, 2010 15:17:26 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: Re: Generated links in a loop

On Tue, 30 Mar 2010 09:08:19 -0300, Kristian Marinkovic  
kristian.marinko...@porsche.co.at wrote:

 so you want to generate a link in a grid and dependending
 on a parameter have a mixin attached.
 you can solve it by using a delegate that is directed to a block
 (or component) that  in one case contains a simple eventlink and
 in the other case contains a eventlink with the attached mixin

Or passing some parameter to the mixin controlling if it will really do  
something or not. Instead of dynamically applying a mixin or not, you  
always apply the mixin but not always it will do something.

 that's one of the drawbacks you have, when following the static
 structure, dynamic behaviour paradigm. you always have to
 have all posibilities defined in advance. and from my point of
 view it's not always that bad.

You're right. You just need to think with the static structure in mind.  
There are solutions for almost any scenario, they just aren't always  
implemented the same way as in dynamic structure frameworks.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

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


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