在页面上进行部分刷新时出错

时间:2016-06-29 20:52:24

标签: xpages

我的页面顶部有一个隐藏链接,直到单选按钮从No更改为Yes或链接被取消隐藏并被点击后。

当我的单选按钮从No更改为Yes时,我会激活几个部分刷新以取消隐藏链接和页面上的另一个组件。出于某种原因,我在尝试取消隐藏链接而不是其他组件时遇到错误。

以下是链接的代码,单选按钮以及其他未被隐藏的组件(文件上载)。也许有人可以告诉我我错过了什么?

 <xp:link escape="true"
    text="Required: Click Here to Review COI"
    id="linkReviewCOIRequirements"
    value="http://domain.com/file.pdf"
    target="_blank"
    style="font-weight:bold; border-color:red;">
    <xp:this.rendered><![CDATA[#{javascript:
    viewScope.vendorAppReadCOI != "Yes" && 
    ( getComponent("rgVendorAPPGenLiabilityInsurYNI").getValue() == "Yes" || getComponent("rgVendorAPPWorkCompInsurYNI").getValue() == "Yes" || getComponent("VendorAPPProfLiabilityInsurYNI").getValue() == "Yes" ) }]]></xp:this.rendered>
<xp:eventHandler event="onclick" submit="true"
refreshMode="norefresh" id="eventHandler1" immediate="true">
<xp:this.action><![CDATA[#{javascript:viewScope.vendorAppReadCOI = "Yes"
    }]]></xp:this.action>
</xp:eventHandler>

<xp:radioGroup id="rgVendorAPPGenLiabilityInsurYNI"
    value="#{vendorApplication.vendorAPPGenLiabilityInsurYNI}"
    defaultValue="No"
    readonly="#{javascript:( sessionScope.vendorAppRenew == true ) ? true : false;}">
    <xp:selectItem itemLabel="Yes" itemValue="Yes"
        id="selectItem3" />
    <xp:selectItem itemLabel="No" itemValue="No"
        id="selectItem4" />
    <xp:eventHandler event="onclick"
        submit="false" id="eventHandler3">
        <xp:this.script><![CDATA[
XSP.partialRefreshPost( "#{id:panelFU2}" , 
{
    onComplete: function()
    {
        XSP.partialRefreshPost("#{id:linkReviewCOIRequirements}",
        {
        } )
    }
} ); 
]]></xp:this.script>
    </xp:eventHandler>
</xp:radioGroup>

<xp:panel id="panelFU2">
    <xp:fileUpload id="fuVendorAPPGenLiabilityDoc"
        value="#{vendorApplication.vendorAPPGenLiabilityDoc}"
        readonly="#{javascript:( sessionScope.vendorAppRenew == true ) ? true : false;}">
        <xp:this.rendered><![CDATA[#{javascript:getComponent("rgVendorAPPGenLiabilityInsurYNI").getValue() == "Yes";}]]></xp:this.rendered>
    </xp:fileUpload>
</xp:panel>

1 个答案:

答案 0 :(得分:1)

请确保更新例如xp:div,并且此div包含您的链接。发生此错误是因为代码尝试刷新时,组件树中不存在xp:link。