On 3/13/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
As you nest them, you should do:
add(currentLink);
currentLink.add(new Label("linkName", linkName));
instead of:
add(currentLink);
add(new Label("linkName", linkName));
which adds those two components at the same level.
Eelco
On 3/13/06, Vincent Jenks <[EMAIL PROTECTED]> wrote:
> I'm trying to nest a Label within a Link so the name of the link displayed
> is dynamic (please fill me in if there's a better way.)
>
> Here's my Link & Label on the page:
>
> <a href="" wicket:id="link"><span
> wicket:id="linkName">link</span></a>
>
> Here's the panel class:
>
> public class TrailPanel extends Panel
> {
> public TrailPanel(String id, String linkName)
> {
> super(id);
>
> //create link w/ event handler
> Link currentLink = new Link("link")
> {
> public void onClick()
> {
> //redirect
> setResponsePage(getPage());
> }
> };
>
> //add link to page
> add(currentLink);
> add(new Label("linkName", linkName));
> }
> }
>
> I'm getting this exception, which makes sense..just don't know how to fix
> it:
>
> wicket.markup.MarkupException: Unable to find component with id 'linkName'
> in [MarkupContainer [Component id = link, page =
> com.myapp.ui.admin.EditProduct, path = 1:trailPanel: link.TrailPanel$1,
> isVisible = true, isVersioned = true]]. This means that you declared
> wicket:id=linkName in your markup, but that you either did not add the
> component to your page at all, or that the hierarchy does not match
>
> Don't shoot the n00b!!
>
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
