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="eventLink"><t:eventlink /></t:block>
<t:block id="eventLinkWithMixin"><t: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


Reply via email to