Hi all

I've been using Wicket for a while now and i love it to death. Today i
encountered a perplexing problem which i haven't been able to get around. My
goal is simply to create a link that shows/hides a div when clicked, and to
create the id of that div dynamically. What i am doing now is this:

JAVA:
final ProductListView products = new ProductListView("items",
order.getItems()); // Just a ListView basically
products.setMarkupId("productlist"+item.getIndex());  // Set the markup id
to hide/show the component
products.setOutputMarkupPlaceholderTag(true);
add(products);
add(new AjaxFallbackLink("toggle"){  // Link to do the toggling.. calls a
javascript function with the id to toggle it
       @Override
        public void onClick(AjaxRequestTarget arg0) {}
        }.add(new AttributeModifier("onClick", true, new
Model("javascript:return
toggleDiv("+("productlist"+item.getIndex())+");"))));

HTML:
<td> # Click me! </td>
<div wicket:id="items">
..some stuff here...
</div>


So that should add the component with Wicket id "items" and the markup id
"productlist0" (for example). When the page is rendered this error pops up:

WicketMessage: Unable to find component with id 'items' in [MarkupContainer
[Component id = panel, page = web.page.authenticated.IndexPage, path =
2:tabs:panel.DefaultPanel, isVisible = true, isVersioned = true]]. This
means that you declared wicket:id=items in your markup, but that you either
did not add the component to your page at all, or that the hierarchy does
not match.

Now to me, that looks like it's using the markup id i set as the wicked id
of the component. Any ideas?
-- 
View this message in context: 
http://www.nabble.com/Wicket-id-vs.-markup-id-%28wicket-1.3.0-beta4%29-tf4677248.html#a13363648
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to