So if I had a listview with each item in the listview having a different Link based on logic that executes in the onClick of AjaxLink how would I dynamically add the wicket:id's for each of the links?
for example:
item.addOrReplace(new ListView<String> ("listViewID" listViewIDs){
AjaxLink openLinktoPage = new AjaxLink("dynamicAjaxLinkId"){
@Override public void onClick(AjaxRequestTarget target){
String url = generateUrlBasedOnDynamicLinkImplementationNotImportant(listViewIDs.getModelObject());
useUrlToOpenWindowImplementationNotImportant(url);
}
}
}
with Html Marked up like so...
<tr wicket:id="listViewIDs">
<td>
<a href="not important">Some Link Text Here</a>
</td>
</tr>
Looks like I am going to have to generate the html dynamically in the code and append it to the html markup. Not sure how to do that though.
No need to generate HTML. This is pretty standard use case for repeaters in Wicket.
And the markup: