加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ajax – Seaside:列表在更新时丢失其内容

发布时间:2020-12-16 02:49:06 所属栏目:百科 来源:网络整理
导读:这个很简单.我有一个 select我想根据选择更新一些内部状态.无需重新显示任何内容.问题是在选择和 AJAX请求之后,列表丢失了其内容. renderContentOn: html|value myId| html form with: [ html select list: #('one' 'two' 'tree' 'four' 'five'); id: (myId
这个很简单.我有一个< select>我想根据选择更新一些内部状态.无需重新显示任何内容.问题是在选择和 AJAX请求之后,列表丢失了其内容.

renderContentOn: html
|value myId|
    html form with: [
        html select list: #('one' 'two' 'tree' 'four' 'five');
            id: (myId := html nextId);
            callback: [ :v | value := myId ];
            onChange: (
                html prototype updater
                    triggerFormElement: myId;
                    callback: [:h | value "do something with the value here"];
                    return: false
                ).
    ]

解决方法

#updater需要要更新的元素的DOM ID.如果您未能提供ID,则默认为此,DOM元素触发事件.因此,您最终得到一个空列表.如果您不需要更新某些内容,则应使用#request而不是#updater.如果您想更新某些内容,则需要使用#id:提供有效的ID.

阅读Seaside Book的AJAX: Talking back to the Server部分,它详细解释了AJAX.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读