You need to sign in to do that
Don't have an account?

custom delete attachment
I did a custom page where I can insert an attachment related to a custom object.
The problem is related to the delete button. I can't do it because the page goes crash with this 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"
I think that the problem is related to reRender="form" in page. Someone have been never developed a custom delete button?
Thanks for any suggest or idea
[CODE]
<apex:page Controller="ControllerTEST" showHeader="false">
<apex:sectionHeader title="File" subtitle="User manage" help="/help/doc/user_ed.jsp?loc=help"></apex:sectionHeader>
<apex:form id="form">
<apex:pageBlock title="Your files">
<apex:pageBlockTable value="{!QFile}" var="att" rendered="{!NOT(ISNULL(QFile))}">
<apex:column >
<a href="javascript:if (window.confirm('Are you sure?')) DeleteFile('{!att.Id}');" style="font-weight:bold">Del</a>
</apex:column>
<apex:column headerValue="Action">
<apex:outputLink value="{!URLFOR($Action.Filement.Download, att.Id)}" target="_blank">View</apex:outputLink>
</apex:column>
<apex:column title="ID" value="{!att.id}"/>
<apex:column title="File Name" value="{!att.Name}"/>
<apex:column title="Description" value="{!att.Description}"/>
<apex:column title="Lenght (inbytes)" value="{!att.BodyLength}"/>
</apex:pageBlockTable>
</apex:pageBlock>
<!-- <apex:actionFunction action="{!DeleteFile}" name="DeleteFile" reRender="form" > -->
<apex:actionFunction action="{!DeleteFile}" name="DeleteFile" reRender="form">
<apex:param name="SelectedFileId" value="" assignTo="{!SelectedFileId}"/>
</apex:actionFunction>
</apex:form>
</apex:page>
[/CODE]
This answer :
Wrap the actionFunction and the thing it rerenders within a single actionRegion.
posted here may help: http://boards.developerforce.com/t5/Visualforce-Development/apex-inputFile-cannot-be-used-with-that-specifies-a-rerender-or/td-p/98161
All Answers
someone can help me?
thanks
This answer :
Wrap the actionFunction and the thing it rerenders within a single actionRegion.
posted here may help: http://boards.developerforce.com/t5/Visualforce-Development/apex-inputFile-cannot-be-used-with-that-specifies-a-rerender-or/td-p/98161
Thanks for sharing the information.Could you please send me clear code,now i am fasing same problem.
thanks..