3 votes
Accepted

Visualforce error on rerender with inputfile

The CSV file would be wiped out on reRender anyways, so you need to store the data elsewhere between actions on the page. To get the desired effect, render the spinner using client-side code, and ...
user avatar
  • 434k
3 votes
Accepted

Limit file size apex:inputFile

Here's a solution using javascript. I'm also using jquery but you could modify it to select the apex:inputfile by its full ID and use vanilla javascript. It's using 500k as an arbitrary limit, but you ...
user avatar
  • 4,916
3 votes
Accepted

Is it possible when adding an inputfile to show the filesize as text

You can do this by handling the onchange event for the apex:inputFile element. Update your apex:inputFile to add the handler and add a container to hold the size: <apex:inputFile id="inputfile" ...
user avatar
  • 3,693
3 votes

Issue while uploading CSV file with embedded comma within column

FWIW, this is a CSV parser with testmethods that I located from a blog post (which no longer exists) - There could easily be better ways of doing this but it handles embedded commas and double quotes. ...
user avatar
  • 62.4k
3 votes
Accepted

show error message in Visualforce page if no file was uploaded by user

First you have to add <apex:pageMessages /> Tag after <apex:pageBlock > and then in your Apex code add this code: if(myFile == null) { ApexPages.addmessage(new ApexPages.message(...
user avatar
  • 46
3 votes

Disable inputField conditionally

if you don't want to use js, then you need to use two VF tags. Assuming, you want the user to enter value and setting editFlagset to true. And when you don't want the user to enter value, setting ...
user avatar
2 votes

Disable inputField conditionally

Better to show and hide the apex:inputField based on rendered attribute. So, when editFlag = true, you will display: <apex:inputField value="{!ObjA.inputPicklist1__c}" html-disabled="true" ...
user avatar
2 votes
Accepted

Is it possible to bind filename with javascript on apex repeat?

No. This is a security feature of the browser. The user must select/input the file name, and it is read-only from JavaScript's perspective.
user avatar
  • 434k
2 votes
Accepted

Get details of Image selected from <apex:inputFile>

Following page utilizes Exchangeable Image File library and apex:inputfile example. Exif.getData function reads GPS data from image and stores it as description in document record. VF: <apex:...
user avatar
  • 4,077
2 votes
Accepted

How to insert attachment using transient variable

The Setters are not called when using the transient keyword and hence you may be seeing null in the body or title or any other fields. You can revert back to the non-transient version public ...
user avatar
1 vote
Accepted

Wrapper class data is not showing up in pageblock table after commandbutton action

This is a very common mistake (as I've done it myself) Your controller declares a variable public List<wrapAsset> wrapAssets{get; set;} But your action method redeclares it! public void ...
user avatar
  • 62.4k
1 vote

Get details of Image selected from <apex:inputFile>

To get the location info of the image you have to read EXIF info of the image. I do not know whether Apex has out of the box methods to do it. Any body can let me know if it is there. But you can do ...
user avatar
1 vote

Attach More Files: Rerender Clears Selection

I know this is not an exact answer to your question but I think that, in consideration for heap size, you may want to change your code so the "Attach New File" button actually uploads the first ...
user avatar
1 vote
Accepted

Lightning Design for Apex:inputFile

This is the rather classic mistake of mixing normal id values and apex id values. Apex ID values, which I like to call "managed IDs", which are prefixed and suffixed in a variety of ways depending on ...
user avatar
  • 434k
1 vote
Accepted

Passing parameters from a Test Class into an APEX Class that is called on a Visualforce page

Visualforce action methods can't have parameters so to avoid the error your report in your question the signature must be: public Blob contentFile {get;set;} public Contact currentRecord {get; set;} ...
user avatar
  • 130k
1 vote

Uploading an attachment using inputfile tag

I suspect that at the root of your issue is that both of the below need to use the transient keyword. When you do a rerender, the view state is saved and you'll exceed it's capacity if these aren't ...
user avatar
  • 40.4k
1 vote
Accepted

Can I access the content-type form a blob/inputFile?

So you need a getter and a setter in the controller: public String contentType { get; set; } And a matching attribute in the inputFile: <apex:inputFile id="postFileId" fileName="{!fileName}" ...
user avatar
  • 813
1 vote

facing problem with apex:inputFile component

The reason this is happening is because of how you've structured your controller. You didn't declare your public variables along with their Apex Properties (getters and setters) before your ...
user avatar
  • 40.4k
1 vote

show error message in Visualforce page if no file was uploaded by user

Here is a example on how to do form validation with Javascript in visualforce. Hope this will help. <apex:page controller="clssfpoc"> <apex:pageBlock > <apex:form > <...
user avatar
1 vote
Accepted

apex:inputFile can not be used in conjunction with an action component

You need to remove rerender from your commandbutton tag. It will solve your problem.
user avatar
1 vote

apex:inputFile Error actionRegion tag not resolving issue

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" ...
user avatar
  • 2,900
1 vote

Render condition

Use below instead, rendered="{!AND(Counting != 0,Inquiry=='Inquiry')}" Update property as below, public String Inquiry { get; set { Inquiry = ...
user avatar
  • 2,219
1 vote
Accepted

Render condition

Set Inquiry value outside of the setter method. Maybe in a constructor of the controller.
user avatar
  • 146

Only top scored, non community-wiki answers of a minimum length are eligible