Created
April 4, 2011 03:16
-
-
Save fmpwizard/901094 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) | |
val validIdsSignal2= statesSelect.selectedItem.map(_.toList flatMap CitiesAndStates3.citiesFor flatMap CitiesAndStates3.idsFor) | |
val idsSelect2= Select(validIdsSignal2) | |
def render ={ | |
"#states" #> statesSelect & | |
"#cities" #> citiesSelect & | |
"#ids" #> idsSelect2 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment