1

Can some one please let me know why I am getting this error here?

<apex:page controller="abc">
    <apex:form>
        <apex:actionFunction name="addRow" action="{!addRow}" reRender="container">
            <apex:param name="keyValue" assignTo="{!keyValue}" value=""/>
        </apex:actionFunction>

        <apex:pageBlock id="container">
            <apex:repeat value="{!attachmentMap}" var="key">
                <apex:pageBlockSection title="section {!key}">
                    <apex:outputLabel>Section {!key}</apex:outputLabel>
                    <apex:outputPanel styleClass="btn" onclick="addRow('{!key}')">
                        <apex:outputLabel>Add</apex:outputLabel>
                    </apex:outputPanel>
                    <apex:repeat value="{!attachmentMap[key]}" var="uploadFile">
                        <apex:inputFile value="{!uploadFile.body}" ></apex:inputFile>
                    </apex:repeat>
                </apex:pageBlockSection>
            </apex:repeat>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Error: apex:inputFile can not be used in conjunction with an action component, apex:commandButton or apex:commandLink that specifies a rerender or oncomplete attribute.

1

I have got it done ! In my case putting the apex: actionfunction in another form tag outside resolved the issue. -->

        <apex:param id="key" name="keyValue" assignTo="{!keyValue}" value=""/>

    </apex:actionFunction>
</apex:form>
<apex:form >
    <apex:pageBlock id="container">

        <apex:pageBlockSection title="section 1">
            <apex:outputLabel >Section 1</apex:outputLabel>
          <apex:actionRegion >
            <apex:outputPanel styleClass="btn" onclick="addRow('1')">
                <apex:outputLabel >Add</apex:outputLabel>
            </apex:outputPanel>
          </apex:actionRegion>
            <apex:repeat value="{!attachmentMap['1']}" var="uploadFile">
                <apex:inputFile value="{!uploadFile.body}" fileName="{!uploadFile.name}" />
            </apex:repeat>
        </apex:pageBlockSection>

</apex:form>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.