Af:fileDownloadActionListener picks wrong filename for the first time after row selection.

Hi,
I am using Oracle Jdeveloper 11g release 1. In one of my jspx pages i have a table, i can select one of the row and click on a button which invokes fileDownloadActionListener. The code of jspx is as below:
<af:commandMenuItem text="#{coregccomplianceuiBundle.MENU_EXPORT}"
                                    id="CS19" partialSubmit="true"
                                    actionListener="#{viewScope.core_gccompliance_cs_librarybean.validateExport}"
                                    partialTriggers="CSftLib"
                                    disabled="#{viewScope.core_gccompliance_cs_librarybean.exportDisabled}">
</af:commandMenuItem>
<!--This button is set hidden, which is used to deal with the download job.
    The Export button on the page only does the validation. (whether it's a system defined standard)-->
  <af:commandButton text="#{coregccomplianceuiBundle.BTNEXPORTHIDDEN}" id="csl_csExportHidden"
                                      clientComponent="true" visible="false"
                                      partialSubmit="false">
<af:fileDownloadActionListener contentType="application/x-download" 
                                      method="#{viewScope.core_gccompliance_cs_librarybean.handleExport}"
                                      filename="#{viewScope.core_gccompliance_cs_librarybean.fileName}"/> 
</af:commandButton>
  /** force the ExportHidden Button to do export */
    function csExportHandler(event) {
        var exportCmd = AdfPage.PAGE.findComponent("emT:CS4:csl_csExportHidden");
        var actionEvent = new AdfActionEvent(exportCmd);
        actionEvent.forceFullSubmit();
        actionEvent.noResponseExpected();
        actionEvent.queue();
The bean methods used in above block are as below:
public void validateExport(ActionEvent actionEvent) {
       // checks if entity is system defined and shows error popup if it is .
        if (checkIsSystem())
            return;
        //Handle the export    
        AdfUtil.addScript("csExportHandler()");
public void handleExport(FacesContext context, OutputStream out) {
        ComplianceLibraryAMImpl am = getDataController();
        HttpServletRequest request =
            (HttpServletRequest)context.getExternalContext().getRequest();
        Locale locale = NLSUtil.getClientLocale(request);
        ResourceBundle rb =
            ResourceBundle.getBundle("oracle.sysman.core.gccompliance.view.CoreGccomplianceUiMsg",
                                     locale);
        PreparedStatement st =
            am.getDBTransaction().createPreparedStatement("commit", 1);
        Connection conn = null;
        boolean isAgentSideCs = false;
        try {
            conn = st.getConnection();
            RichTable oTable = getCsTable();
            fileName = "ComplianceStandard.xml";
            List<Raw> exportGuids = new ArrayList<Raw>();
            for (Object opaqueFacesRowKey : oTable.getSelectedRowKeys()) {
                oTable.setRowKey(opaqueFacesRowKey);
                Object o = oTable.getRowData();
                JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)o;
                exportGuids.add((Raw)rowData.getRow().getAttribute("CsGuid"));
                int csType = ((oracle.jbo.domain.Number)rowData.getRow().getAttribute("CsType")).intValue();
                if(csType == 4)
                    fileName =
                            (String)rowData.getRow().getAttribute("CsDname") + ".zip";
                    isAgentSideCs = true;
                else
                    fileName =
                            (String)rowData.getRow().getAttribute("CsDname") + ".xml";
                if(((Integer)rowData.getRow().getAttribute("IsSystem")).intValue() == 1){
                    throw(new ParseException(50));
            if (exportGuids.size() > 1)
                fileName = "Compliancestandard_list.xml";
            RAW guid = new RAW(exportGuids.get(0).toString());
            if(isAgentSideCs)
                getDataController().exportStandardContent(conn, out, guid);
            else
                CsExport csexport = new CsExport(false);
                csexport.doCsExport(conn, guid, false, out);
        } catch (ParseException e) {
            String errMsg = "";
            String errHdr = "";
            if(e.getStatus() == 50){
                errMsg = rb.getString("ERRMSG_ISSYSTEMENTITY_EXPORT");
                errHdr = rb.getString("ERRHDR_ISSYSTEMENTITY_EXPORT");
            else{
                errMsg = rb.getString("ERRMSG_EXPORT_CS");
                errHdr = rb.getString("ERRHDR_EXPORT_CS");
            AdfUtil.showMessageDialog(null, AdfUtil.MESSAGE_TYPE.ERROR, errHdr,
                                      errMsg, false, null);
            throw new RuntimeException(e);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        } finally {
            JDBCUtil.close(st);
        MimeUtil mimeUtil = new MimeUtil();
        mimeUtil.downloadFile(context, fileName);
        try {
            out.flush();
            out.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
Class MimeUtil:
public void downloadFile(FacesContext context, String fileName) {
        HttpServletResponse httpServletResponse =
            (HttpServletResponse)context.getExternalContext().getResponse();
        HttpServletRequest httpServletRequest =
            (HttpServletRequest) context.getExternalContext().getRequest();
        String unicodeFileName = fileName;
        String agent = httpServletRequest.getHeader("USER-AGENT").toLowerCase(Locale.US);
        boolean isIE = false;
        if (null != agent && -1 != agent.indexOf("msie"))
            isIE = true;
        //encode the output file name to support NLS
        unicodeFileName = MimeUtil.encodeFileName(fileName, isIE);
        httpServletResponse.setHeader("Content-disposition",
                                      "attachment;filename=\"" + unicodeFileName +
httpServletResponse.setContentType("application/x-download");
        context.responseComplete();
        httpServletResponse.setContentType("application/x-download");
        context.responseComplete();
Now when i come to the page for first time and select a row and click on Export then the filename that gets shown in save file dialog is incorrect (it shows partial adf taskflow name) , but when i select the row again by clicking on any other row and click export it shows correct filename i.e. selectedRowName.zip or .xml according to type of row selected.
Can anybody suggest what am i missing?

difficult to tell like this.but better you debug your code then you can get where you getting filename wrong.

Similar Messages

  • Why does my iphone 3gs screen go white after it goes "to sleep" for the first time after turning it on?

    Why does my iphone 3gs screen go white after it goes "to sleep" for the first time after turning it on?
    The screen isn't broken because it works after i turn the device off and back on, but after it goes black once, it's only white again.
    But it takes the touches although it's only white, because I can answer my phone when I slide my finger on the bottom of the screen, eventhough there in not the button to see.
    This is so weird. I have already done everything I can think of that might help. But I cannot think of anything that might be causing it, because nothing has happened to the device.

    Let me know if I should start a new discussion instead of opening a new topic here.
    My wife's iPhone is the same vintage as mine 3Gs, but has never had the battery problem.  Its affliction instead is that it cannot detect WiFi networks unless it is quite close to the source.  Often, when my iPhone not only detects but shows a maximum cells connection with a network, hers cannot detect the network at all.  In contrast, her iPhone seems to detect ourcellular carrier just as well as mine does.
    Is there any help for this affliction?

  • TS2518 My RAW (nikon .NEF) files changing to a dull, darker version of themselves after selecting them for the first time after import.

    My RAW (nikon .NEF) files are literally changing to a dull, darker version of themselves after selecting them for the first time after import. I.e. The correct photo (light/color/etc) seems to be there and then a second later the photo changes. It's almost like it's showing a quick enhanced version then back to basic raw image. Started within last two updates.
    Is there a fix or is this the straw that forces a switch to Lightroom?

    Just recall that Aperture (or any other 3rd party raw converter) has NO information about the JPEG preview and how it was made.  That information is camera-vendor proprietary.
    Also note that there are like 6 "picture styles" in camera and this change you're seeing is entirely dependent on how you have them set.  If you have your camera set to "vivid" or something you'll see more of a change than if your on-camera is set to "faithful."
    That said, people here ALSO complain that Aperture's initial renders are TOO vivid, the exact opposite of your complaint, so you can't please everybody (in some cases, it seems you can't please ANYBODY ;-)
    Aperture provides a starting point.  Again, if you don't like it, you can tell Aperture to go with a "punchier" interpretation at its first render.  In the import dialog, try setting Aperture to use the "auto enhance" preset which is built in.  Aperture will add a little vibrancy adjustment, and it will add a curve, which will greatly add punch to the image.  If you want adjustments in a different direction, you can create a preset and set it at import.
    The only thing Aperture CANNOT do is what you're asking, which is "take the JPEG that my camera vendor generates through some voodoo and try and render the raw file just like that."  It's, unfortunately, impossible to do.

  • I am trying to run my registered CS6 Design Standard programs for the first time after install. InDesign runs OK, but Illustrator and Photoshop will only run in trail mode. How do I activate those two?

    I can't get my registered versions of CS6 Photoshop and Illustrator to run in full mode. I installed CS6 Design Standard online end of June (an upgrade from CS5.5), on my old MacBook Pro. I didn't run the programs then as I was waiting on arrival of new MacBook Pro. I migrated the programs from my old MacBook to the new, and today tried to run those programs for the first time. InDesign work OK (after an initial hiccup) but Illustrator and Photoshop will only run in trial mode, and won't let me save files. My CS6 Design Standard shows with it's registration in my Adobe Account. All seems in order, but Illustrator and Photoshop won't run in registered mode. Can you please help?

    Demons1 in the future please only migrate your documents and settings.
    Please use the uninstallers to remove your current installation.  They are located in the Applications/Utilities/Adobe Installers folder.  Once the uninstall is complete you will also want to run the CC Cleaner Tool.  You can find more details at Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6 - http://helpx.adobe.com/creative-suite/kb/cs5-cleaner-tool-installation-problems.html.
    If you need to download a fresh copy of the installation files for Creative Suite 6 you can do so at Download CS6 products.

  • When I open FF4 for the first time after starting the computer it is very slow to load. From then on it loads normaly.

    I have an HP Pavilion DV9000.

    I had this problem too. Not just with FF 4 but also previous versions. For that and other reasons I decided to by an SSD and install windows and all the programs on there. That worked fine except for firefox. Boot time is much faster (2o secs) and programs (from the startup folder) are loaded almost immediately after the desktop comes up. However firefox still took 90 seconds to load. After some trial and error I disables in the registry prefetcher and superprefetch (I am running windows 7, no SP1). Then I restarted my computer twice. The first time firefox did not load any faster but at any subsequent startup firefox starts in a few seconds. In fact some times it is so fast it comes up before the wireless network connection is established. HTH
    HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/SessionManager/MemoryManagement/PrefetchParamaters/EnablePrefetcher --> 0
    HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/SessionManager/MemoryManagement/PrefetchParamaters/EnableSuperFetch --> 0

  • Help - Crackled sound using the speakers for the first time after wake up?!

    I've a new white MacBook since Monday.
    The problem is:
    After turning on oder waking up the notebook, I want to play a sound or music. The first time the speakers are used, the sound is very weak and crackled, but after two seconds or so it's ok again.
    The same happens if the first sound is the emptying-sound of the trash or every other sound.
    This happens every time I start the computer.
    Has anyone the same problem?
    Thank you in advance!
    Greetings form Switzerland
    Message was edited by: Dominik Huber

    Many people have experienced this, usually when using auxiliary speakers. It happens with my desktop on booting. It's very normal.
    You might find this workaround useful and effective:
    https://bugs.launchpad.net/ubuntu/source/linux-source-2.6.20/bug/75906

  • When I click on Firefox for the first time after I boot my PC it takes three minutes to but after that new Firefox windows open promptly.

    Hello and thank you for being available to receive this enquiry.
    I like Mozilla.
    I like Firefox.
    In recent months I have experienced and accumulation of problems. Today (September 25th, 2011) I have set about trying to deal with them.
    After consulting your Troubleshooting Section I have made a range of changes that I hope shall resolve problems like freezing, unresponsive scripts, non responding windows and browser crashes.
    At the time of writing I have rebooted after making those changes so I have yet to discover whether they solve those problems.
    However, I have chosen o write now as I already am re-experiencing the first problem I encounter when I boot my PC, i.e. Firefox takes three minutes at least to start after I click the icon. Once it has started, however, ne Firefox windows open promptly.
    How do I solve this? I rememebr a time when Firefox opened with lightning speed whenever I clicked the icon.
    Thank you for your valued help and interest.
    Patrick O' D.

    Hello Patrick O' D,
    In my experience t here are two different problems with the speed of firefox on startup
    # your os and setup
    # firefox - and exactly what you use with it
    Some factors will be down to your OS and for instance what does start up initially, many of those factors will affect other programmes/applications and not only firefox.
    Some other factors depend on Firefox and how you set that up, I always like to have the option to using Firebug but realise it cold clash with other software or slow down firefox startup so I only enable it as I need it. see for instance: https://addons.mozilla.org/en-US/firefox/performance/

  • Does anyone having problem when saving in photoshop for the first time after launching the program it will crash while trying to save file?

    It started a few days ago, I am running Mac Yosemite. It is also happening in Illustrator.

    Yosemite…
    You'll have to wait until Apple fixes all the bugs introduced in 10.10.  Lots of folks are going back to Mavericks.

  • Updated to iOS 7, when my phone came on for the first time I could see I had 2 new viber messages.  When I went to open viber it asked me to register my number, which I did. Once the app was open I noticed all my message history was gone.

    Hi,
    I have only just upgraded to iOS 7 on my iPhone 4 and am having a  problem with Viber. When my phone came on for the first time after the update I could see I had 2 new viber messages, when I went to open viber it asked me to register my number, which I did. Once the app was open I noticed all my message history was gone...
    I still have an itunes backup of my phone just before the update, I restored it to this backup, followed the same process and now viber will not even work (the access code wont sms to me and the phone call option for recieving this code also come up with some error about not being able to do this at this time).
    I have been able to access viber using another phone number (I have two sims which I use as I am currently overseas in south korea, my referenced australian sim has worked previously on viber overseas and I definently do have roaming on) but again I have no message history.
    So to questions:
    1) Why is my activation not working under my referenced australian number?
    2) Can I recover all my message history which should be saved in my itunes backup?  I am willing to revert to this backup state again if needed.
    Please help.
    Thanks.

    Look iTunes>Preferences>Devices...is a backup listed for your iPhone 5 dated BEFORE you restored your iPhone 4 backup to your iPhone 5? If not, your data is gone. If there is a backup, on your iPhone 5: Settings>General>Reset>Erase All Content & Settings. You should now be able to restore that backup, if it exists, to your iPhone 5.

  • I synced my 3G with itunes for the first time and lost all contacts and information on phone, help?

    I synced my 3G iphone with itunes for the first time, and lost everything on my phone. how do i get it back?

    You don't.
    You synced your iPhone with iTunes for the first time after how long?
    And this didn't happen by syncing only. This means you transferred the backup for another iPhone or you restored the iPhone with iTunes. It is not possible for everything to be lost by syncing alone. All iTunes content on your iPhone can be lost but not any photos in the Camera Roll and the same for contacts unless you synced contacts with an empty address book application on your computer.

  • I synced my phone with iCloud for the first time and it put ALL of my husband's contacts on my phone. How to I take contacts off my iphone and reinstall only mine?

    I have archived my contacts on my computer and can reinstall only those, but I can't figure out how to wipe all of his contacts off my iphone.

    You don't.
    You synced your iPhone with iTunes for the first time after how long?
    And this didn't happen by syncing only. This means you transferred the backup for another iPhone or you restored the iPhone with iTunes. It is not possible for everything to be lost by syncing alone. All iTunes content on your iPhone can be lost but not any photos in the Camera Roll and the same for contacts unless you synced contacts with an empty address book application on your computer.

  • Multiple select list not retaining the value for the first time

    Hi,
    I have a 3 select list depends on each other. select_list1 -- > select_list2 --> multiselect3. I have use denes example to create them.
    For the first time when I select values from 1,2,3 and runs a report based on it, it works fine but *does not retain the selected value in multiselect3.
    for the second time submit the process, it retails value in multiselect3. Please tell me if you came across this issue before
    Here is the code.
    function get_select_list_xml_VL(pThis,pSelect,pSelect1,pSelect2){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    var l_Select1 = html_GetElement(pSelect1);
    var l_Select2 = html_GetElement(pSelect2);
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=Cascading_Select_List_VL',0);
    get.add('F660_CASCADING_TEST',l_Select1.value + '_' + pThis.value + '_' + l_Select2.value);
    alert(l_Select1.value + '_' + pThis.value + '_' + l_Select2.value);
    // alert(document.getElementById("F660_CASCADING_TEST").value);
    gReturn = get.get('XML');
    if(gReturn && l_Select ){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option");
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue)
    get = null;
    function appendToSelect(pSelect, pValue, pContent) {
    var l_Opt = document.createElement("option");
    l_Opt.value = pValue;
    if(document.all){
    pSelect.options.add(l_Opt);
    l_Opt.innerText = pContent;
    }else{
    l_Opt.appendChild(document.createTextNode(pContent));
    pSelect.appendChild(l_Opt);

    Please ask any question if you dont understand about the problem.
    Thanks

  • Misspelled email address when login to iPhone for the first time

    Hello everyone,
    I have quite a big issue with my iPhone (I have iPhone 5c).
    When I was creating my apple id for iPhone for the first time (after I purchased it)  I added an unexisting email address by accident (I never had or used that email as a domain I misspelled does not even exist...).
    Now I cannot access my phone at all (I needed to change a SIM card) and when I turned my phone back on, it showed that my phone was assigned for a particular apple id that is impossible to use - as an email (which is also an apple id in that case) and its domain,do not exist ...(it was even impossible to verify password after I accessed iPhone for the first time).
    I did not realized I cannot switch it to the other id to unlock my phone...as to change main apple id I would have to do it through the old one and this is - as I stated above - not possible at all ...
    using iCloud is also impossible for an above reason (cannot log in as I couldn't verify my password for main apple id).
    I have an additional apple id I use for an AppStore (that's how I managed to log in here)
    Does anyone have any idea/advise what are my options now?
    I am unable to use my phone at all because of that
    Thanks in advance!

    If you turned on Find My iPhone turn it off, then Settings > General > Reset > Erase All Contents & Settings.

  • Adobe form is printing wrong data for the first print attempt

    Hi All,
    I need a quick help from Adobe print form gurus. Until now i dint get an issue on printing adobe interactive form from my portal. For eg., when i am giving a print for the first attempt, it was printing the form with wrong data in form fields and whereas when i tried to print it for the second time, then it is printing properly with right information.
    Please help.
    Regards,
    Praveen Kambala.

    Hi Praveen,
    Find out the data what is being printed for the first time, and check what is the flag that is making the change.  Hope that should resolve your issue.
    Thanks,
    Rakesh.

  • Tried synching iphone for the first time on new PC and got error followed by itunes logo and USB cable picture. No idea what went wrong and now phone is in this screen locked. please help!

    tried synching iphone for the first time on new PC and got error followed by itunes logo and USB cable picture. No idea what went wrong and now phone is in this screen locked. please help!

    I tried connecting to iTunes and neither the PC nor iTunes recognizes the device. I went through all the troubleshooting on the Apple website for this issue and nothing worked. I've reinstalled iTunes, the driver, everything and still can't get either the PC or iTunes to recognize the phone.  I don't know what else to do :-( any help or suggestions are highly appreciated!
    I would hate to have lost all my info, especially contacts and calendar items since I have no idea what was backed up prior to the phone getting locked on this screen. I've been told that my only option is to go to the phone carrier and they will reset it for me, but that means it will wipe out all the info.
    I hope someone has a fix other than that one.

Maybe you are looking for

  • Handling contacts with iCloud, one person, multiple devices.  Help?

    Hi, and thanks for your help. I want to use iCloud to keep my contacts synced across my iphone 4s, my iPad 2 and, of course, icloud.com.  I just turned on iCloud on the iPhone 4s and performed a a backup, and now all of the 300 contacts from the iPho

  • MEMORY_NO_MORE_PAGING and TSV_TNEW_PAGE_ALLOC_FAILED

    Hi All, We are facing these errors approx. daily (but not everyday): MEMORY_NO_MORE_PAGING TSV_TNEW_PAGE_ALLOC_FAILED Now, I searched the Forum but there is no acceptable answer for the current issue. Some person said that it could be possible if a u

  • SJWS SP3 - Not including some jars from war file

    I have a problem when deploying my application using the new Java Web Server SP3 that when my application is deployed my weblogic.jar and j2ee.jar are not included in the classpath that is created. I have turned on finest detail logging and it does n

  • User disabled until start date not getting ROs provisioned via AP

    Here's the situation: I have a user in OIM that is disabled until start date. When the start date rolls around, and the job "Enable User After Start Date" runs followed by "Evaulate User Policies," the user is correctly enabled and the correct role g

  • Bonjour Sharing & Photo Resolution

    I am trying to share my iPhoto library with other accounts on my home computer (and other users on the home network). Other users can access my library with no problems, but the photos' resolution is very low. Am I doing something wrong?