0

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

我已经收到了一个很好的解决方案,但它似乎适用于 wicket 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,上面的代码有类似的实现或解决方案吗?

感谢有人可以帮助我。

4

1 回答 1

1

1.4中没有updateAjaxAttributes方法调用方法setThrottleDelay来代替行为。有关详细信息,请参阅文档。

于 2013-04-25T03:54:00.567 回答