我的 Primefaces p:tree 数据结构有一个奇怪的问题。当部署到服务器(GAE)时,事件监听器(onSelect(),onUnselect()等......)不会被调用,尽管它们在我的本地开发机器上部署时工作正常......非常感谢任何想法。 ..
xhtml:
<p:layoutUnit widgetvar="west_content_widget" id="west_content_panel"
position="west" size="300" resizable="true" closable="false"
collapsible="true" collapseSize="30" styleClass="client_dashboard, urlLinks_dashboard" header="Target URLs">
<h:form id="leftContentForm">
<p:growl id="messages" showDetail="true" />
<div id="url_tree" class="client_dashboard, urlLinks_dashboard">
<p:growl id="growl1" showSummary="true" showDetail="true"
autoUpdate="true" />
<p:tree id="tree1"
value="#{fullScreenDashboardBean.urlTreeBean.model}" var="node"
selectionMode="checkbox"
selection="#{fullScreenDashboardBean.selectedNodes}"
rendered="#{fullScreenDashboardBean.showTree}" dyanmic="true"
style="width:100%"
cache="false" >
<p:ajax event="expand" update=":leftContentForm:messages, :centreContentForm" listener="#{fullScreenDashboardBean.onNodeExpand}" />
<p:ajax event="collapse" update=":leftContentForm:messages, :centreContentForm" listener="#{fullScreenDashboardBean.onNodeCollapse}" />
<p:ajax event="select" update=":leftContentForm:messages, :centreContentForm" listener="#{fullScreenDashboardBean.onNodeSelect}" />
<p:ajax event="unselect" update=":leftContentForm:messages, :centreContentForm" listener="#{fullScreenDashboardBean.onNodeUnselect}" />
<p:treeNode type="node">
<h:outputText value="#{node}" />
</p:treeNode>
<p:treeNode type="leaf">
<h:outputText value="#{node}" />
</p:treeNode>
</p:tree>
</div>
<p:blockUI block="tree1" trigger="tree1"><br />
<p:graphicImage value="/images/ajax-loader.gif" />
</p:blockUI>
</h:form>
</p:layoutUnit>
////////////// FullScreenDashboardBean.java: // backingBean...
@ManagedBean
@SessionScoped
public class FullScreenDashboardBean implements Serializable {
// ////////////
//
private static final long serialVersionUID = 1L;
....
public void onNodeExpand(NodeExpandEvent event) {
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Expanded", event.getTreeNode().toString());
FacesContext.getCurrentInstance().addMessage(null, message);
}
public void onNodeCollapse(NodeCollapseEvent event) {
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Collapsed", event.getTreeNode().toString());
FacesContext.getCurrentInstance().addMessage(null, message);
}
public void onNodeSelect(NodeSelectEvent event) {
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Selected", event.getTreeNode().toString());
FacesContext.getCurrentInstance().addMessage(null, message);
URLDBService urlDB = new URLDBService();
String urlAddress = event.getTreeNode().toString();
// Get backlink datatable data from DB.
Integer urlID = urlDB.getURLIDFromAddress(urlAddress);
backLinkTableBean.addBackLinksToTable(urlID);
}
public void onNodeUnselect(NodeUnselectEvent event) {
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Unselected", event.getTreeNode().toString());
FacesContext.getCurrentInstance().addMessage(null, message);
String urlAddress;
Integer urlID;
URLDBService urlDB = new URLDBService();
urlAddress = event.getTreeNode().getData().toString();
urlID = urlDB.getURLIDFromAddress(urlAddress);
backLinkTableBean.removeBackLinksFromTable(urlID);
}
有什么想法吗?