Two ways come to mind: - override onComponentTagBody and write it directly to the response - use a wicket:fragment - add the fragment to the column, the link to the fragment, and define the text in the html (or use wicket:message, etc)
-- Jeremy Thomerson http://www.wickettraining.com On Thu, Jun 25, 2009 at 11:32 AM, Joshua Martin<josmar52...@gmail.com> wrote: > Trying to add an AjaxFallbackLink to a DataTable via an AbstractColumn > and I can't figure out how to set the text in the cell to say > something like "view details" or something. > > I know that in the constructor, the String is for the component's ID, > and I thought that the model was for the text in the link - apparently > not... > > > // Abstract column for showing a pop up window with details > columns.add(new AbstractColumn(new Model("Actions")) { > > public void populateItem(Item cellItem, String > componentId, IModel rowModel) { > > final Workstation item = (Workstation)rowModel.getObject(); > > // HashMap for all the item's values - will be sent to window > final HashMap<String, String> map = new > HashMap<String, String>(); > map.put("AGENTIDENTIFIER", item.getAgentIdentifier()); > map.put("HOSTNAME", item.getHostname()); > map.put("DOMAIN", item.getDomainname()); > map.put("FQDN", item.getFqdn()); > map.put("IP","The IP Address"); > map.put("NETMASK", "The Netmask"); > map.put("GATEWAY", item.getGateway()); > map.put("DNS1", item.getDns1()); > map.put("DNS2", item.getDns2()); > > // ModalWindow functions as a pop up window with the > item's details > final ModalWindow modalWindowDetail; > add(modalWindowDetail = new ModalWindow("modalWindowDetail")); > > // Action for close button callback > modalWindowDetail.setCloseButtonCallback(new > ModalWindow.CloseButtonCallback() > { > public boolean > onCloseButtonClicked(AjaxRequestTarget target) > { > return true; > } > }); > > // Action for window close > modalWindowDetail.setWindowClosedCallback(new > ModalWindow.WindowClosedCallback() > { > public void onClose(AjaxRequestTarget target) > { > // Do Nothing > } > }); > > > AjaxFallbackLink link = new > AjaxFallbackLink(componentId, new Model("asdfasdf")) { > > �...@override > public void onClick(AjaxRequestTarget target) { > System.out.println("Viewed Details for " + > item.getAgentIdentifier()); > modalWindowDetail.setTitle("Detail: " + > item.getHostname()); > modalWindowDetail.setCookieName("modal-window-detail"); > modalWindowDetail.setContent(new > ModalPanel1(modalWindowDetail.getContentId(), map)); > modalWindowDetail.show(target); > } > }; > > cellItem.add(link); > } > > }); > > -- > _________________________________ > > Joshua S. Martin > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org