Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to drag and drop a string element?

 
Stevenson Anderson
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Stevenson Anderson
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear!
But suggest me what I use instead of frames?
Anyway I should reconstruct everything...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just partition the page using <div> elements. With the appropriate CSS they can even scroll independently.
 
Stevenson Anderson
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic