47145

How do you make a link inside a PropertyColumn in Wicket?

I successfully made an AjaxFallbackDefaultDataTable, but I want to make the contents of the cells links. How do I do this with Apache Wicket?

Answer1:

You can use an AbstractColumn instead of a PropertyColumn. This will allow you to add whatever component you like, rather than just the string value of the PropertyModel.

columns.add(new AbstractColumn("displayModel", "sortModel") { void populateItem(Item cellItem, String componentId, IModel rowModel) { cellItem.add(new LinkPanel(componentId, rowModel)); } }

Where LinkPanel is the component you want to add in the cell.

Recommend

  • wicket validate textfield inside listview can't see error message
  • tapestry using data gridsource
  • Data comes from list but does not seen onto the page
  • Is there a way to check if I'm inside a servlet request with Guice?
  • How to customized properties folder in wicket
  • Watch for updated properties in Wicket
  • How can i automate 'Settings' app in real iOS devices?
  • How to use the File System Events API in Swift?
  • How to redirect or show a page rather than “Forbidden” when i have directory listings off (htaccess/
  • Run python script through php on browser
  • Exactly what should happen in a CALayer's display/drawRect methods?
  • Is it possible to disable jQuery's mobile responsive design?
  • Find text using jQuery?
  • How to process binary stream in Wicket like Servlet?
  • set or change php variable in javascript
  • Dump Chrome dev console to text file?
  • Reading .mat file in C++
  • How to transform Byte[](decoded as PNG or JPG) to Tensorflows Tensor
  • send data back from jsp iterator to struts action class
  • Inserting a (g) node in the middle of a tree (SVG) using jQuery
  • Text copied from JTextArea have broken encoding after paste in FoxPro application
  • Excel passing a range into a function
  • JConsole Main class
  • WP7 difficulties binding data to listbox itemssource - won't refresh
  • Ruby 1.8.6 Array#uniq not removing duplicate hashes
  • Configure Spring's MappingJacksonHttpMessageConverter
  • AppleScript : find open tab in safari by name and open it
  • How can I enlarge video fullscreen without the affected interface project in as3?
  • Typescript - Unable to get 'import' statement to function
  • Disabling Alt-F4 on a Win Forms NotifyIcon
  • Updating server-side rendering client-side
  • AT Commands to Send SMS not working in Windows 8.1
  • Windows forms listbox.selecteditem displaying “System.Data.DataRowView” instead of actual value
  • JTable with a ScrollPane misbehaving
  • Angular 2 constructor injection vs direct access
  • Java static initializers and reflection
  • Android Google Maps API OnLocationChanged only called once
  • apache spark aggregate function using min value
  • Sorting a 2D array using the second column C++
  • UserPrincipal.Current returns apppool on IIS