This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes How to drag and drop a string element? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to drag and drop a string element? " Watch "How to drag and drop a string element? " New topic
Author

How to drag and drop a string element?

Stevenson Anderson
Greenhorn

Joined: Jul 09, 2011
Posts: 13
I got a requirement .My page contains 2 different frames.My left side frame displays all the tables available in the database schema selected by the user.After it displays the table names,User drags one of the table into right side frame then the right side frame must show the metadata of the dragged table.So how can i make the individual string elements(table names) draggable and droppable in a particular area?
Thanks,
Steve.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60737
    
  65

I'd say that step 1 is to back up and rethink the use of frames. They're going to make your life hell going forward.

Why was that decision made in the first place? Frames are rather passé, in most part because they are a nightmare to deal with.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Stevenson Anderson
Greenhorn

Joined: Jul 09, 2011
Posts: 13
Thanks Bear!
But suggest me what I use instead of frames?
Anyway I should reconstruct everything...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60737
    
  65

Just partition the page using <div> elements. With the appropriate CSS they can even scroll independently.
Stevenson Anderson
Greenhorn

Joined: Jul 09, 2011
Posts: 13
Sorry! for previous lengthy code. And thanks for your suggestions.
Now I post the code where i thought the error is :
These are the script functions I have used.


And I got the tables available in the database and str is my variable where i store each table value in a while loop. The remaining code is like this.



So the problem is,I can able to drag only one(either first or last) table.But the variable str(line 4 in the above code) is printing different table name at each iteration.
So help me out.

Thanks,
Steve.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60737
    
  65

Stevenson Anderson wrote:So the problem is,I can able to drag only one(either first or last) table.But the variable str(line 4 in the above code) is printing different table name at each iteration.

I'm not sure what you are trying to say her. And str (not the best variable name) is a JSP scripting variable that's evaluated and emitted to the logs on the server, can can have nothing to do with any JavaScript activities.

You'll need to explain what this is all about with a bit more clarity.
 
wood burning stoves
 
subject: How to drag and drop a string element?
 
Similar Threads
Weblogic7.0 admin console
scrollbar problem resizing jtable in gridbag
Forms in Frame
how to set the amount column in jtree table
Passing arrays with a form