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" <[email protected]>
To: "Tapestry users" <[email protected]>
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 <[email protected]>
An:     Tapestry Mailing List <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to