Open file from table with double click

Hi all,
I use adf faces and JDEV 11.
I want to open a file by double clicking on row in a table. (file is stored in the database).
I first tried it with a button to open the file, with this code:
       System.out.println("Double click!");       
       BindingContainer bindings = this.getBindings();
        DCIteratorBinding iter = (DCIteratorBinding)bindings.get("XxahelpBezoekRapDocView1Iterator");
        Row row = iter.getCurrentRow();
        FacesContext fc = FacesContext.getCurrentInstance(); 
        HttpServletResponse response = (HttpServletResponse)fc.getExternalContext().getResponse();
        response.setHeader("Content-Disposition","attachment; filename=\""+row.getAttribute("Filename").toString()+"\"");
        response.setHeader("cache-control", "no-cache");
        try {
            InputStream in;
            in = ((BlobDomain)row.getAttribute("Bijlage")).getInputStream();
            ServletOutputStream out = response.getOutputStream();
            writeInputStreamToOutputStream(in, out);
            fc.responseComplete();     
        } catch (IOException e) {
            e.printStackTrace();
        } This is working fine.
Now I wan't to open the file with double clicking on a row.
For opening the file I use the same code in the backing bean and this code on the page:
      <f:facet name="metaContainer">
    <af:group>
        <trh:script>
           goEditRow = function(event) {
                AdfCustomEvent.queue( event.getSource(), "doubleClickOnRow", {}, false);
        </trh:script>
    </af:group>
    </f:facet>And a clientListener and serverListener on the table:
<af:clientListener method="goEditRow" type="dblClick"/>
<af:serverListener type="doubleClickOnRow" method="#{backingBeanScope.backing_pages_EditTicket.doubleClick}"/>The only thing that happens when I double click is that I see "Double click!" in the console. But I can't save the file :S
What is the problem?
Thanks in advance.

Hi
What we do is to pick a table column for downloading the file.
We change the component in the column to the an af:commandLink and add an
af:fileDownLoadActionListener to the command link.
The user clicks on the link to download (open) the file.
Its not exactly the same as what you requested (double
click on the row) but it might be another solution.
Regards
Paul

Similar Messages

  • Can't Open Files Or Folders By Double Clicking on Its Icon

    I'm unable to open any file or folder by double clicking on its icon whether the icon is on my desktop or in a folder.
    For example, I can't open my hard disk or any DMG file on desktop by double clicking on its desktop icon, but I can open it or any file or folder by control-clicking on the icon and then clicking on 'open'.
    In my Finder, If I double click on an item in 'list' I can open it and in' columns' if I double click on an icon in 'preview' it will open/ launch and in 'cover flow' if I select an icon and double click on it there the file will open/launch.
    I've repaired permissions, 'verified disk' in Disk Utility (no problems found),
    run Disk Warrior as well as Applejack but the problem persists.... I just can't open by double clicking.
    Anyone have any ideas?

    Pretty weird...but I think I've heard of it before. I have no direct answer, but when weird stuff like this happens, I think of trying things like:
    -boot from OSX DVD and check operation
    -Time Machine backup
    -Safe Boot - might correct something
    -log out of user account and/or log into another user account, and see if doubleclick returns
    -and the usual SMC/PRAM reset
    I'm assuming you've diddled with the mouse/trackpad settings. Did you try a mouse?

  • Open File from Filesystem with OutputLink

    I have implemented an UploadForm with JSF. With this form a File is uploaded to my filesystem and some data (link to filename, filename itself and so on) are written to the Database.
    No I display these data from the database in a datatable and I want to implement a link, that the user can open the file from the filesystem. I have tried a outputlink with something like that:
    <h:outputLink value="file:C:\Entwicklung\IDE\eclipse\readme.txt" target="_blank">
                   <f:verbatim>
                        Test
                   </f:verbatim>
    </h:outputLink>
    I'm not sure if the file: Command is the right...
    The problem is, that nothing happens. When I try to save the file, pressing the right button and choose "Save as..." the file is correctly saved.
    How can I implement a link to open a file from the filesystem?
    Regards,
    Andy

    No the file won't be a html file..
    I will be some kind of pdf or doc?
    So how to launch them? Do I need an Outputstream?
    Has anyone experiences with that?Any file could go as an href value.
    Issue is not file type, but a proper URI that the server could resolve.

  • Creating an Excel file from table with 40,000 records

    I need help with creating an Excel file for client that has a
    table of 40,000 records. I have code that generates the Excel and
    has worked well in the past but with this much data it is timing
    out.
    I've already informed the client that Excel has limit of
    66000 records. So it might be better to export to CSV as the data
    in this table is going to keep growing.
    If you have time to work with me on this , contact me a
    alexagui [at] gmail [dot] com
    and I can send you more details so you can put together an
    accurate quote.
    Thanks,
    Alex

    asdren_one wrote:
    > I need help with creating an Excel file for client that
    has a table of 40,000
    > records. I have code that generates the Excel and has
    worked well in the past
    > but with this much data it is timing out.
    >
    > I've already informed the client that Excel has limit of
    66000 records. So it
    > might be better to export to CSV as the data in this
    table is going to keep
    > growing.
    >
    > If you have time to work with me on this , contact me a
    alexagui [at] gmail
    > [dot] com
    > and I can send you more details so you can put together
    an accurate quote.
    For so many records my guess is that the concatenation times
    the most
    time so you'll need to use StringBuffer to build the string.
    Google for
    coldfusion and stringBuffer:
    http://www.stillnetstudios.com/2007/03/07/java-strings-in-coldfusion/
    Mack

  • Opening files from SSH in PCManFM

    I'm using Fluxbox, and I'm using PCManFM (launched via "dbus-launch pcmanfm") as my file manager.
    I opened an SSH folder, and when I double clicked on a file to open it, nothing happened.  For example, on a .txt file, gvim opened, but it didn't load the file.  Where does PCManFS mount SSH folder, and how can I have it open files correctly when I double click on them?

    As far as I know You can only manage files (move, copy, delete etc.) the way You are trying to do it as they are not "local". It may not be the greatest advice but I feel like it may sort You out - use SSHFS to mount the ssh share and then just add it to the Pane in PCManFM? This way the files and folder will act like a local files and folders. This will allow You to play with them (edit, play etc.) just like they are on the hdd of the machine that You are currently sitting next to.
    Regards.
    Andrzej
    P.S. Instead of sshfs-fuse package You will need sshfs as the howto was written when I was using PCLinuxOS. I am using the same method with ArchLinux without any issues on LXDE and KDE4 machines here.
    Last edited by AndrzejL (2013-02-20 11:20:47)

  • Opening files from WebUI

    Is it possible to forse IE to open files from IFS with asociated program out of IE window?
    If I choose to open .xls file it should open in Excel and not inside IE window.

    I looked in IE 5.5 & IE 5.0(on Win2000) and there is no 'Launch browser windows in a separate process' option nor any other similar option under 'Internet options'.
    Any ideas why?
    in IE 5.0 (Win 98) I found that option but it doesn't work - files are still opening in IE window.
    null

  • Why can't I open files with double click, etc?

    Hello, all,
    I have been having problems with my MacBook (Aluminum late 2008, I think, OS 10.5). It runs slowly; files on the desktop and in my "Macintosh HD" often won't open with double-click but have to be opened with File-->Open; there are Word Work Files that won't go away; the trackpad is often stiff and not very responsive; clicking on the mouse is very stiff, despite very easy settings. In short, a lot of things are sluggish. Sometimes, also, I get the spinning beach ball, but not all the time.
    I have run disk permissons repair from Disk Utility many times (both from the desktop and from the MacBook install disk); I have replaced the directory with Disk Warrior at least twice; I have verified that the disk is OK; I have zapped the PRAM; and done other things of that kind.
    I took the MacBook to an Apple Store yesterday. It had been unplugged and much to my surprise, most everything seemed to be working all right. When I opened it today, however, I found everything as it was before I took it to Apple. Including the Word Work files, which I thought were gone.
    If I recall correctly, this started when I was working on a long editing project in Word, but I don't know whether that has anything to do with what has happened. I've done similarly long projects before, and this never happened.
    I could try trashing the Word Work files (there seem also to be quite a lot of folders with "recovered" files), but I don't want to do that unless I can be assured that nothing bad will come from doing that.
    I know this seems quite comprehensive, and may involve several issues, but I'm really unhappy about this and would love to think there is something more I can do, apart from returning to the Apple Store. Besides everything else, how can I khow that I won't find, again, that the MacBook will work fine there but goes back to its troubled state when I return?
    Clues, anyone?
    Thanks,
    jenny

    Hi, Mike,
    I have 211.59 left out of total HD space of 232.57.Space should not be a problem. I'll try using Activity  Monitor today. I have 2 GB of memory. But since this is the first time I[ve had this problem, I don't see how it could be a problem with memory, do you?
    I finished the project more than a week ago. After I shut down the computer, it temporarily returned to normal but subsewuently started acting odd again, although I've done nothing but email since I turned it on again.
    I am going to try getting rid of the Word Work files and see whether that helps. I am wondering whether the book I was working on had something wrong with it (it was written in NeoOffice but opened in Word), or my copy of Word has gotten corrupted. Although I haven't used Word since I finished with the book.
    Sorry this font is so tiny, but although I was able to choose my font in my original message, there doesnt' seem to be a place to do that here. At least, I don't see it.
    I'll get back to you on the Activity Monitor. Thanks.
    jenny

  • InDesign files won't open with double click

    InDesign files won't open with double click on my MacPro with Snow Leopard although they do open from external hard drives when I double click.

    Thank you very much,you were correct, it appears the mouse clicks were set too fast. Thank you very much indeed for taking the time to answer my question.
    Regards,
    Mag1975

  • I am trying to download photoshop presets from online but can't seem to figure out how to open them in photoshop. They download sucessfuly and then goes to my download folder on my computer, from there I double click on the file and photoshop opens and th

    I am trying to download photoshop presets from online but can't seem to figure out how to open them in photoshop. They download sucessfuly and then goes to my download folder on my computer, from there I double click on the file and photoshop opens and then nothing happens, any ideas? I am using a PC

    This video is a great step by step tutorial.
    Photoshop: How to Download & Install New Brushes & other Presets - YouTube
    Gene

  • Mouse failing to open folders and files with double click.

    Mouse suddenly decided not to open anything with double click. It will highlight with single click but will not open files. Could I have a broken mouse? Could a virus be causing this? I have checked the mouse settings under System preferences and made sure my pc-using children have not set the mouse to second-click status. Any ideas?

    Check back in system preferences > mouse > Double-click speed.  Move the slider to the slower end of the scale.
    Regards

  • Plese help me ! can't open files with double clicking icons...

    at the first, sorry about my English. (i'm japanese and english is my second language so..) anway.... i can't open the files on desk top by double click. if i go to Finder then i can open files... and some files i can open by double click. i downloaded Limewire but i can't install it because my couble click is not working for that. but i can double click to open photoshop, safari or email or some other things in the dock. and i couldn't open up the games either.. doesn anybody knows what's happened to my son's computer? it's a iMac flat panel G4. and OS X 10.3.9. Thank you sooo much!!

    Saw your response and started to write to you for help also but have, with one final try, found PART of my problem. I have a Logitech wired optical mouse that worked with everything except opening desktop volumes when I double clicked on them. I could open applications and documents within the Finder window....just not the desktop volume icons.
    I ran Disk Utility........verified all the volumes........repaired all permissions, unplugged mouse and reset. Logitech software is up to date.. I've never had this happen before.
    What I discovered was that I was double clicking to open the volumes, but had the mouse set for single click. It's still a little strange because I changed it to double click to open and now it opens with double OR single click. Now I can open the volumes but it won't allow me to move the Finder windows that open. I can't drag or move them on the desktop; have to use them where they open.
    Any suggestions for me, I hope? Thanks.

  • My trackpad can't open file with double click

    i don't know what's going on, but my trackpad can't open file with double click. i have to open it with right click, open or open with. i've tried to fix it in the system preferences, it didn't work out well.

    William - you are wonderful!  I had looked at that - they were set to 'internal' which seemed like RH...but selecting the 'design view' and then reselecting 'use default editor' instead of 'auto-select editor' did it.  THANK YOU!!!!!

  • Sublime Text 2 won't open files with double click

    Hi, this is my first time asking for something.
    Well, i've been using Scribes, but sometimes i need tabs in my text editor, so i installed Sublime Text 2.
    The problem is that i can't open files with double click, i need to use "subl filename" and that it's not funny :S
    If i double click a file ST2 opens, but with a tab named "file" and without content.
    Is there a fix for that?
    My Arch installation (if is neccesary):
    Arch x86_64
    Openbox (stand-alone)
    PCManFM
    P.D: sorry for my english D:

    the reason seems to be a broken desktop file.  `/usr/share/applications/sublime-text.desktop` says `Exec=subl %U`, but it should be `%f`. Also the Aur package does not provide a `subl` symlink so you should create one.

  • Nothing will open with double click

    Help! Our iMac seems to work OK, except that nothing will open with a double-click in Finder. It is not the mouse, which works fine. I rebuilt the directory with DiskWarrior, but that did not help. What is weird is that things do open with double-click soon after you reboot it. But after a day or so, it stops working. Any ideas?
    Thanks,
    Carlos

    Hi Carlos!
    It maybe your Mouse or your Mouse Preferences are getting lost somewhere. What type of Mouse do your have? When you lose the ability to double click, can you still right click and see the menu dialog? If so, try to open your file this way, if nothing happens when you right click try the next step below...
    You should check: System Preferences > Keyboard & Mouse > Mouse... from here make sure you right (secondary) button is activated and double click speed is not too fast or slow.
    Let us know, good luck, Rick
    iMac G5 iSight 20" - 30G iPOD in Slimming Black - WD 500G FW -   Mac OS X (10.4.8)   - HP Pav 15" WS and Toshiba Sat 17" WS LP's - Canon 20D & A620 Kodak P880

  • Problem with 9.3 Reader when opening files from internet

    I keep receiving the message 'There is a problem with Adobe/Acrobat Reader.  Please exit Adobe Acrobat/Reader and try again' when trying to open come files on the internet.  I am able to open files from my hard drive and some files from the internet.  I have uninstalled and re-installed Reader, but get same result.  Any ideas?

    As I posted on Feb. 19 this is what works for me.  OS is Windows 7 64-bit, AdoveReader 9.3.1., IE8.
    Open Adobe Reader,
                go to edit menu,
                under Preferences
                go to Internet, uncheck "Display pdf in browser"
    The pdf files then open, but not in the browser
    or if you have Google tool bar installed:
    On the Google tool bar
                            click on the options icon (a wrench)
                            go to Tools
                            scroll down to the bottom
                            uncheck Translate
    Or uninstall the Google tool bar.
    Pdf files open without a problem in Firefox.
    All of these solutions are easy.
    Good luck,
    Too Green

Maybe you are looking for