Created
May 16, 2010 20:59
-
-
Save jawher/403161 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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