- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要在选择后立即更新模型或对象DropDownChoice 项。
贝娄是我正在工作的代码:
add(new ListView[Company]("listCompanies", listData) {
override protected def onBeforeRender() {
//
// ...
super.onBeforeRender()
}
def populateItem(item: ListItem[Company]) = {
var company = item.getModelObject()
//...
val listClients: java.util.List[Client] = clientControler.listClients
item.add(new DropDownChoice("clientSelection", listClients,new ChoiceRenderer[Client]("name")))
在具有公司对象属性的 ListView 中,选择 DropDownChoice 的名称属性后,模型公司将使用所选的客户名称进行更新。
我怎样才能实现这个目标?
谢谢
最佳答案
我认为你可以覆盖 onSelectionChanged。但您还需要重写 WantOnSelectionChangedNotifications 以返回 true 才能使其正常工作。像这样的东西。
DropDownChoice<Client> dropDownChoice = new DropDownChoice("clientSelection", listClients) {
@Override
protected boolean wantOnSelectionChangedNotifications() {
return true;
}
@Override
protected void onSelectionChanged(Object newSelection) {
// Do something here when selection is changed
}
};
关于java - Wicket:更新 DropDownChoice 项目选择事件的模型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15892657/
Wicket 中有什么东西可以做两个 下拉选项,以便第一个 doprdownchoice 的第一个选择更改第二个的所有选项吗? 最佳答案 您应该使用第一个选择的值来确定第二个的值。 在这个例子中,我选
我在使用 DropDownChoice 时遇到问题。我必须预先选择一个项目,但我找到的每个教程和示例都只考虑原始类型列表。 我有一个对象列表。 class myObject { private
您好,我创建了 web 应用程序,并且有 DropDownChoice (默认值“A”),但是当我从 DropDownChoice 中选择了某些项目(“B”),然后我执行了一些操作(例如提交),然后在
我有带字段的表单: public VyjimkyForm(final Parametry parametry) { super("vyjimkyForm", new Compo
我有一个 DropDownChoice : DropDownChoice timePeriod = new DropDownChoice("timePeriod", Arrays.asL
在我的项目中,我有 50 多个表单,它们大多彼此相似并使用相同的 DropDownChoice成分。我可以创建单独的 Panel ,在这里我定义了我的 DropDownChoice ,然后我将使用该
所以我在 Wicket 中有我的 DropDownChoice: final DropDownChoice drop_down_status = new DropDownChoice("status"
我在 DropDownChoice (wicket 1.6) 中显示选项时遇到问题。 DropDownChoice choice = new DropDownChoice("enabled", Arr
我的 web 应用程序上的一个 DropDownChoice 列表需要很长时间才能创建,因为通过 LDAP 连接和 SQL 连接的某些操作获取选项。因此,整个页面的加载时间远远超过了几秒钟 - 我想说
我试图在 wicket 框架中获取 dropdownchoice 的选定值,但我无法获取它。如何在 dropdownchoice 的更改事件上获取 DropDownChoice 的选定值???谢谢。我
我有一个 DropDownChoice: DropDownChoice dateSpanChoice = new DropDownChoice("dateSpan", new Prop
我正在使用 Wicket 口向导让用户执行多个步骤进行注册。 但不知怎的,我得到了这个错误: Last cause: Attempt to set model object on null model
我试图在 DropDownChoice 上获取我所选选项的 ID,但出现错误。我知道,当我选择一个值时,我只是更新模型而不是对象(反射)。我希望通过 getModelObject() 获取对象“Use
我正在使用 Wicket 口 DropDownChoice我的列表很长,有没有一种方法可以让当我单击下拉列表然后单击一个字符时,列表将跳转到以相同字符开头的第一个选择 最佳答案 我知道这不是您问题的确
我有 3 个 DropDownChoice COuntry>State>Cities 及其更新可以使用 Ajax onchage 方法使用 ajax 行为。 如果我想通过 JAVA 而不是 AJAX
是否有一些明显的方法可以将分隔符添加到 Wicket DropDownChoice 中的选项列表?在我的例子中,我使用来 self 的数据源的两种类型的域对象来填充选择。我想我可以手动将某种虚拟域对象
我正在尝试访问用户在 apache wicket 的 DropDownChoices 中选择的值。我将 AjaxFormComponentUpdatingBehavior 添加到 DropDownCh
我需要在选择后立即更新模型或对象DropDownChoice 项。 贝娄是我正在工作的代码: add(new ListView[Company]("listCompanies", listData)
我需要创建一个 wicket dropdownchoice 组件,我可以通过设置将默认的“选择一个”文本替换为“全部” nullValid=All null=All 在其属性文件中。我也想将“All”
有没有办法让 Wicket 中的 DropDownChoice 将工具提示(例如标题属性)分配给各个选项元素? 我有以下形式的选择框项目: public class SelectBoxItem {
我是一名优秀的程序员,十分优秀!