Skip to content

Instantly share code, notes, and snippets.

def stateDropDown = SHtml.ajaxSelect(
Wiring.states.map(i => (i, i)),
Full(1.toString),
selected => {
//What to do when you select an entry
replace(selected)
}
)
private object Info {
val selectedState= ValueCell(state)
val cities= selectedState.lift(_ + "")
val ids= selectedState.lift(_ + "")
}
def stateDropDown = SHtml.ajaxSelect(
CitiesAndStates.states.map(i => (i, i)),
Full(1.toString),
selected => {
//What to do when you select an entry
Info.selectedState.set(selected)
state= selected
Noop
}
)
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)
}
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)
}
package com.fmpwizard.code.snippet
/*
* Copyright 2007-2010 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
package com.fmpwizard.code.snippet
/*
* Copyright 2007-2010 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
Class Boot {
...
def boot {
if (!DB.jndiJdbcConnAvailable_?) DB.defineConnectionManager(DefaultConnectionIdentifier, DBVendor)
...
}
case object MyTabGroup extends RequestVarSnapshotGroup
object MyVar1 extends SnapshotRequestVar(MyTabGroup, "foo")
object MyVar2 extends SnapshotRequestVar(MyTabGroup, 42)
def render = {
/**
* when this function is applied,
* it will restore the values of all the members of the MyTabGroup
*/
@fmpwizard
fmpwizard / gist:1027796
Created June 15, 2011 18:48
Update the UI using two partialUpdate calls
case CityStateUpdate(cometName, city, state) => {
info("Comet Actor %s will do a partial update".format(this))
/**
* You can have many partialUpdate() calls here.
*/
partialUpdate(
SetHtml("city", Text(city))
)
partialUpdate(