从内另一种形式Primefaces更新 [英] Primefaces update from inside another form

查看:102
本文介绍了从内另一种形式Primefaces更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道这有什么错我的HTML code。从我读,它应该工作。我甚至试过用 prependId =假这并没有解决没有找到问题的UI组件。

I'm not sure what's wrong with my HTML code. From what I read, it should work. I even tried using prependId="false" which didn't resolve the problem of not finding the UI Component.

<p:tabView>
        <p:tab title="Tab1" id="tab1">
            <h:form id="form1" prependId="false">
                <p:panelGrid columns="2" id="grid1">

                    <h:outputLabel for="minDraw" value="Starting draw number:" />
                    <p:inputText id="minDraw" value="#{LottoMaxBacking.minDraw}" />
                    <p:commandButton value="Get Frequency From Begining"
                        actionListener="#{LottoMaxBacking.loadAllDrawFreq}"
                        update=":form2:freqTable" />
                </p:panelGrid>
            </h:form>
            <h:form id="form2" prependId="false">
                <p:dataTable var="entry" value="#{LottoMaxBacking.drawFreqList}"
                    id="freqTable">
                    <f:facet name="header">
                        <h:outputText value="#{LottoMaxBacking.tableHeader}" />
                    </f:facet>
                    <p:column sortBy="#{entry.key}" headerText="Ball Number">

                        <h:outputText value="#{entry.key}" />

                    </p:column>
                    <p:column sortBy="#{entry.value}" headerText="Frequency">

                        <h:outputText value="#{entry.value}" />

                    </p:column>

                </p:dataTable>
            </h:form>
        </p:tab>
        <p:tab title="Tab 2"></p:tab>
    </p:tabView>

我试过:TAB1:窗口2:freqTable:freqTablefreqTable,但他们都不工作。当我把两种形式一起作为一个单一的形式,它会找到freqTable罚款。

I tried ":tab1:form2:freqTable", ":freqTable", and "freqTable" but none of them work. When I put both forms together as a single form, it would find the freqTable fine.

推荐答案

OK,我终于想通了再看错误消息后。

OK I finally figured it out after looking at the error message again.

无法找到标识成分:窗口2:freqTable从引用的j_idt54:j_idt56

idt54指TabView的和idt56指命令按钮。所以,事实证明,我的按钮的AJAX更新字符串做得还不够原创,并提到了错误的父容器我所有的其他企图。我加了一个ID号码:TabView的改变和更新的字符串,它的工作

idt54 refers to the TabView and idt56 refers to the command button. So it turns out that my button's AJAX update string didn't go far enough original and all my other attempts referred to the wrong parent container. I added an id to p:tabView and changed the update String and it worked.

<p:commandButton value="Get Frequency From Begining" 
    actionListener="#{LottoMaxBacking.loadAllDrawFreq}"
    update="tv:form2:freqTable" />

这篇关于从内另一种形式Primefaces更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