Primefaces <p:tree>事件侦听器未在服务器上调用 - 但在本地工作</p:tree>

时间:2013-05-14 04:02:35

标签: ajax google-app-engine jsf primefaces tree

我的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);
}  

有什么想法吗?

0 个答案:

没有答案