Problems with OWA_COOKIE send and get

Hi all,
I have a problem with OWA_COOKIE-package. What I'm trying to do is to integrate Oracle eBS and an APEX app. The application resides on different databases and servers.
I'm basing my code on this white paper:
http://www.oracle.com/technology/products/database/application_express/pdf/Extend_Oracle_Applications_11i.pdf
I have the function set up in eBS and it redirects me to my APEX login page. The next step is to pass a cookie with the user name password to the APEX app. Here the problems begins.
My launch code in the eBS database (lots of hardcoded values just for the test):
PROCEDURE xxapex_launch (application IN NUMBER DEFAULT 107
                       , page IN NUMBER DEFAULT 1
                       , request IN VARCHAR2 DEFAULT null
                       , item_names IN VARCHAR2 DEFAULT NULL
                       , item_values IN VARCHAR2 DEFAULT NULL) AS
BEGIN
  OWA_UTIL.mime_header('text/html', false);
  OWA_COOKIE.send (name => 'APEX_APPS_107',
                   value => 'daniel:development',
                   expires => sysdate + 365,
                   path=>'/');
  OWA_UTIL.redirect_url('http://server:8090'||'/apex/f?p='||
                        application||':'||page||'::'||request||':::'||
                        item_names||':'||item_values);                       
END xxapex_launch;
The application process in APEX that should read the cookie(on-load before header):
DECLARE
  c OWA_COOKIE.cookie;
  a wwv_flow_global.vc_arr2;
BEGIN
  c := OWA_COOKIE.get('APEX_APPS_107');
  a := htmldb_util.string_to_table(c.vals(1));
  :P160_USERNAME := a(1);
  :P160_PASSWORD := a(2);
  IF :P160_PASSWORD IS NOT NULL THEN
    wwv_flow_custom_auth_std.login(
       P_UNAME => :P160_USERNAME,
       P_PASSWORD => :P160_PASSWORD,
       P_SESSION_ID => v('APP_SESSION'),
       P_FLOW_PAGE => :APP_ID||':160');
__END IF;
END;The error I get is no-data-found when this is run:
:P160_USERNAME := a(1);
The c.num_vals is 0 and what I can understand OWA_COOKIE.get does not find my cookie. Is there anybody out there that can point on what I'm doing wrong?
Regards Daniel

