简体   繁体   English

Tapestry5区域不会在使用zoneUpdater更改单选按钮时更新

[英]Tapestry5 zone doesn't update on radio button change using zoneUpdater

I've got 2 radio buttons on my Tapestry5 page and I want to update zone when value changes: 我的Tapestry5页面上有2个单选按钮,我想在值更改时更新区域:

<t:radio t:id="allDay" t:mixins="zoneUpdater" t:event="allDayChanged" t:clientEvent="change" zone="timeRecZone"/>
<t:radio t:id="timeRestricted" t:mixins="zoneUpdater" t:event="timeRestrictedChanged" t:clientEvent="change" zone="timeRecZone"/>

<t:zone t:update="show" elementName="div" t:id="timeRecZone" id="timeRecZone">
    <t:if test="timeRestrictedSelected">
                    .
                    .
                    .

I'm using known zoneUpdater mixin which works fine for me with textfield at other place of my page. 我正在使用已知的zoneUpdater mixin,它对页面其他位置的textfield很好。 But here, I don't really see timeRecZone get updated, because area under the IF condition is not being shown and I don't see following statement being logged when I'm clicking radios. 但是在这里,我真的看不到timeRecZone得到更新,因为没有显示IF条件下的区域,并且当我单击单选按钮时我也看不到以下语句被记录下来。

public boolean isTimeRestrictedSelected() {
    log.info("***** isTimeRestrictedSelected...");
    return selectedTimeRestriction == TimeRestriction.TIME_RESTRICTED;
}

This part (change event) works though: 该部分(更改事件)的工作原理是:

public void onAllDayChanged() {
    selectedTimeRestriction = TimeRestriction.ALL_DAY;
    log.info("***** allDayChanged called: " + selectedTimeRestriction);
}

public void onTimeRestrictedChanged() {
    selectedTimeRestriction = TimeRestriction.TIME_RESTRICTED;
    log.info("***** timeRestrictedChanged called: " + selectedTimeRestriction);
}

Has anybody experienced this while working with radio/zone update? 有人在进行无线电/区域更新时遇到过这种情况吗? Many thanks. 非常感谢。

Mea culpa, solution is here: Mea culpa,解决方案在这里:

public void onAllDayChanged() {
    selectedTimeRestriction = TimeRestriction.ALL_DAY;
    ajaxResponseRenderer.addRender("timeRecZone", timeRecZone);
}

public void onTimeRestrictedChanged() {
    selectedTimeRestriction = TimeRestriction.TIME_RESTRICTED;
    ajaxResponseRenderer.addRender("timeRecZone", timeRecZone);
}

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

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