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
package com.fmpwizard.weyesowl.code.snippet | |
import com.fmpwizard.weyesowl.code.model.{Inventory, InventoryDescription, | |
InventoryImages, InventoryOptionFields, InventoryPrice, InventoryStock, | |
InventoryXCategory, Categories} | |
import scala.xml.{NodeSeq, Text, Elem} | |
import java.io.{File,FileOutputStream} |
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
case class ReplaceOrAppend(replacementId: String, replacement: NodeSeq, | |
appendingId: String, appending: NodeSeq) extends JsCmd with HtmlFixer { | |
override val toJsCmd = { | |
val (replacementHtml, replacementJs) = fixHtmlAndJs("inline", replacement) | |
val (appendHtml, appendJs) = fixHtmlAndJs("inline", appending) | |
var ret = | |
""" | |
try { | |
var parent1 = document.getElementById(""" + replacementId.encJs + """); |
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
// bind the view to the dynamic HTML | |
def show(xhtml: Group): NodeSeq = { | |
val (name, js) = ajaxCall(JE.JsRaw("this.value"), | |
s => After(200, replace(s))) | |
bind("select", xhtml, | |
"state" -> select(AjaxForm.states.map(s => (s,s)), | |
Full(state), s => state = s, "onchange" -> js.toJsCmd) % | |
(new PrefixedAttribute("lift", "gc", name, Null)), | |
"city" -> cityChoice(state) % ("id" -> "city_select"), | |
"submit" -> submit(?("Save"), |
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
<form class="lift:Upload?form=post” multipart=”true"> |
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
<form class="lift:Upload?form=post;multipart=true"> |
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
def stateDropDown = SHtml.ajaxSelect( | |
Wiring.states.map(i => (i, i)), | |
Full(1.toString), | |
selected => { | |
//What to do when you select an entry | |
replace(selected) | |
} | |
) |
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
private object Info { | |
val selectedState= ValueCell(state) | |
val cities= selectedState.lift(_ + "") | |
val ids= selectedState.lift(_ + "") | |
} |
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
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 | |
} | |
) |
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
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) | |
} |
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
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) | |
} |