Back on this....
Is there somebody that have successfully implemented the solution described in?
http://www.oracle.com/technology/products/database/application_express/pdf/Extend_Oracle_Applications_11i.pdf
Questions:
Should I create a custom login page or use the default (that using my custom Authentication Scheme)?
In the white paper where it's described on how to create the application process (that reads the cookie) it says (page 5):
"This process should be conditional and should not be run if the login page is processing a logout request."
Does somebody know on how to achive this?
In my case my eBS is on one server and the APEX installation is on another server, I don't know if that's
what preventing it to work.
I'm trying to make a very simple proof of conecpt, my app only contain one login page (the default) and
one blank HTML-page. I have a database link between my APEX and EBS database (using APPS user). My
app works fine in a stand-alone scenario. But when I start it from EBS I get the login page (the appl.
process code has not fired) and if I tries to login using a username and a pwd I can se that the
appl. process fires and is reading the cookie correctly. The problem is that it "hangs" and it seems that
appl. process fires over and over again (can see that in my log table).
My code:
The Authentication Function
create or replace FUNCTION demo_ebiz_suite_auth
(p_username in VARCHAR2,
p_password in VARCHAR2) return BOOLEAN is
begin
__return true; /* can log in with whatever */
end;
Application Process - On load: Before header (page template header)
DECLARE
__c OWA_COOKIE.cookie;
__a wwv_flow_global.vc_arr2;
BEGIN
__demo_toLog('APEX process', '1');
__c := OWA_COOKIE.get('APEX_APPS_'||:APP_ID);
__a := htmldb_util.string_to_table(c.vals(1));
__:P101_USERNAME := a(1);
__:P101_PASSWORD := a(2);
__demo_toLog('APEX process', ':P101_USERNAME '||:P101_USERNAME);
__demo_toLog('APEX process', ':P101_PASSWORD '||:P101_PASSWORD);
__demo_toLog('APEX process', ':APP_ID '||:APP_ID);
__IF :P101_PASSWORD IS NOT NULL THEN
____demo_toLog('APEX process', 'before trying to login');
____wwv_flow_custom_auth_std.login(
______P_UNAME => :P101_USERNAME,
______P_PASSWORD => :P101_PASSWORD,
______P_SESSION_ID => v('APP_SESSION'),
______P_FLOW_PAGE => :APP_ID||':1'
____demo_toLog('APEX process', 'after login');
__END IF;
EXCEPTION
__WHEN OTHERS THEN
____demo_toLog('APEX process', 'Fel: '||SQLERRM);
END;
Maybe I'm doing some simple misstake here but I can't see it. I need a second opinion.
Thanks.
/Daniel

Similar Messages

  • Since upgrade to ios6 l have been having problem with wifi connection and connecting to App Store and iTunes store

    Q since upgrade to iOS6 l have been having problem with wifi connection and getting into App Store and itunes

    Saw this on another post.
    Applecare Senior Advisor Txx Bxxx (I have his contact info in an email he just sent) just confirmed with me that the problem people are having with the App Store not loading is an apple issue with there servers, ITS NOT YOUR IPAD so don't go restoring it!   It's not happening to everyone however but they are looking into it, its really hit or miss.
    In the meantime ...........
    The Complete Guide to Using the iTunes Store
    http://www.ilounge.com/index.php/articles/comments/the-complete-guide-to-using-t he-itunes-store/
    Can't connect to the iTunes Store
    http://support.apple.com/kb/TS1368
    iTunes: Advanced iTunes Store troubleshooting
    http://support.apple.com/kb/TS3297
    Best Fixes for ‘Cannot Connect to iTunes Store’ Errors
    http://ipadinsight.com/ipad-tips-tricks/best-fixes-for-cannot-connect-to-itunes- store-errors/
    Try this first - Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    This works for some users. Not sure why.
    Go to Settings>General>Date and Time> Set Automatically>Off. Set the date ahead by about a year.Then see if you can connect to the store.
    ~~~~~~~~~~~~~~~~
    iOS 6 Wifi Problems/Fixes
    Fix For iOS 6 WiFi Problems?
    http://tabletcrunch.com/2012/09/27/fix-ios-6-wifi-problems/
    Did iOS 6 Screw Your Wi-Fi? Here’s How to Fix It
    http://gizmodo.com/5944761/does-ios-6-have-a-wi+fi-bug
    How To Fix Wi-Fi Connectivity Issue After Upgrading To iOS 6
    http://www.iphonehacks.com/2012/09/fix-wi-fi-connectivity-issue-after-upgrading- to-ios-6.html
    iOS 6 iPad 3 wi-fi "connection fix" for netgear router
    http://www.youtube.com/watch?v=XsWS4ha-dn0
    Apple's iOS 6 Wi-Fi problems
    http://www.zdnet.com/apples-ios-6-wi-fi-problems-linger-on-7000004799/
    ~~~~~~~~~~~~~~~~~~~~~~~
    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    WiFi Connecting/Troubleshooting
    http://www.apple.com/support/ipad/wifi/
    How to Fix: My iPad Won't Connect to WiFi
    http://ipad.about.com/od/iPad_Troubleshooting/ss/How-To-Fix-My-Ipad-Wont-Connect -To-Wi-Fi.htm
    iOS: Connecting to the Internet
    http://support.apple.com/kb/HT1695
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    Additional things to try.
    Try this first. Turn Off your iPad. Then turn Off (disconnect power cord for 30 seconds or longer) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    Change the channel on your wireless router (Auto or Channel 6 is best). Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    Another thing to try - Go into your router security settings and change from WEP to WPA with AES.
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    If none of the above suggestions work, look at this link.
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Fix Slow WiFi Issue https://discussions.apple.com/thread/2398063?start=60&tstart=0
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • I'm having problems with 8.1 and Continuity / Handoff. It will work fine for web pages, etc. but in email when I try to do it between by iPhone 5s running 8.1 and my Macbook Pro running Yosemite I consistently get an error.

    I'm having problems with 8.1 and Continuity / Handoff. It will work fine for web pages, etc. but in email when I try to do it between by iPhone 5s running 8.1 and my Macbook Pro running Yosemite I consistently get an error. "Failed to Continue Activity" Cocoa Error 4609.  Handoff is working for phone calls and text messages. By email just crashes each time. It was also doing it under 8.0.2.  My iPhone and iPad handle this fine. It's only the MacBook to the iPhone that fails, and only on email.

    Handoff Continuity Troubleshooting

  • My iphone 4 was crushed on the road.  Bought a 4 replacement tried to restore it in itunes to get my contact info and it said there was a problem with my phone and I should contact mean

    My iphone 4 was crushed on the road.  Bought a 4 replacement tried to restore it in itunes to get my contact info and it said there was a problem with my phone and I should contact apple store.  What does that mean please?

    Is the replacement exactly the same as the original ie same memory size & same version? If so it may require updating the OS software before trying to restore your stuff from the backup.

  • When i try to update my itunes on my pc i keep getting the messaage that there was a problem with the installer and it could not finish. how do i fix this? i`ve tried to download 3 times already.

    when i try to update my itunes on my pc i keep getting the messaage that there was a problem with the installer and it could not finish. how do i fix this? i`ve tried to download 3 times already.

    Hi
    I've got a similar problem.  iTunes v10.2 worked fine, but when I tried to update it to 10.5 I got a 'Bonjour' error.  I eventually solved that but I still couldn't upgrade to 10.5, so I deleted every single Apple, Quicktime, iTunes, etc file on my PC using Revo Unistaller (because the normal Windows Add/Delete programs wouldn't work) but now, when I install the latest iTunes version from scratch (on XP SP3), it says: "the installer encountered errors before it could be configured.... your system has not been modified" 
    Any ideas?
    Rick

  • When i try to order prints i get an error message saying there is a problem with my network and my network is working

    when i try to order prints i get an error message saying there is a problem with my network and my network is working. How can i solve this problem?

    Try a different media. I have good luck using Maxell discs.

  • I had a problem with my iphone and had to restore and now i have lost all music from itunes any way to get it back ?

    i had a problem with my iphone and had to restore and now i have lost all music from itunes any way to get it back ?

    It should ne in itunes on your computer and included in your regular backup of your computer.
    If for some reason you have failed to backup your music, then - in the U.S only - you can get previous itunes purchases from the beta version of icloud.  Open itunes store, click Purchased, under Quick Links.

  • HT4848 Hi my name is Hajk and i got a friend that has a problem with her macbook, she gets a blue screen and cant log on. So i told her if she had an reinstall disk so that i could reinstall for her but she didn't get one with the macbook. what can she do

    Hi my name is Hajk and i got a friend that has a problem with her macbook, she gets a blue screen and cant log on. So i told her if she had an reinstall disk so that i could reinstall for her but she didn't get one with the macbook. what can she do ?

    If this is a fairly new Mac running either v10.7 Lion or v10.8 Mountain Lion she can use Lion or Mountain Recovery to repair the startup disk or reinstall OS X.

  • Problems with Customer Service AND unexplained charges!

    I've been with Verizon for I-don't-know-how-many years, and through the years you are bound to have a few problems here and there but some of the problems are just ridiculous! It's also the same reocurring problem!!!!!!!!!!!!!!!! I was with Alltel first, before it was bought out by Verizon. The years I was with Alltel, I didn't have near as many problems. It seems EVERY time I do the smallest change or something to my phone or bill, I get a ridiculous amount of charges that I was NOT aware of, nor told about... EVEN IF I ask "So this isn't going to change my bill, or there will not be any unexpected/unexplained charges that I don't know about?"... BUT not matter how many times I ask... and NO matter how many times I am told "no"... there always is. For example.... last year, I updated and signed a new 2 year contract and purchased the first Driod. Before, my 30 day warranty was up, I was having problems with my Driod, and decided to send it in and get a new one. Before I did this.. I called customer service to make sure there would be no interuption in my bill, and there wouldn't be any unexpect charges, and there would be no difference in anything. I was told there was not, and once I recieved my new phone, just send it in and nothing would be changed. Of course, when I get my bill.. I see I was charged $500 for the new phone. It was explained to me that my credit card was reimbursed (which I never check that card, because I never used it expect to purchase the phone) and that I was recharged for the new phone, since it was a new phone. So I had to fork out the $500 (on top of my bill) and then wait months to get the $100 rebate card. Months after that, I "assumed liablity of my line" because I was on a plan with my family. I decided to have my own line, so I "assumed liability." I was not told that when I did that, I "renewed" my contract date. So I just added 6 more months to my 2 year contract. Was NOT told about that! Then again...... I was recently having problems with my Driod (the screen went black and would not come back on.) I had to turn on an OLD motorola razor, so I would not be without a phone for two days while I was waiting on my phone to come in. As soon as my phone came in, I had my Droid turned back on. I recieved my bill recently, and my bill was $200 over what it normally should be.... so I called in... apparently, when I had my phone replaced, they dropped off my data package and when I recieved my replacement driod, they never put it back on. So I was being charged for alllll my data usage... again I was NOT told about this. I wasn't even aware that they had dropped off my data package, and when/where did they get the authority to do that??? These are just a FEW of the problems that I have had.................................
    Does anyone have these reoccuring problems!?

    I understand that my bill can be viewed online, and I do view it fairly regularly, so if there are any unexplained charges, I can call Verizon asap. The problem does not come from me not understanding my bill, but from customer service. I have been with Verizon for a very long time, and it is a continuing problem. Where did Verizon get the 'OK' to drop my data package off my plan? Who authorized that?
    After calling Verizon and trying to find out the problem, the gentleman told me that when I activated on old phone while I was waiting on my new Droid to arrive, my data package was dropped off and I "should" have been told about that. When I reactiviated my new Droid, I "should" have called and had them restart my data package. I was not aware that when you activate an old phone that data plan is taken off your plan. In all my years of having cell phones, I never make two years with one phone. I have always, at one point, had to turn on an old phone, and my data package has NEVER changed. Why would I have my data package dropped and why would I have to call Verizon to have it restarted. I would never know to do that unless I was TOLD that my data packaged HAD to be re-added when I recieved my new phone, but I was never told of that.
    All of that is beside the point, the point is, Verizon was never given the authorization to change my plan. Never. My bill was taken care of and readjusted, and I am thankful for that. It does not change the fact it is always a hassle with Verizon Customer Service and I am always the one having to PROVE that I am not at fault, or that I was NEVER told of certian things. EVERY TIME I HAVE CALLED CUSTOMER SERVICE, I AM TOLD "I'M SORRY, THEY SHOULD HAVE TOLD YOU THAT."
    "they should" does not help my bill with the extra armount of charges.

  • Problems with HP printer and PSE 11 (was bill v)

    When using my HP 7020e photosmart printer and Adobe photoshop elements 11, I get a very small white border on the prints. I have set for borderless printing. Adobe says the print size is 4.2 x 6.18 instead of 4 x 6. Any suggestions?

    I had already set it to borderless but it still prints a very small white 
    border. HP had no solution. I am ready to send the printer back to them.
    In a message dated 1/14/2014 5:47:22 A.M. Eastern Standard Time, 
    [email protected] writes:
    Re:  Problems with HP printer and PSE 11 (was bill v)
    created by hyadav (http://forums.adobe.com/people/hyadav)  in Photoshop 
    Elements - View the full  discussion
    (http://forums.adobe.com/message/6010537#6010537)

  • Error: There is a problem with the file and it cannot be copied

    I've been trying to copy (and essentially move) the contents of an NTFS-formatted external HDD to my iMac's internal HDD so I can then format the external HDD to Mac OS Extended. However, when I simply try to drag and drop, I get an error during the transfer that states:
    There is a problem with the file and it cannot be copied.
    I tried a basic cp command in Terminal to copy all contents of the external HDD to a folder on my iMac's desktop, and found that while there were no errors, there were many individual files missing full chunks of data (ie. original file would be 4GB on my external HDD, but only 350MB on my desktop).
    Any ideas on how I can successfully copy a large amount of data (approx. 170GB) from my external HDD to my internal HDD while avoiding this error, so I can ultimately format my external HDD to Mac OS Extended? ANY help is greatly appreciated.

    That's not a good error to see. It indicates something is very wrong. Pulled out of an old programming header file:
    ioErr = -36, /*I/O error (bummers)*/
    If Apple labelled it "bummers," they had a good reason! Unfortunately, that doesn't bode well for you.
    Try running Disk Utility again. Keep repairing over and over until one of two things happens: 1) Disk Utility says no repair was needed, or 2) Disk Utility reports the same error in two sequential repair sessions and is unable to repair it both times.
    If you hit the second case, or if you hit the first but still can't copy files, then you've got two basic options:
    = Buy a third-party disk utility or two and try them. Try TechTool as a first choice.
    = Recover what files you can and write the rest off as gone.
    = Send your drive to a data recovery service and hope they can extract more than you can.
    Of course, none of this is necessary if you have a backup of the contents of that hard drive. (If you don't, this is your learning experience. Once bitten, twice shy, so they say.) Also, regardless of the outcome, once you've got your data or have decided it's gone, you're going to want to wipe that drive completely clean. Reformat the drive with Disk Utility, then when it's done, select the drive in Disk Utility and hit command-i. (Don't select the new volume you just created on that drive, select the drive itself. Mine looks like "232.9 GB Hitachi ..." with the volume name indented underneath.) Look for an item that says S.M.A.R.T. Status, and if it doesn't say Verified, you might as well throw out the drive. Don't trust any more data to it.
    If all appears safe, you can start moving data back onto it. But, as always, make sure you have a backup of everything!

  • I have a problem with my motherboard and my battery of my 2010 macbook pro 13". It was just serviced with a new screen, keyboard, and logic board.

    I have a problem with my motherboard and my battery of my 2010 macbook pro 13". It was just serviced with a new screen, keyboard, and logic board. How much will a new battery and motherboard cost and would it be worth it or should I just get a new computer. It was about 300 dollars to get it serviced last week. if it adds up to much past 600 dollars I will just get a new one. THANKS FOR ANY HELP!
    P.S During classes today it began beeping in my bag. Like three kind of long steady beeps then a short pause, and when I opened it I couldn't see anything but it was on so I turned it off and back on.

    Depends on what options your Apple store offers - if they can do a depot repair (where they send it out), that's around $300 for all parts & labor.
    If the store doesn't have that option, a logicboard is around $600, battery $80-$100, from what I've seen.
    If they JUST replaced the logicboard, you absolutely should NOT have to pay for another replacement - the replacement is covered by a warranty. If they want you to pay for it, make sure you have a copy of the receipt for the work that was recently completed so you can show it to them. They have no reason to charge you for another logicboard.
    ~Lyssa

  • Problems with games server and client

    Hi! I am making an MMORPG game and I have problems with the server and client connection.
    I can connect to the server, but when a second player does, the server console tells me this:
    java.net.SocketException: Connection reset
    After that, all clients disconnect.
    Which is the problem?
    How can I solve it?
    Thank you so much

    Here is how my sever work. I took some of this code from a book called Killer Programming Games in Java. If you google for it, you will find it for sure.
    TourGroup tg = new TourGroup(); // this object stores information about all clients connected to the server
        try {
          ServerSocket serverSock = new ServerSocket(PORT);
          Socket clientSock;
          while (true) {
            System.out.println("Waiting for a client...");
            clientSock = serverSock.accept();
            new TourServerHandler(clientSock, tg).start(); // this is the thread that monitors each client
        catch(Exception e)
        {  System.out.println(e);  }
      } This is some code of TourServerHandler
    public TourServerHandler(Socket s, TourGroup tg)
        this.tg = tg;
        clientSock = s;
        name= "?";
        cliAddr = clientSock.getInetAddress().getHostAddress();
        port = clientSock.getPort();
        System.out.println("Client connection from (" +
                     cliAddr + ", " + port + ")");
    public void run()
      // process messages from the client
        try {
          // Get I/O streams from the socket
          BufferedReader in  = new BufferedReader(
       new InputStreamReader( clientSock.getInputStream() ) );
          PrintWriter out =
    new PrintWriter( clientSock.getOutputStream(), true );  
    // and here goes the rest... The TourServerHandler thread uses this code to send messages:
    tg.broadcast(msg); tg.broadcast works like this:
    synchronized public void broadcast(String cliAddr, int port, String msg)
      // broadcast to everyone but original msg sender
        TouristInfo c; // this object stores info about the client
        for(int i=0; i < tourPeople.size(); i++) {
          c = (TouristInfo) tourPeople.get(i);
            c.sendMessage(msg);
      } This is the error part
    public void sendMessage(String msg)
      PrintWriter out;  
        out.println(msg);  
          System.out.println("OK");
      } I can't find any error but I still get that Connection reset exception...

  • Problems with 990FXA-GD80 and AMD FX8350

    Hello,
    I built this PC back in March, and ever since I have been having problems with it. I get BSOD every now and then. It usually only happens when I am playing a game or trying to render a video. The last time I tried running Prime95, my computer locked up and didn't report the error or go to bluescreen. I thought I might post my issues here, because I can't figure out the cause. I believe it's a piece of the hardware that is causing it.
    I ran memtest86 with all passes, and I checked my HHD for errors and nothing came back.
    I'm not sure if my BIOS version it out of date, but it says I am on V11.13. When I scan on Live Updater 5, there are no updates so I'm not sure if I need to just flash it or what.
    My BIOS settings are all default, except I changed the CPU and DRAM voltages to higher values. 1.35V for the CPU and 1.65V for the DRAM. I seen it recommended in another thread so I figured I would give it a try. All my temps look fine by the way. I'm not sure if it has solved the issues though, I haven't tried playing much games or rendering a video.
    If anyone might have an idea what is going on I would really appreciate any help. I don't know much about building PCs, so take it easy :P
    My full specs are:
    OS: Windows 7 Ultimate 64-Bit
    CPU: AMD FX-8350
    Motherboard: 990FXA-GD80 V2
    GPU: Sapphire Radeon HD 7850
    Memory: G.SKILL Ripjaws X Series 16GB (2 x 8GB) 240-Pin DDR3 SDRAM DDR3 2133
    PSU: CORSAIR HX Series HX750 750W
    HDD: Seagate SV35 Series ST1000VX000 1TB
    I can post more info if needed, thanks!

    No replies?   
    First off that ram is 1.6V not 1.65V.  Your ram is ddr3 2133mhz which is an overclock ram speed.  Hopefully that works ok in "auto".
    Next, your cpu is being starved for volts.  Set it to at least 1.4V.  Do not be afraid to go higher if it still crashes. 
    The bios is the latest for Win7.  I am using it and it works fine.
    Do you have any monitoring software like HWiNFO64?  It shows my 8350 idling at 1435 mhz and using 1.32V-1.46V right now.  Under load it will be higher.  Yours will be too.

  • Problems with ListViews Drag and Drop

    I'm surprised that there isn't an Active X control that can do this more
    easily? Would
    be curious to find out if there is - although we aren't really embracing the
    use of
    them within Forte because it locks you into the Microsoft arena.
    ---------------------- Forwarded by Peggy Lynn Adrian/AM/LLY on 02/03/98 01:33
    PM ---------------------------
    "Stokesbary, Michael" <[email protected]> on 02/03/98 12:19:52 PM
    Please respond to "Stokesbary, Michael" <[email protected]>
    To: "'[email protected]'" <[email protected]>
    cc:
    Subject: Problems with ListViews Drag and Drop
    I am just curious as to other people's experiences with the ListView
    widget when elements in it are set to be draggable. In particular, I am
    currently trying to design an interface that looks a lot like Windows
    Explorer where a TreeView resides on the left side of the window and a
    ListView resides on the right side. Upon double clicking on the
    ListView, if the current node that was clicked on was a folder, then the
    TreeView expands this folder and the contents are then displayed in the
    ListView, otherwise, it was a file and it is brought up in Microsoft
    Word. All this works great if I don't have the elements in the ListView
    widget set to be draggable. If they are set to be draggable, then I am
    finding that the DoubleClick event seems to get registered twice along
    with the ObjectDrop event. This is not good because if I double click
    and the current node is a folder, then it will expand this folder in the
    TreeView, display the contents in the ListView, grab the node that is
    now displayed where that node used to be displayed and run the events
    for that as well. What this means, is that if this is a file, then Word
    is just launched and no big deal. Unfortunately, if this happens to be
    another directory, then the previous directory is dropped into this
    current directory and a recursive copy gets performed, giving me one
    heck of a deep directory tree for that folder.
    Has anybody else seen this, or am I the only lucky one to experience.
    If need be, I do have this exported in a .pex file if anybody needs to
    look at it more closely.
    Thanks in advance.
    Michael Stokesbary
    Software Engineer
    GTE Government Systems Corporation
    tel: (650) 966-2975
    e-mail: [email protected]

    here is the required code....
    private static class TreeDragGestureListener implements DragGestureListener {
         public void dragGestureRecognized(DragGestureEvent dragGestureEvent) {
         // Can only drag leafs
         JTree tree = (JTree) dragGestureEvent.getComponent();
         TreePath path = tree.getSelectionPath();
         if (path == null) {
              // Nothing selected, nothing to drag
              System.out.println("Nothing selected - beep");
              tree.getToolkit().beep();
         } else {
              DefaultMutableTreeNode selection = (DefaultMutableTreeNode) path
                   .getLastPathComponent();
              if (selection.isLeaf()) {
              TransferableTreeNode node = new TransferableTreeNode(
                   selection);
              dragGestureEvent.startDrag(DragSource.DefaultCopyDrop,
                   node, new MyDragSourceListener());
              } else {
              System.out.println("Not a leaf - beep");
              tree.getToolkit().beep();
    }

Maybe you are looking for

  • Horizontal Scroll in TableView cell

    Hi, I'm creating an app where I will be displaying data in a tableview. I need to be able to show a variable amount of data which is stored in a mutable array (I was thinking in the forms of labels) and have it all in one cell. The table itself also

  • Distributing JSP on two webServers

    Hi i am having a small issue regarding the distribution of JSP on two different webservers , i have written a wrapper handler jsp page which lyes on one server and on where all the request are transferred towards other webserver where all the jsps ar

  • How do I find the Report ID?

    I need the report ID or Workbook ID to manually enter it through the profile generator. How and where do I find it? Please reply ASAP. Thanks in advance. Points will be awarded.

  • DoD Category I issues with JRE on Linux OS

    My company has a medical equipment solution installed within the US DoD running Java SE 6 on Linux.  In order to address a Cat 1 security issue, 6u81 is required.  My company has an advanced support contract, so we have access to this Java update.  H

  • Premiere closes after trying to start - Need suggestions

    My Premiere CS5 has been running fine since I installed.  But today no matter what I do, when I try to open the application it appears to try to launch (never does) then process abruptly ends when viewing in Windows Task Manager.  I deleted some auto