I am trying to use OrderList
from PrimeFaces v 3.5 libarary.
<p:orderList
id="outputMapId"
value="#{JobMgmtBean.selectedStreamNames}"
var="stream"
valueChangeListener="#{JobMgmtBean.listenerListChanged}"
controlsLocation="none"
itemLabel="#{stream}"
itemValue="#{stream}">
</p:orderList>
and
public void listenerListChanged( )
{
..
}
I can't seem to be getting a value change event after I drag&drop the items, listenerListChanged
is never executed. What am I doing wrong?
Edit: Trying this script:
<h:head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1"/>
<title>#{txt.TXT_TITLE_TRANSCODING}</title>
<link rel="stylesheet" type="text/css" href="scripts/styles.css"/>
<link rel="shortcut icon" href="./images/favicon.ico"></link>
<script src="./scripts/scripts.js" type="text/javascript"/>
<script>
$(document).ready(function() {
console.log("Entered script!");
var isDragging = false;
$(".ui-orderlist-item")
.mousedown(function () {
$(window).mousemove(function () {
isDragging = true;
console.log("Mouse down!");
});
})
.mouseup(function () {
var wasDragging = isDragging;
isDragging = false;
console.log("Mouse up!");
triggerBackEnd();
});
});
</script>
</h:head>
<h:body>
<f:view>
<h:form>
<p:remoteCommand name="triggerBackEnd" actionListener="#{JobMgmtBean.listenerListChanged}"></p:remoteCommand>
...
But this still does not work.
I never get console.log("Mouse down!");
.
I am using jQuery v1.8.3 which comes with PrimeFaces 3.5.0.