Double Click in OpenFaces Tree/DataTable
How can I navigate from a JSF page t开发者_如何转开发o another after I did double click on a table row. I'm looking for an attribute such as action
in o:commandButton
.
Thank you for any advice! Thomas
Just off the top of my head I would use the ondblclick parameter and fire a javascript function to redirect to a page. Other wise you can use action="page?faces-redirect=true" but that will only work for a single click.
My javascript is a little basic but I believe you can use
window.location="http://www.yourdomain.com/"
to redirect.
so
<script>
function redirect() {
window.location="http://www.yourdomain.com/"
}
</script>
<o:commandButton ondblclick="redirect()" />
xhtml file
<o:treeTable id="treeTable" var="element"
ondblclick="openTargetListFromTable(event);" ....
JavaScript
function openTargetList(event) {
O$.ajax.request(
this,
event, {
execute: 'form1:treeTable',
render: 'form1:treeTable',
listener: 'treeTableBean.openElement'
}
);
};
精彩评论