Failed validation of file uploads makes them uneditable

I have an issue with a file upload field (af:inputFile), such that if an error occurs on submission the error message is not modal and so the user can altar the values and reenable the OK button with an error message still visible.
I was attempting to get around this since noone seemed to have a way to make the faces error messages modal (Is it possible  to make message popup with error messages modal?).
I tried putting in a validator for the file... which works just fine (once you manage to actually clear the thing on cancel)... apart from the fact that once the validation fails the file name is shown as read only with an update button instead of a browse button. That update button then opens another dialog with a file upload in it and no matter what you do in this dialog the original one remains unchanged... and can be made visible if you move the new dialog off the top of it.
Why can I not actually update the file? Why does it open a different dialog with a different input field that doesn't have my validator or binding or value? What can I do to get around this?
I'm in ADF 11.1.1 but can use 12.1.2 if absolutely necessary for a fix. I don't use JDeveloper.
Thank you.

Thank you! Calling resetValue() on the file input component in the validator just before throwing ValidationException does the job!
I've added the filename to my validation error message so that the user can still see which file it was they tried to upload and I think that solves all my issues

Similar Messages

  • Validator for file upload component is not working !!

    This validator method for a file upload component is throwing a java.lang.NullPointerException.
    public void fileUpload1_validate(FacesContext context, UIComponent component, Object value) {
    long size= fileUpload1.getUploadedFile().getSize();
    if (size>65535){
    throw new ValidatorException(new FacesMessage("Your image is too big!"));
    Any help to solve this problem is very much appreciated.
    Thanks.

    Hi i have a fileUpload in a pop-up and the methods are :
    public void fileUpload1_validate(FacesContext context, UIComponent component, Object value) {
    try {
    com.sun.rave.web.ui.model.UploadedFile uploadedFile = ((Upload)component).getUploadedFile();
    long l_filesize = uploadedFile.getSize();
    if ( l_filesize > 1000000)
    throw new ValidatorException(new FacesMessage("File Size should be less than 1000000 bytes! It is" + l_filesize));
    else {
    String tipo = uploadedFile.getContentType();
    if ( tipo.compareTo("application/word") == -1 )
    if ( tipo.compareTo("application/rtf") == -1 )
    if ( tipo.compareTo("application/pdf") == -1 )
    throw new ValidatorException(new FacesMessage("Error : los tipos de archivo aceptados son PDF, WORD y RTF"));
    } catch (Exception ex) {
    this.mauvaisFichier = true;
    error(ex.getMessage());
    public String botonValidar_action() {
    if ( !this.mauvaisFichier )
    if ( this.fileUpload1.getUploadedFile() != null )
    if ( this.fileUpload1.getUploadedFile().getSize() > 0 )
    try {
    this.getSessionBean1().getComunicacion().setArchivo( new javax.sql.rowset.serial.SerialBlob(this.fileUpload1.getUploadedFile().getBytes() ) );
    this.getSessionBean1().getComunicacion().setTipoArchivo( this.fileUpload1.getUploadedFile().getOriginalName().substring(this.fileUpload1.getUploadedFile().getOriginalName().length() - 3 ) );
    } catch(Exception e){
    e.getMessage();
    return null;
    I have to put a boolean value because the first time, validation code doesn't function ( the method botonValidar_action() is called ) correctly. The error message appears but empty.
    If I try next time then it's ok.
    Thx for any issue.

  • Regarding the validations in File Upload.

    Hi
    I am Using the X:InputFileUpload> for uploading of the my file and i am using validator class for checking the validation like if the file name is null. But i need one more validation to check the file format like if i have enter any special characters and invalid file format(SSS) i want give a message to the user.
    Please suggest me how can i approach using Myfaces.
    Thanks in advance.
    Regards
    Satish

    I have never used myfaces implementation but I am sure you can just define your own custom validator and attach it to this component or assign a method binding to its validator attribute to perform extra validation.

  • Please help me analysis it, Failed when CSV file upload to PSA,

    我的步骤是先建
    1.DATASOURCE;
    2.填写EXTACTION TAB的信息, 数据格式旋转CSV,数据分割输入代号u201D,u201C
    3.在Proposal tab,点击加载数据,可以看到CSV里面的数据;
    4,点击Fields Tab,就跳出对话框u201CField list no longer corresponds to default copy changesu201D "yes or no "
    5.点击YES,在FIields tab 里面可以看到Field,desciption等信息
    6.点击PREVIEW,就出现错误信息,
    请大家帮忙分析一下错误原因在那里。
    ---Runtime error -description of exception;
    Runtime errors Data_length_negative
    Except. CX_XY_RANGE_OUT_OF_BOUNDS
    short text Invailid partial field access :length negative
    what happened Errpr in the ABAP application program
    The current Abap program "CL_RSAR_PSA==============CP " has to be terminated bacause it has
    come across a statement that unfortunately can't be executed.
    Error analysis
    An exception occured that is explained in detail below.
    The exception,which is assigned to calss 'CX_SY_RANGE_OUT_OF_BOUNDS", was not caught in
    Procedure "_GET_DDI_STRUCTURE" "METHOD)",nor was it propagated by a raising clause.
    since the caller of the produre "method"...........

    只有一行数据也还是报同样的错,
    我刚刚开始学,不知道怎么DEBUG,能否简单说一下怎么DEBUG嘛?
    谢谢。
    ----下面是错误信息
    Runtime Errors         DATA_LENGTH_NEGATIVE
    Except.                CX_SY_RANGE_OUT_OF_BOUNDS
    Date and Time          09/04/2009 21:34:14
    Short text
    Invalid partial field access: Length negative
    What happened?
    Error in the ABAP Application Program
    The current ABAP program "CL_RSAR_PSA===================CP" had to be
    terminated because it has
    come across a statement that unfortunately cannot be executed.
    What can you do?
    Note down which actions and inputs caused the error.
    To process the problem further, contact you SAP system
    administrator.
    Using Transaction ST22 for ABAP Dump Analysis, you can look
    at and manage termination messages, and you can also
    keep them for a long time.
    Error analysis
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_RANGE_OUT_OF_BOUNDS', was not
    caught in
    procedure "_GET_DDIC_STRUCTURE" "(METHOD)", nor was it propagated by a RAISING
    clause.
    Since the caller of the procedure could not have anticipated that the
    exception would occur, the current program is terminated.
    The reason for the exception is:
    In the executed program "CL_RSAR_PSA===================CP", the system
    attempted to access the field
    "ME->P_PSA_TECHNAME" using the length "-3".
    However, a partial field access with a negative length specification is
    not allowed.
    How to correct the error
    Use a positive length specification if a part of the field "ME->P_PSA_TECHNAME"
    is to be
    accessed.
    If the error occurred in your own ABAP program or in an SAP
    program you modified, try to remove the error.
    If the error occures in a non-modified SAP program, you may be able to
    find an interim solution in an SAP Note.
    If you have access to SAP Notes, carry out a search with the following
    keywords:
    "DATA_LENGTH_NEGATIVE" "CX_SY_RANGE_OUT_OF_BOUNDS"
    "CL_RSAR_PSA===================CP" or "CL_RSAR_PSA===================CM00A"
    "_GET_DDIC_STRUCTURE"
    If you cannot solve the problem yourself and want to send an error
    notification to SAP, include the following information:
    1. The description of the current problem (short dump)
    To save the description, choose "System->List->Save->Local File
    (Unconverted)".
    2. Corresponding system log
    Display the system log by calling transaction SM21.
    Restrict the time interval to 10 minutes before and five minutes
    after the short dump. Then choose "System->List->Save->Local File
    (Unconverted)".
    3. If the problem occurs in a problem of your own or a modified SAP
    program: The source code of the program
    In the editor, choose "Utilities->More
    Utilities->Upload/Download->Download".
    4. Details about the conditions under which the error occurred or which
    actions and input led to the error.
    The exception must either be prevented, caught within proedure
    "_GET_DDIC_STRUCTURE" "(METHOD)", or its possible occurrence must be declared
    in the
    RAISING clause of the procedure.
    To prevent the exception, note the following:

  • What is it about RAW files that make them difficult to interpret?

    Are they not simply non-compressed, higher bit depth, bitmap files?
    And if they are, then perhaps the issue with respect to poor "conversions" in Aperture has to do with lack of auto processing. When you open a RAW file in ACR it automatically makes adjustments. This doesn't happen in Aperture.

    And RAW files are mostly shot using Bayer sensors - instead of each pixel sensing RGB, each pixel only senses one colour, with there being twice as many green sensors as red or blue.
    http://www.chez.com/hyffont/pages/Photos/PhotoEng/Theory/Sensoreng.html
    Look at the grid diagram at the bottom of the page. This colour mosaic has to be translated into regular RGB bitmap data.
    To make it even more complex, some manufacturers encrypt some of the data, such as white balance info for the Nikon D2X. The RAW format is not just different from manufacturer to manufacturer but from model to model - a .CR2 from a Canon 20D is different from the .CR2 from a Canon 350D, even though they are the same generation and resolution.
    Nightmare.

  • Applescript to edit several .pages files and make them have all bold text?

    No very little about apple script but I would like to drop a bunch of .pages files on a script and convert all the text to bold
    This was my first attempt:
    on open theFiles
              tell application "Pages"
                        repeat with aFile in theFiles
      open aFile
                                  set bold to true
                                  set docName to name of front document
      -- Remove .pages extension.
                                  set prevTIDs to AppleScript's text item delimiters
                                  set AppleScript's text item delimiters to ".pages"
      -- Add .pdf extension.
                                  set docName to first text item of docName & ".pdf"
                                  set AppleScript's text item delimiters to prevTIDs
      -- Get folder that dropped file exists in.
                                  tell application "Finder"
                                            set sourceFolder to (container of aFile) as Unicode text
                                  end tell -- Finder
      -- Save file to folder that dropped file exists in.
                                  set docPathAndName to sourceFolder & docName
                                  save front document as "SLDocumentTypePDF" in docPathAndName
      close front document
                        end repeat
              end tell
    end open
    Any help will be appreciated!
    Kay Fisher

    Opps
    Obviously the bulk of the script is to create pdf files.
    I just tried to piggy back onto that and BOLD everything.

  • Large files Upload Error

    I have tried using Share so that my printers could access the
    files to be printed. The file sizes vary from around 20mb to 80mb.
    I had more success whilst the site was in Beta. 90% of the time now
    I have had an upload fail on me. I zip all the files to make them
    smaller and I'm using Safari on 10.5.4.
    I would love to be able to use this service but find myself
    having to revert back to using mailbigfile.com which has never
    failed me.
    A clear indication on screen of the percentage that has been
    uploaded would help as well, instead of having to hover over the
    spinning wheel.

    > I had more success whilst the site was in Beta.
    Acrobat.com and its services are still in Beta. There has
    been no announcement by Adobe as to when the service will finish
    its Beta stage.
    > A clear indication on screen of the percentage that has
    been uploaded would help as well, instead of having to hover over
    the spinning wheel.
    That is an excellent suggestion. You should post it in the
    Feature Request / Suggestion Box at the following link:
    Feature
    Request / Suggestion Box

  • I want to make all my caller id pics full screen how do i do that? When i download a picture from my phone it makes it full screen then it goes back to the small photo in the upper right hand corner how do i make them stay full screen help please:-)

    I want to make all my caller id pics full screen how do i do that? When i download a picture from my phone it makes it full screen then it goes back to the small photo in the upper right hand corner how do i make them stay full screen help please:-)

    @Naiks, having suffered through unsuccessful synching attempts for Calendar and Contacts myself, l would suggest you try the following:
    UNINSTALL iCloud control panel from your PC. Seems silly, but do it.
    Go into Outlook, and look at the very top menu. Click FILE, then ACCOUNT SETTINGS, then click the popup box.
    You will see a list of all your email accounts. Make sure that ONE of them has a checkmark against it. If not, select the account your want as your default, and click "set as default.
    Exit out of Outlook and reboot your machine.
    Now reinstall iCloud, check CALENDAR and CONTACTS, and do as instructed when prompted.
    Reboot for good luck and now launch OUTLOOK. All that remains is to locate your iCloud Contacts and Calendar files, and make them your default.
    IMPORTANT: Don't panic if you can't find your contacts -- they're there. Click CONTACTS and you'll see you have several available contact files. Locate the one label "iCloud" in grey type. Right-click on it, select PROPERTIES, then click the Outlook Address Book tab. Check the box that says something like "Make this my default Outlook Address Book." Keep clicking "apply" and "okay" until you've exited out of the dialog box maze.
    You may have to do something similar with your Calendar files. I dd not, but if you need to, do it.
    Everything should now sync pretty seamlessly.
    I didn't have the exact same problem as you, but my dilemma was close enough. Good luck!
    Arthur P. Johnson

  • File Browse is emptied after failed validation

    Why does the file browse text box get emptied after a failed validation? Is there any way to prevent this?
    To further explain, create a form on a page with two page items, a text box and a file browse item, then put a not null validation on the text box. When you submit the page with a null text box, but with a file selected for the browse button, then validation catches and throws the error message back to the user when the page refreshes. However, the file browse text box is emptied, and the user has to reselect the file before resubmitting the page.
    Is this a bug, or just the way it is supposed to work? Any way around it?
    Thanks,
    Kris
    Edited by: kshenn on Oct 31, 2008 7:06 AM

    Hello,
    >> Is this a bug, or just the way it is supposed to work?
    This is not a bug. Actually, it has nothing to do with APEX. The behavior of the file browse item is controlled by the HTML standard, which clears the field for security reasons.
    If you pay close attention to Denes example, you’ll see that even when the validation error page is displayed, the file browse item itself is being cleared. The JavaScript generated file path is the one that retain its value. I don’t have access to Denes code, but I’m assuming that in his uploading procedure he’s using the JavaScript generated path.
    >> Any way around it?
    Where the file browse item is concern, no workaround.
    In your specific case, where the validation you need is “not null”, you can create a JavaScript validation, and fire it before submitting the page (as part of the submit button). That way, the browser will not clear the file browse item, because the page will not be submitted without proper values in your items.
    Regards,
    Arie.

  • File.upload on Air SDK for iOS devices failed to send http request to server.

    I am trying to use ActionScript's File.upload to upload a file on Air SDK for iOS8 environment, but the File.upload does not work properly. No handler about the file upload is executed after File.upload is invoked, and no exception is caught. When I check the network traffic of the server side, I found that no http request even hit the server after File.upload is executed. The code snippet here is very simple.
      private var file:File;
      private var dir:File;
      //This method is executed to create a file and upload it when the Upload Button is pressed.
      protected function OnUploadButtonPressed(event:MouseEvent):void{
      var str:String = 'This is test';
      var imageBytes:ByteArray = new ByteArray();
      for ( var i:int = 0; i < str.length; i++ ) {
      imageBytes.writeByte( str.charCodeAt(i) );
      try{
      dir = File.applicationStorageDirectory
      var now:Date = new Date();
      var filename:String = "test" + now.seconds + now.milliseconds + ".txt";
      file = dir.resolvePath( filename );
      var stream:FileStream = new FileStream();
      stream.open( file, FileMode.WRITE );
      stream.writeBytes( imageBytes );
      stream.close();
      file.addEventListener( Event.COMPLETE, uploadComplete );
      file.addEventListener( IOErrorEvent.IO_ERROR, ioError );
      file.addEventListener( SecurityErrorEvent.SECURITY_ERROR, securityError );
      file.addEventListener(ErrorEvent.ERROR, someError);
      file.addEventListener(ProgressEvent.PROGRESS, onProgress);
      file.upload( new URLRequest("http://10.60.99.31/MyPath/fileUploadTest.do"));//This line does not work. No handler is executed. No http request hit the server side.
      } catch( e:Error ) {
      trace( e );
      //Complete Handler
      private function uploadComplete( event:Event ):void
      trace( "Upload successful." );
      //IOError handler
      private function ioError( error:IOErrorEvent ):void
      trace( "Upload failed: " + error.text );
      //SecurityError handler
      private function securityError(error:SecurityErrorEvent):void{
      trace( "Security error:" + error.text );
      //Other handler
      private function someError(error:ErrorEvent):void{
      trace("some error" + error.text);
      //Progress handler
      private function onProgress(event:ProgressEvent):void{
      trace("progressHandler");
    When executed on Air Simulator, it works fine as expected, and the file is successfully uploaded to the server. But When executed on iOS devices(in my case, iPad), as I explain early, no handler about the file upload is executed, and no the http request even hit the server. So I think the problem may be in the client side. It seems that the Air SDK for iOS just failed to send the http request for some reason.
    To make my problem more clear, I list my environment below:
    Development Environment:  Windows7 (64bit)  / Mac os 10.9.4 (Tested on  OS platforms.)
    IDE: Flash Builder 4.7
    Air SDK:  3.8 / 16.0.0 (After I updated to the lastest Air SDK 16.0.0 , the problem still exists.)
    Application Server:  Tomcat7 + Spring
    Target OS: iOS 8
    I have been struggling for this for days. So I really appreciate it if anyone has any idea about this.
    Thanks in advance.

    Hi bluewindice ,
    As you have quoted ( ActionScript's File.upload does not work on Air SDK for iOS devices ) , this issue has been replicated at our end, and our team will be working on it.
    Thanks,
    Tushar

  • Wuala Validating source files with md5sums... wuala.tar.gz . FAILED

    [r-c@r-c-laptop wuala]$ makepkg -si
    ==> Making package: wuala 2-20110707 (Sat Oct 15 13:17:49 CEST 2011)
    ==> Checking runtime dependencies...
    ==> Checking buildtime dependencies...
    ==> Retrieving Sources...
    -> Downloading wuala.tar.gz...
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 303k 100 303k 0 0 56284 0 0:00:05 0:00:05 --:--:-- 684k
    -> Found 0001-fix-loader-location.patch
    -> Found wuala.png
    -> Found wuala.desktop
    -> Found LICENSE
    ==> Validating source files with md5sums...
    wuala.tar.gz ... FAILED
    0001-fix-loader-location.patch ... Passed
    wuala.png ... Passed
    wuala.desktop ... Passed
    LICENSE ... Passed
    ==> ERROR: One or more files did not pass the validity check!
    I tryed to install it mannualy and also using yaourt. Nothing works.

    What I need to change just checksums or something else? Which checskums to use?
    I tryed copy and paste during installation but doesnt work:
    http://pastebin.com/MceCxbD3
    http://pastebin.com/ziQKuE5t

  • Button disabled until file upload is valid...

    elo. I have this application which uses a File Upload component. I can successfully upload the needed file.
    My application (part of it concerned) has a File Upload component and another button ("Submit"). The file upload works fine. The problem is, if i want to upload that file (meaning, copied to the hard disk) i have to press the "Submit" button, which is initially disabled. It can only be enabled if the File Upload's file is valid. If the file upload is cancelled, the "Submit" button should still be disabled. If the user selects a file, the "Submit" button should be enabled, so that the user can successfully upload the file.
    Help me with this please... Thanx.

    My suggestion is to use JavaScript for dynamically disabling and enabling the button based on "onClick" and "onBlur" javascript attributes of the FileUpload component.
    To get info about what kind of javascript used for FileUpload component
    - Go to the Projects tab
    - Explore the Libraries node and open Default Theme - defaulttheme.jar
    - Drill down to com.sun.rave.web.ui.defaultheme.javascript and dowuble click on formElements.js
    - Search for upload functions
    You should see the functions related to File Upload near
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    // upload functions
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    - Winston
    http://blogs.sun.com/roller/page/winston?catname=Creator

  • IMP-00010: not a valid export file, header failed verification

    Hi everyone,
    I am new in oracle's world, and I've been working with an export from a sun platform, and I try to import to a windows platform. I've been receiving this message error
    IMP-00010: not a valid export file, header failed verification
    Please, help me I have to finish with that today..
    Thanks and have a nice New Year

    thanks for your answer.
    sorry, but I don't have all exact information, because that export is comming from a client, and I don't know all information. I only know that the platform is sun.
    I received the file via an usb memory, directly from the source.
    I've been read that if you make an export in sun platform and it isn't as binary when you transfer it to a windows platform, it will be corrupt.
    Could you confirm me that?

  • How do I copy my old xl files from my XP machine to operate on xl for Mac on my new iMac.  When I copy them onto a stick and transfer them it automatically makes them xls files which are then corrupted when I try to open them in xl for mac

    How do I copy my old xl files from my XP machine to operate on xl for Mac on my new iMac.  When I copy them onto a stick and transfer them it automatically makes them xls files which are then corrupted when I try to open them in xl for mac

    Sorry, yes this is Microsoft Excel.  The Microsoft XP has Excel files denoted as xl, the later versions of Microsoft Excel are denoted as xls files.  The later verions of Microsoft Excel open the xl files OK, does Excel for Mac not able to do this?

  • After I have combined some files together to make them into one pdf, can I add and take out files?

    After I have combined some files together to make them into one pdf, can I add and take out files?

    Hello djensen1x,
    Could you please let me know what version of Acrobat are you using.
    Also, tell me your workflow of combining those PDF files?
    Please share the screenshot of the error message that you get.
    Hope to get your response.
    Regards,
    Anubha

Maybe you are looking for

  • File i/o qs with html

    hey everybody, these java forums are a valuable resource so i decided to ask a question about a problem i have been having with my code. i am trying to read in a file (it's a txt file but with all html code in it)...simple reading is not a problem, b

  • Extracting "File Properties" metadata

    After processing scanned images in Photoshop CS3, I am uploading them to a DAM solution that has the capability to extract embedded metadata using custom defined keys. I would like to know the syntax/structure of embedded metadata labels that display

  • Many sites require Adobe Flash 11.1, but emac doesn't support any version beyond 10.3. What do I do to get Flash 11.1 installed?

    Many web sites now require Adobe Flash 11.1. When I try to install it, nothing happens. Apple says Tiger and Leopard support only Adobe 10.3. What am I supposed to do to get Adobe 11.1 installed?

  • Java error_java.lang.NoClassDefFoundError

    Hello, I try to run a java program but get the following error message. $ ./guilogon.java Exception in thread "main" java.lang.NoClassDefFoundError: Semester/SRW4/SAPClients/SAPGUI7/10rev11/jar/GuiStartS/jar:/home/tiger/FH_WI/2/Jahr_FH/3/ Caused by:

  • Delete Frameworks Folder?

    In HD/System/Library I have a folder called "Frameworks that's taking up about 1.5GB of space. What is it? Can I delete it safely? Thanks, Stew