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);
}
何かご意見は?