Save As a file Dialog in ADF

Hi All,
I have a scenario where I want to save an XML file(generated in the bean) on the users local machine.
Basically I want a file browser dialog to pop up on a button click ,what af:inputFile does, only that rather than opening it should allow me to save the file to the users local machine.
Cheers!
sahaj

Hi Pedja,
Thanks for the reply. I think this what I was looking for.
But this action listener first pops up a "File Download" dialog, which provides the option to open or save the file.
And only when I click the save button, I am able to reach the File Browser Dialog.
Is there a way to directly launch the file browser dialog?(skipping the "File Download" dialog).
Cheers!
sahaj

Similar Messages

  • Save As/Open File dialog not remembering Recent Places

    Ok this is annoying.
    Working with files from a network server (PC). Whenever I try and open documents, save documents, or place images/text into a document (InDesign etc) the open/save/place dialog box that appears always defaults to the User/Documents folder. It seems to be that it is only the server folders that do this as it remembers Recent Places, and automatically goes to the last folder accessed in the dialog, for local files from my HD.
    I've tried a tip in another thread regarding deleting com.apple.LaunchServices-xxxx.csstore files (as I did have 2 of them with negative numbers) but that didn't fix anything.
    Any ideas?
    iMac 24" Widescreen, 2GB Ram   Mac OS X (10.4.9)  

    I think this is pretty normal behavior. Servers don't usually remember where clients have saved files and neither do some applications. You can, however, create sharepoints using the freeware utility Sharepoints.
    You could try the shareware utility Default Folder X which may enable you to preserve default locations even on remote servers.
    Referenced software can be found at VersionTracker or MacUpdate.

  • Simple save as .csv file

    Hi,
    is it possible to simplyfie the save as .csv file dialog? etc. by using filedialog in vba?
    each time i save as .csv i need to say yes to save in older format, select wich map i want to use...
    if i in VBA could have som file dialog brosing to the file i want to use etc.:
    stringtosave = "c:\testfiles\test.csv"
    and then call:
    FileSaveAs Name:=stringtosave , FormatID:="MSProject.CSV", map:="MapiwillUse"
    Regards
    Toni

    Hello Toni,
    I haven't had time to test this myself (it's Saturday!), but i suspect if you bracket your FileSaveAs command turning the MS Project alerts off and back on again, the alert box you're seeing will be suppressed:
    Application.DisplayAlerts = False
    FileSaveAs Name:=stringtosave , FormatID:="MSProject.CSV", map:="MapiwillUse"
    Application.DisplayAlerts = True
    If you wanted to get a dialogue to browse for the folder, you'll need to use an API call. Chip Pearson has posted a how to guide on how to browse for a folder using the API call "SHBrowseForFolderA". His website focusses on MS Excel VBA, but I've
    used this code myself in MS Project and can confirm it works the same.
    http://www.cpearson.com/excel/browsefolder.aspx
    ####Update####
    Rereading your question after posting my response, I think you'll want to browse for a file rather than a folder, which is a different api call - "ahtCommonFileOpenSave".
    I did a quick google search and the clearest example I came across was this one - again, not written for MS Project, but the code is the same:
    http://access.mvps.org/access/api/api0001.htm
    Andrew

  • How to open a save file dialog box in form

    hi
    all
    I have prob in form desing , i have open the save file dialog box , how to open a save dialog box
    and path of the select file to save in disk
    help
    thx

    hi
    user this query when-button-pressed trigger
    :txtfile := GET_FILE_NAME(directory_name =>'d:\ali_raza\backup\', file_filter=> 'DMP Files (*.dmp)|*.dmp|');
    Rizwan

  • After clicking "Save" in "Save as" file dialog, the dialog disappears but no download is started. Is this a Windows 7 64 bit issue? It works fine in Windows XP.

    I am trying to download the iTunes installer for Windows 7 64 bit.
    I have "Always ask me where to save files" checked in Firefox's download options.
    Steps to reproduce the problem:
    1) In the iTunes download page I click the "Download now" link and Firefox shows me a "Opening iTunes64Setup.exe" dialog with a "Save File" button.
    2) I click the "Save File" button. Sometimes the dialog disappears but nothing else happens. Other times I get the Windows 7 "Save as" dialog.
    3) I click the "Save" button in the save file dialog (I'm using the default user documents folder). The dialog disappears and nothing happens.
    If I uncheck "Always ask me where to save files" then the download works fine.
    I also have a Windows XP 32 bit with the same configuration where everything works fine which makes me think that this problem only happens in Windows 7 or in the 64 bit version.

    It is possible that anti-virus software is corrupting downloaded files or is otherwise interfering with downloading files.
    Try to disable the real-time (live) scanning of files in your anti-virus software temporarily to see if that makes downloading work.
    See:
    *http://kb.mozillazine.org/Unable_to_save_or_download_files
    *browser.download.manager.scanWhenDone

  • Save File-Dialog not responding

    In every document-style app (Pages, TextEdit etc.) the save file dialog suggests iCloud as default destination to save to. When I click the Drop-Down to select another location the whole application hangs and shows me the marvelous marble of death.
    Is there anybody else experiencing this? How could this be solved?
    (Behaviour seen on 10.8.2 but also on 10.8.1)

    to make things clearer a screenshot of the dialog I'm talking about. this happens everywhere such a generic save file dialog appears.

  • Finder in Save file dialog Safari crash

    Ever since I upgraded to Snow Leopard at launch, Safari 4 doesn't seem to like me searching in the save file dialog box. It doesn't seem to matter whether or not I actually save the file, and I made a screen recording to show what happens here:
    http://www.youtube.com/watch?v=YFKkPI2vGr8
    I've reset Safari, and I repaired my disk permissions after loading up Snow Leopard. What gives? This is really annoying when I want to get to a folder fast, and dragging and dropping image files to folders seems to cause them to open in different Preview windows (or not even open at all).
    Any help would be much appreciated. This is seriously making me consider going back to Firefox or just going with Chrome - this crash doesn't happen with either of them!

    The problems are caused by third party input managers/enhancers that have not yet been updated by their developers to comply with the standards used by Safari 3.2.1. and/or Safari 4.
    In your case these are:
    com.zang.RegexKit 0.6.0 (0.6.0) <71374A4A-3B24-4759-E994-AB9E135345CB> /Library/InputManagers/Safari AdBlock/Safari AdBlock Loader.bundle/Contents/PlugIns/Safari AdBlock.bundle/Contents/MacOS/../Frameworks/RegexKit.framework/Versions/A/Regex Kit
    You fill find them in one or either of these folders:
    Home/Library/Input Managers
    Hard Disk/library/Input Managers
    Hard Disk/Library/Application Support
    although the exact location is indicated in your crash report as quoted above - look under 'Binary Images'.
    Close Safari and delete them, then restart Safari and it should be working normally. Alternatively drag them to the desktop and restart Safari. then add them back one at a time, restarting Safari every time, until you find the one (or more) causing the crash.
    Check with the developers of the plug-ins in question for updates that are Safari 4 compliant.

  • When trying to save a file, no file dialog appears

    The last 2 weeks, often when I want to save a file --- any file, eg an image, I right-click "save image as" and then wait for a file dialog to ask where to save, then nothing, no matter how long I wait.
    If I exit Firefox and restart it it may work normally for a while, i.e., the dialog appears, but soon the same problem comes back. This is of course infuriating when you have gone through some tedious procedure, typed a captcha, a password, etc, etc before a website allows you to save a file.
    The other r-click options work -- I can open a file with an application, I can even use "DownThem All", but Firefox's own save dialog is unusable.
    Firefox 27.01 on XP

    You can check it DTA or another extension isn't causing this problem.
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Save File dialog from dll is not appearing to the front of TestStand window

    Hi all,
    I am calling a C#.net dll from a step in TestStand sequence. A function is called which pops up a Save File dialog. This Save File dialog is appearing only behind other windows. There is an overload for the showDialog function that takes the owner form as argument. My dll doesnot have a form. I would like to know how can I pass the TestStand form as owner to this Save File dialog object.
    Thanks in advance

    Biju,
    You can build create the implement the IWin32Window interface and get the handle of TestStand window. I have created an example you can check out.
    Regards,
    Song Du
    Systems Software
    National Instruments R&D
    Attachments:
    Class1.cs ‏1 KB

  • Save File Dialog with PDF servlet

    I've looked through messages posted relavent to this topic but I'm having trouble finding a solution to my particular problem.
    I'm running a servlet that is used to dynamically generate completed business documents using given a customer number. The servlet loads the customer information, generates a collection of forms as a single pdf document and sends it back to the browser.
    The problem is, the servlet doesn't work in one of the scenarios that is required: we email a link to an adminstrator that clicks on the link to view the documents, e.g.:
    http://myhost/myservlet.srv?custno=1234
    When you click on the link in the email (using Outlook), you always get the "save/open file" dialog box. If you click cancel AND LEAVE THE BROWSER OPEN and click on the link again in the email, everything works fine--the pdf document opens up in Adobe. It's just when the OS has to launch a new browser window that it doesn't work and you get the dialog.
    I've tried using the content disposition header (both inline and attachment). I've tried setting the content length. I've tried adding no cache headers. Nothing seems to work for this particular use case.
    Anybody seen this before? I could really use a hint.

    There are two thing that u can do.
    First try setting the contenttype as text/html and see
    if it works. The reason its opening a download box is
    that the stream is coming as a .pdf header and browser
    is not getting a plug in for the same.
    another way is a bit patchy.
    you have to set some kind of parameter with your url
    that u send in e-mail.
    then depending on this parameter. first send a
    javascript to reload the page.
    something like.
    if (request.getParameter("isMail))
    //send
    javascript:document.location().substring(0,indexOf('&is
    ail');
    else
    //your normal processing
    this way browser will actually resubmit the request
    from browser itself and will resume your normal
    processing.
    Regards
    KuldeepThis is kind of what we finally did. We decided that rather than have the url point directly at the servlet, we had the link point at a jsp that simply digests the parameters and constructs a new url to the servlet and then sends a redirect to the browser to the new url.

  • How to incorporate File name and timestamp automatically into select and save file dialog box?

    Hello,
    i am trying to incorporate the file name which is inputed by the user along with the timestamp into the selected and save file dialog box. Can you help?
    Thanks
    Solved!
    Go to Solution.

    You can pass a default file name to the 'File Dialog' Express VI.
    Use the 'selected path' output to open the file.
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness
    Attachments:
    FileDialog.vi ‏21 KB

  • File dialog (Save, Open, Export, etc.) does not appear in Firefox

    Hello,
    I am having a very similar problem to the one described in this link ...
    https://support.mozilla.org/en-US/questions/990487?esab=a&as=aaq
    ... and I can provide some additional information.
    In my case, the issue is not isolated to saving a file (although, that is where I first noticed it). It is definitely an issue with trying to display the common File dialog - be it for saving a file from a link, or File -> Save Page As, or File -> Open File, or Bookmarks -> Show All Bookmarks -> Import and Backup (to/from HTML), etc., etc.
    Here are the things I have already tried (not necessarily in this order):
    Uninstall/Reinstall
    Safe Mode
    New Profile
    Disabled Anti-Virus/Firewall
    Reset Firefox
    I also tried regressing to v27.0.1, and still saw the same (mis)behaviour. I am totally perplexed.
    Any help/insight you can provide will be greatly appreciated! :-)

    Yes. Sorry, I should have mentioned that there have been several reboots involved during the troubleshooting.
    I am running Firefox in an admin level account in this case - so, there shouldn't be any permission issues there.
    I have tried shutting down both the desktop firewall software, and the anti-virus, and the problem still persists exactly as described. (Obviously, I disconnected the system when I did that [smile].)
    All other software on the system that I have tried, interacts with the file dialog just fine ... so, I don't think it is anything central like some corruption associated with the file dialog itself.
    As I said, it is most perplexing.

  • How do i disable the open/save image dialog box in firefox? I want to directly save the image file to the drive.

    How do i disable the open/save image dialog box in firefox? I want to directly save the image file to the drive without clicking on save option everytime when saving an image. I'm using firefox ver 35.0.1 for windows 7.

    Click on the Firefox menu. Then click "Options". Go to "Applications" tab. Search for jpg and png file type. You will find they have "Always ask" action attribute. Change it to "Save file".
    Hope it will work fine for you.

  • Save File Dialog problem

    Hello ! I'm new with java so dont be to rude plz ;) ...
    First, my situation :
    I have a jsp that calls a servlet that get data from a database. After that I have to take these data and write them in a .txt file by calling a Save File Dialog. What I've done for now is to put
    response.setContentType("application/msword");
    response.setHeader("Content-Disposition",
    "attachment; filename=\""+fileName+"\"");
    in my servlet after created my file.
    My problem :
    The Save File Dialog shown but if I save the file, it contains the code of my jsp page. I suppose that I have to "bind" the file and the response, but how do I do that ??
    Or if you have a better way to do it ...
    Thx a lot !

    Here's some changes ...
    I'm now able to get the file with a Save File Dialog, but I also get my jsp code in the top of my page.
    Here's my code :
    String fileName = "MyData.txt";
    File myFile = (File)request.getAttribute("file");
    /*cyc.mypackage.DataDefects ddDefects = bConn.getddMyDefects();
    cyc.mypackage.Export exp = new cyc.mypackage.Export();
    File myFile = exp.createDataFile(ddDefects, fileName);*/
    String value = "attachment; filename=\"" + myFile.getName() + "\";" ;
    response.setContentType("application/octet-stream");
    response.setHeader("Content-Disposition",value);
    response.setContentLength((int)myFile.length());
    BufferedInputStream fif = new BufferedInputStream(new FileInputStream(myFile.getAbsolutePath()));
    int data;
    while((data = fif.read()) != -1)
    out.write(data);
    fif.close();
    and the result is :
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <link href="./css/Cyclic.css" type="text/css" rel="stylesheet">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
    <title>Infos</title>
    </head>
    <body>
    <form id="fInfos" method="POST" action="./Login.jsp" >
    <input type="submit" value="Unconnect" />
    </form>
    <form id=...>
    ( ... I dont put all cause the code is too long ...)
    </form>
    212007778197.9059295654296875-1600
    212007779245.207000732421875-1600
    212007779927.3587188720703125-1600
    212007774641.695709228515625-960
    (... rest of my good data)
    Does anybody knows how to get rid of the jsp code ??

  • Suggest a filename extension in a save file dialog

    Hello guys,
    does any of you know, how to suggest the user a certain filename extension in a save file dialog?
    I'm using both the normal save file dialog:
         javax.swing.JFileChooser.showSaveDialog,
    and the Java Web Start save file dialog:
         javax.jnlp.FileSaveService.saveFileDialog.
    For both ways I seem not to be able to suggest the user a certain extension for the filename.
    For the normal dialog, I call setFileFilter on the JFileChooser instance.
    The filter shows up in the dialog, and is used by default, but when the user types a name and approves, the returned filename does not have the extension added.
    Of course I can add the extension programmaticaly, but not when inside the JAWS sandbox.
    For the JAWS dialog, I pass an array containing my extension, but it is ignored as if I didn't specify any extensions. The API specs already say that this parameter "might be ignored by the JNLP Client".
    So how to tell the user what extension to use?
    More people must have encountered this problem.
    I'm making an application that saves and opens xml files and exports html files.
    I'm using this code to test the behavior:import java.io.ByteArrayInputStream;
    import java.io.File;
    import javax.jnlp.FileContents;
    import javax.jnlp.FileSaveService;
    import javax.jnlp.ServiceManager;
    import javax.jnlp.UnavailableServiceException;
    import javax.swing.JFileChooser;
    import javax.swing.filechooser.FileFilter;
    public class ChooseFile
        static final String[] EXTENSIONS = { "xml" };
        static final String DESCRIPTION = "XML files";
        public static void main(String[] args)
         try {
             ServiceManager.lookup("javax.jnlp.FileOpenService");
             // we're running with JAWS
             System.out.println("JAWS filechooser:");
             System.out.println(choose_JAWS());
         catch (UnavailableServiceException x)
             // we're NOT running with JAWS
             System.out.println("normal filechooser:");
             System.out.println(choose_normal());
        static String choose_normal()
         JFileChooser fc = new JFileChooser();
         fc.setFileFilter(new CustomFileFilter(EXTENSIONS, DESCRIPTION));
         if (JFileChooser.APPROVE_OPTION == fc.showSaveDialog(null))
             return "selected " + fc.getSelectedFile().getName();
         else
             return "cancelled";
        static String choose_JAWS()
         try {
             FileSaveService fos = (FileSaveService)ServiceManager.lookup(
                         "javax.jnlp.FileSaveService");
             ByteArrayInputStream stream = new ByteArrayInputStream(new byte[] {});
             FileContents fc = fos.saveFileDialog(null, EXTENSIONS, stream, null);
             if (fc != null)
              return "selected " + fc.getName();
             else
              return "cancelled";
         } catch (Exception x)
             x.printStackTrace();
            return "";
    class CustomFileFilter extends FileFilter
        String[] extensions;
        String description;
        public CustomFileFilter(String[] extensions, String description)
         this.extensions = extensions;
         this.description = description;
        public boolean accept(File f)
         if (f.isDirectory())
             return true;
         String extension = getExtension(f);
            if (extension == null)
                return false;
         for (int i=extensions.length; i-->0; )
             if (extension.equals(extensions))
              return true;
         return false;
    public String getDescription()
         return description;
    private String getExtension(File f)
    String ext = null;
    String s = f.getName();
    int i = s.lastIndexOf('.');
    if (i > 0 && i < s.length() - 1)
    ext = s.substring(i+1).toLowerCase();
    return ext;
    }Any help is greatly appreciated!
    Tom Jansen

    @tjacobs01
    Hi Tom,
    I have a question regarding your classes
    tjacobs.ui.fc.FileExtensionFilter and
    tjacobs.ui.fc.FileChooser.
    When I look at your code, I see the filename extension is appended in showSaveDialog:     public int showSaveDialog(Component c) {
                        setSelectedFile(new File(f.getAbsolutePath() + "." + ((FileExtensionFilter)filter).getType()));
        }It gets the extension by calling getType on the filter. But getType is implemented as:    public String getType () {
            return mExtensionList.get(0).toString();
        }So this returns the first type in the list. It does not check what filetype is selected by the combobox.
    Am I missing something?
    Also, in getDescription:    public String getDescription() {
            if (mDesc == null) {
                mDesc = "";
                for (int i = 0; i < mExtensionList.size(); i++) {
                    mDesc += (i != 0 ? ", " : "") + "." + mExtensionList.get(0).toString();
                mDesc+= " files";
            return mDesc;
        }you seem to iterate through the list, but only take the first entry every iteration.
    Can you explain mExtensionList.get(0)?
    Do you know how to test what type is selected in the JFileChooser's combobox?

Maybe you are looking for

  • Printing problems with Safari 5.0.3

    I just bought a new HP LaserJet Pro M1536dnf Multifunction Printer to allow me to use AirPrint on my iPad and iPhone. But now I have a problem with printing Web pages from the Safari 5.0.3 browser on my Windows Vista PC to the printer over my network

  • I have a simple movie clip/ button question

    I have a simple movie clip on my scene 1 frame 1.  Inside that movie clip I have another movie clip, with a button on top that controls that mc.  Also have another movie clip with a button on top that I would like to take me back to scene 1, frame xy

  • Image does not display in iTunes

    Hi, My podcast cover art displays fine on the iTunes preview page: http://itunes.apple.com/podcast/mousechat-net-a-weekly-disney/id395503030 But when I view it in the iTunes application or on my iPod I do not get the cover art. FEED: http://mousechat

  • Publishing Guide for iBooks Author

    Hi All, Do we have Publishing Guide for iBooks Author - If so please share us the links. Thanks, Rocxy

  • I insert my sd card into my New iMac and nothing happens?

    I bought a brand new iMac and when I insert my sd card w/adapter nothing happens.  I checked the preferences and on general and advanced the boxes are checked that external will appear.  Is this a hardware issue?