0
我正在编程一个web应用程序,我想使用提交表单中的值,但得到的类型不匹配:斯卡拉升降机类型不匹配?
type mismatch;实测值:connectfour.Board =>选项[INT]需要:()=>任何
我的代码看起来是这样的:
var value=0
"name=value" #> SHtml.onSubmit(s => asInt(s).foreach(value= _)) &
// when the form is submitted, process the variable
"type=submit" #> SHtml.onSubmitUnit(askForHumanMove)
和我的askForHumanMove方法:
def askForHumanMove(board: connectfour.Board): Option[Int] = {
Some(value)
}
希望有人能帮助我处理这种类型的不匹配。
谢谢!
最好的问候, 约翰
嘿,非常感谢您的回复!好吧,我现在用我的渲染方法得到了这个,它看起来不错!但我怎样才能在我的askForHumanMove方法中使用变量值? – user1137701 2012-01-14 17:44:33