0
votes

I have a link at the top of my page that is hidden until a radio button is changed from No to Yes or once the link is unhidden and has been clicked.

When my radio button changes from No to Yes, I fire a couple partial refreshes to unhide the link and another component on the page. For some reason I get an error when trying to unhide the link but not the other component.

Below is the code for the link, the radio button and the other component ( file Upload ) that gets unhidden as well. Perhaps someone can tell me what I am missing?

 <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
What error message do you get?Per Henrik Lausten
An error occurred while updating some of the page. No element to submit with id view:_id1:_id26:tpInsuranceInformation:_id759:linkReviewCOIRequirementsBitwyse1

1 Answers

1
votes

Make sure you update for instance a xp:div instead and that this div contains your link. The error occurs because the xp:link is not present in the component tree when the code tries to refresh it.