簡體   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