I have a little script for drag&drop a table and it's working fine. But I've a problem: I have to pass the start/endPosition to my BackingBean. Is there a way to call a BackingBean function from jquery (with parameters)? Or do you know some nice workaround?
Code for drag&drop:
<script type="text/javascript" language="javascript">
$(document).ready(function() {
var startPosition;
var endPosition;
$('#table tbody').sortable({
cursor: "move",
start:function(event, ui){
startPosition = ui.item.prevAll().length;
},
update: function(event, ui) {
endPosition = ui.item.prevAll().length;
// Call BackingBean function
}
});
});
</script>