繁体   English   中英

使用具有通过小门1.4退出时更新模型的功能在listView中添加TextField

[英]Add TextField in a listView with the feature to update the model on exit using wicket 1.4

我正在尝试在listView中添加TextField,以便可以在退出时或在更新文本后更新模型。

对于此列出的波纹管,我已经收到了一个很好的解决方案,但似乎可以在6.7.0小门上使用。

import org.apache.wicket.ajax.attributes.{ThrottlingSettings, AjaxRequestAttributes}


 val detail = new TextField("detail", new PropertyModel[Meeting](meeting, "description"))
      detail.add(new AjaxFormComponentUpdatingBehavior(("keyup")) {
        protected def onUpdate(target: AjaxRequestTarget) {
          meeting.salvarMeetingInfo(meeting)
        }

        protected override def updateAjaxAttributes(attributes: AjaxRequestAttributes) {
          attributes.setThrottlingSettings(new ThrottlingSettings("thr", Duration.milliseconds(800.0)))
          super.updateAjaxAttributes(attributes)
        }
})
item.add(detail)

//Error messages
      scala: object attributes is not a member of package org.apache.wicket.ajax
import org.apache.wicket.ajax.attributes.{ThrottlingSettings, AjaxRequestAttributes}

                              ^

scala: not found: type AjaxRequestAttributes
        protected override def updateAjaxAttributes(attributes: AjaxRequestAttributes) {
                                                            ^

但是我需要使用wicket 1.4,所以上面针对wicket 1.4的代码有类似的实现或解决方案?

谢谢能帮助我的人。

在行为上,在1.4调用方法setThrottleDelay没有updateAjaxAttributes方法。 有关详细信息, 请参阅文档。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM