On 22.12.2007, at 23:30, Andreas Andreou wrote:
Hi,
what's the html template for
ResultElement ?
Can't you add the link there?
ResultElement does not have a HTML but is an AbstractComponent rendering
its content using the renderComponent(). The name "ResultElement" is
a little
missleading; in reality, ResultElement's renderComponent() method
renders
a tree-like structure and needs to emit lots of DirectLinks with update-
Components:
... and from the code (ResultElement's renderComponent()) I try to
render the link as follows:
DirectLink link = (DirectLink)this.getContainer().getComponent
("link");
String url = link.getLink(cycle).getURL();
writer.begin("a");
writer.appendAttribute("href", url);
writer.print(title);
writer.end();
In the meantime I've taken a look at DefaultLinkRenderer.java and see
how
they output the onClick element. But this does not seem to anwser my
original question:
How can I programatically generate a DirectLink? Is the above way of
doing it (using getComponent("link"), referring to an existing
DirectLink
component, that is) the "right" way? If so, how would I add a body to
the component?
I'd prefer to generate the link like this:
DirectLink mylink = new DirectLink(...);
// how to add the body of the link?
How can I do this?
Kaspar
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]