如何在电梯选择元素中设置空值?

发布于 2024-09-18 01:13:49 字数 316 浏览 10 评论 0原文

我试图在电梯选择元素中设置一个空值(作为首选):

SHtml.select(("", "") :: (MyObject.findAll(By(MyObject.creator, User.currentUser.open_!.id))), ...

但是它给了我这个错误:

error: type mismatch;
found: List[(String, java.lang.Object)]
required: Seq[(String, String)]

有什么想法吗? 谢谢!

I am trying to set an empty value (as a first choice) in a lift select element:

SHtml.select(("", "") :: (MyObject.findAll(By(MyObject.creator, User.currentUser.open_!.id))), ...

However it gives me this error:

error: type mismatch;
found: List[(String, java.lang.Object)]
required: Seq[(String, String)]

Any ideas?
Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

软的没边 2024-09-25 01:13:49

尝试将其分解为几个步骤。

val choices:Seq[(String,String)] = ("","") :: (all the rest of your options here)

scala> ("","")::List(("c","d"), ("d","e"))  
res8: List[(java.lang.String, java.lang.String)] = List((,), (c,d), (d,e))

然后使用该 choices var 作为 SHtml.select 方法的输入。没有什么可以阻止这种方法的发挥作用。

Try breaking it up into a few steps.

val choices:Seq[(String,String)] = ("","") :: (all the rest of your options here)

scala> ("","")::List(("c","d"), ("d","e"))  
res8: List[(java.lang.String, java.lang.String)] = List((,), (c,d), (d,e))

Then use that choices var as input to the SHtml.select method. There's nothing preventing this approach from working.

在梵高的星空下 2024-09-25 01:13:49

I82Much 的示例存在编译问题并显示错误。
我修改了他的答案,没有问题。已测试。

定义变量:

val choices = List(("",""), ("S", "Storage"))

然后使用它

"strType" -> SHtml.select(choices, Empty, storage.strType(_), "class" -> "smallInputSelect"),

Example of I82Much has problems with compiling and shows errors.
I have modified his answer and have no problems. Tested.

define variable:

val choices = List(("",""), ("S", "Storage"))

and then use it

"strType" -> SHtml.select(choices, Empty, storage.strType(_), "class" -> "smallInputSelect"),
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文