Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java RichFaces rich:树节点选择侦听器未被侦听_Java_Jsf_Richfaces - Fatal编程技术网

Java RichFaces rich:树节点选择侦听器未被侦听

Java RichFaces rich:树节点选择侦听器未被侦听,java,jsf,richfaces,Java,Jsf,Richfaces,我有一个rich:tree组件,如下所示: <rich:tree switchType="client" value="#{MyBacking.logTree}" reRender="selectedLog" var="item" nodeFace="#{item.type}" nodeSelectListener="#{MyBacking.processLogSelec

我有一个
rich:tree
组件,如下所示:

                    <rich:tree switchType="client" value="#{MyBacking.logTree}"
                    reRender="selectedLog" var="item" nodeFace="#{item.type}"
                    nodeSelectListener="#{MyBacking.processLogSelection}"
                    style="width: 50px;">
                    <rich:treeNode type="folder"
                        icon="/img/logListFolderIconClosed.png"
                        iconLeaf="/img/logListFolderIconOpen.png">
                        <h:outputText value="#{item.name}" />
                    </rich:treeNode>
                    <rich:treeNode type="log" iconLeaf="/img/logFileIcon.png"
                        icon="/img/logFileIcon.png">
                        <h:outputText value="#{item.name}" />
                    </rich:treeNode>
                </rich:tree>
进一步编辑 有趣的是,我想我应该回到一个基本的工作模式。我从计算机上获取了代码。我修改了faces-config.xml以包含
simpleReedata
bean。我在获取读取(
simple tree data.properties
)中数据文件的bean代码时遇到问题,因此我使用了
FileReader
。这构建得很好,我得到了一个修改过的index.jsp jsf页面来列出演示页面上的简单树示例,除了单击列表项没有将所选的
nodeTitle
报告到指定的位置(相同的问题)

我可以认为这与上面报告的问题相同,或者是
SimpleTreeData.java
bean中的
loadTree
方法已被更改。在更改中,我删除了以下行,并根据需要更改了无关代码:

        FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext externalContext = facesContext.getExternalContext();
    InputStream dataStream = externalContext.getResourceAsStream(DATA_PATH);
如前所述,我使用了
文件阅读器
,但有人认为这个问题可能与我删除这3行有关吗?如上所述,我的
processLogSelection
方法不使用
getCurrentInstance
,但我不确定它是否需要在JSF中列出
ajaxSubmitSelection=“true”


难住了。

我试过了,然后调用了这个方法。我以为您使用Seam,但可能我错了:)刚才有一些抱怨:。您使用的Richfaces版本和浏览器是什么?如果您也使用Seam,请告诉它的版本。

我尝试了这个,然后调用了这个方法。我以为您使用Seam,但可能我错了:)刚才有一些抱怨:。您使用的Richfaces版本和浏览器是什么?如果您也使用Seam,请告诉它的版本。

修复方法是安装facelets jar。看见毫不奇怪,它影响了我的其他问题。

解决方法是安装facelets jar。看见毫不奇怪,它影响了我的其他问题。

您是否尝试将ajaxSubmitSelection=“true”作为rich:tree的属性?啊,确保富人:树被一张表格包围。谢谢。我两次都试了,但都没有成功。我会做更多的实验,然后再报告。
ajaxSubmitSelection=“true”
应该有效(在这里有效)-检查您的日志,了解为什么无效。
rich:tree
是否是
a4j:include
d页面的一部分很重要?我尝试将上述代码嵌套在选项卡面板中,但仍然有效。只是开玩笑,但您确定您的日志记录可以工作吗:)您是否尝试将ajaxSubmitSelection=“true”作为rich:tree的属性?啊,确保富人:树被一张表格包围。谢谢。我两次都试了,但都没有成功。我会做更多的实验,然后再报告。
ajaxSubmitSelection=“true”
应该有效(在这里有效)-检查您的日志,了解为什么无效。
rich:tree
是否是
a4j:include
d页面的一部分很重要?我尝试将上述代码嵌套在选项卡面板中,但仍然有效。只是开玩笑,但你确定你的日志工作:)我不使用seam。我使用的是RF3.3.2SR1。我以前读过Seam投诉,但因为我没有使用Seam,所以使用有限。我使用FirefoxV3.5.8来测试,我不使用seam。我使用的是RF3.3.2SR1。我以前读过Seam投诉,但因为我没有使用Seam,所以使用有限。我正在使用FirefoxV3.5.8进行测试。
            <h:panelGrid columns="2" border="0" width="100%" rowClasses="tt">
            <rich:panel styleClass="panelLogTree" header="Log Select">
                <h:form>
                    <rich:tree switchType="client" value="#{MyBacking.logTree}"
                        var="item" nodeFace="#{item.type}" reRender="selectedLog"
                        nodeSelectListener="#{MyBacking.processLogSelection}"
                        ajaxSubmitSelection="true" style="width: 50px;">
                        <rich:treeNode type="folder"
                            icon="/img/logListFolderIconClosed.png"
                            iconLeaf="/img/logListFolderIconOpen.png">
                            <h:outputText value="#{item.name}" />
                        </rich:treeNode>
                        <rich:treeNode type="log" iconLeaf="/img/logFileIcon.png"
                            icon="/img/logFileIcon.png">
                            <h:outputText value="#{item.name}" />
                        </rich:treeNode>
                    </rich:tree>
                </h:form>
            </rich:panel>

            <rich:panel styleClass="panelLogOutput" header="Log Content">
                <h:outputText escape="false"
                    value="Log content: #{MyBacking.nodeTitle}" id="selectedLog" />
            </rich:panel>
        </h:panelGrid>
    </rich:tab>
    public void processLogSelection(NodeSelectedEvent event) {
    logger.info("In processLogSelection");
}
        FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext externalContext = facesContext.getExternalContext();
    InputStream dataStream = externalContext.getResourceAsStream(DATA_PATH);