Skip to content

Instantly share code, notes, and snippets.

@jawher
Created May 16, 2010 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jawher/403161 to your computer and use it in GitHub Desktop.
Save jawher/403161 to your computer and use it in GitHub Desktop.
trait WicketUtils {
class RepeaterWrapper[A](val l : List[A]) {
def toRepeater(id : String, f : (A, WebMarkupContainer)=>Any) : RepeatingView = {
val rep = new RepeatingView(id)
for(a <- l ) {
val row = new WebMarkupContainer(rep.newChildId)
rep.add(row)
f(a, row)
}
rep
}
}
implicit def list2Repeater[A](l : List[A]) = new RepeaterWrapper(l)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment