Created
April 3, 2011 05:04
-
-
Save fmpwizard/900206 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class reactiveweb extends Logger{ | |
val statesSelect= Select(Val(CitiesAndStates3.states)) | |
statesSelect.selectedIndex.value ()= Some(0) | |
val validCitiesSignal= statesSelect.selectedItem map { | |
case None => Nil | |
case Some(state) => CitiesAndStates3.citiesFor(state) | |
} | |
val citiesSelect = Select(validCitiesSignal) | |
citiesSelect.selectedIndex.value ()= Some(0) | |
val validIdsSignal = citiesSelect.selectedItem.map(_.toList flatMap CitiesAndStates3.idsFor) | |
val idsSelect = Select(validIdsSignal) | |
def render ={ | |
"#states" #> statesSelect & | |
"#cities" #> citiesSelect & | |
"#ids" #> idsSelect | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment