You need to sign in to do that
Don't have an account?
Puneet _Mishra
Error: Component <apex:inputFile> definition does not contain <apex:componentBody>
Hi guys, I am trying to take .csv file as input inserting into Documents but I am receiveing an error
Error: Component <apex:inputFile> definition does not contain <apex:componentBody> so it cannot be used with any child tags.
My code are
<apex:page controller="ExcelController"> <apex:form> <apex:inputfile value="{!document.body}"> <apex:commandbutton action="{!readExcelData}" value="Upload"></apex:commandbutton> </apex:inputfile> </apex:form> </apex:page>
and controller is
public with sharing class ExcelDempController { public Document document { get; set; } public String excelData { get; set; } public ExcelDempController() { document = new Document(); excelData = ''; } public void readExcelData() { } }
as you can see i haven't written any complex code then why this is giving me error
I am not able to figure it out what's the mistake i am doing??
Thanks
Change below code.
All Answers
Change below code.
I figured it out what was the mistake and coming to post the answer or the "Mistake" i was doing but you was lighting fast
:)
Thanks for your such lighting fast reply
Can yu plz tel me what is error in that code :)
I'm struggling with the same kind of problem. It will help me a lot :)
Thanks in advance :)