JSF 1.2 - 无法找到组件(...)我们将尝试返回猜测的客户端ID

时间:2012-11-09 14:55:08

标签: java jsf richfaces jsf-1.2 tomahawk

首先,我在JSF 1.2 / Richfaces 3.3 / Tomahawk 1.1.9下工作。

我在一个JSF页面中有这段代码(简化):

<h:form id="mainForm">
(...)
<h:panelGroup id="grupSelMalaltia">
    <rich:panel header="Panel Name">
        <t:subform id="selMalaltiesForm">

            <rich:dataTable align="center" id="dataSelMalalties" value="#{TaulaMalalties.listMalalties}" var="cMal">

                (some <rich:column>)

                <rich:column>
                    <t:commandLink actionFor="selMalaltiesForm" action="select_malaltia">
                        <f:param name="has_selection" value="true">
                        <h:graphicImage url="/Icons/select.png" />
                    </t:commandLink>
                </rich:column>
            </rich:dataTable>

        </t:subform>
    </rich:panel>
</h:panelGroup>
<h:form>

我收到了这个错误:

INFO: Unable to find component 'selMalaltiaForm' (calling findComponent on component 'mainForm:selMalaltiesForm:dataSelMalalties:0:j_id_jsp_2136723630_43'). We'll try to return a guessed client-id anyways - this will be a problem if you put the referenced component onto a different naming-contaier. If this is the case you can always use the full client-id.

当按下按钮时,我只想提交这个子表单(我有其他JSF页面,其代码类似,运行没有问题)。此时,由于这个问题,我没有得到这个结果。

如何解决此故障?提前谢谢。

1 个答案:

答案 0 :(得分:0)

最好使用<a4j:commandLink>并将process代码属性设置为您想要/需要处理的组件的ID。

基于您提出的JSF代码,它可以像这样完成

<rich:panel header="Panel Name">
    <rich:dataTable align="center" id="dataUnselMalalties"
        value="#{TaulaMalalties.listMalalties}" var="cMal">
        <!-- richfaces columns with info -->
        <rich:column>
            <!-- processing the datatable only -->
            <a4j:commandLink action="#{TaulaMalalties.select_malaltia}"
                process="dataUnselMalalties" limitToList="true">
                <f:param name="has_selection" value="true">
                <h:graphicImage url="/Icons/select.png" />
            </a4j:commandLink>
        </rich:column>
    </rich:dataTable>
</rich:panel>

有关此内容的更多信息:

相关问题