-2

<xp:comboBox id="txtRequestType" style="width:290px" required="true" defaultValue="Select One">

                        <xp:selectItem itemLabel="Select One" id="selectItem21">
                        </xp:selectItem>




                        <xp:selectItems>
                            <xp:this.value><![CDATA[#{javascript:return @DbColumn("","vwAdminRateTypes",1);}]]></xp:this.value>
                        </xp:selectItems>

                        </xp:comboBox>
<xp:br></xp:br>
<xp:comboBox id="txtRateType" style="width:290px" required="true" defaultValue="Select One">
                                <xp:selectItem itemLabel="Select One">
                                </xp:selectItem>
                                <xp:selectItems id="selectItems10">
                                    <xp:this.value><![CDATA[#{javascript:var key=getComponent("txtRequestType").getValue();
@DbLookup("","vwAdminRateTypes",key ,2);}]]></xp:this.value>
                                </xp:selectItems>




                            </xp:comboBox><xp:br></xp:br>
<xp:panel>
    <xp:label value="New Money" id="label1">
        <xp:this.rendered><![CDATA[#{javascript:return getComponent("txtRequestType").getValue() == "New Money";}]]></xp:this.rendered>
    </xp:label></xp:panel>
<xp:button value="Refresh" id="button1">
    <xp:eventHandler event="onclick" submit="false">
        <xp:this.script><![CDATA[XSP.partialRefreshGet("#{id:txtRateType}", {
   onComplete: function() {
XSP.partialRefreshGet("#{id:panel1}", {
    onComplete: function() {
        XSP.partialRefreshGet("#{id:computedField1}", {});
       }
   });
 }
 });]]
              ></xp:this.script>
    </xp:eventHandler>
</xp:button>
4

1 回答 1

3

将您的XSP.partialRefreshGet更改为XSP.partialRefreshPost。这将正确调用 JSF 生命周期并更新组件中的值。

<xp:eventHandler event="onclick" submit="false">
   <xp:this.script><![CDATA[
      XSP.partialRefreshPost("#{id:txtRateType}", {
         onComplete: function() {
            XSP.partialRefreshGet("#{id:panel1}", {
               onComplete: function() {
                  XSP.partialRefreshGet("#{id:computedField1}", {});
               }
         });
      }
   });]]></xp:this.script>
</xp:eventHandler>
于 2012-11-07T21:58:33.443 回答