• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to use drag and drop event with Visual JSF component?

 
Troy Castle
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

Please help me. I want to get event drag and drop of a component. For example: When I drag and drop a row of table to another table, distination table will update with source table data?
<----Table 1----->
No Name
1 Troy
2 Castle

<----Table 2----->
No Name
1 Eric

When I use mouse click and drag and drop the first row of table 1 (1 Troy), table 2 will update into:
<----Table 2----->
No Name
1 Eric
2 Troy

Best regards,
Troy
 
Tim Holloway
Bartender
Posts: 18417
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Troy!

This kind of stuff isn't automatic.

Because drag-and-drop requires client-side logic in partnership with server-side logic, you'll need more than just basic JSF coding. You'll need client-side logic to handle the dragging and drop detection and you'll need AJAX to post the results of the drop operation back to the data model in the server.

You could do this from scratch using JSF2, but some extension tagsets already do most of this for you. I don't know of any other ones offhand, but I know that the RichFaces extension tagset has extensive drag-and-drop support, although I've never used it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!