从ajax调用中重新加载数据表

时间:2019-12-22 10:06:37

标签: jsf

我想使用数据表来实现此example

    <h:form id="paymentform">
        <h:outputLabel for="contact-last-nafffme"
            class="form-label form-label-outside">Amount</h:outputLabel>
        <h:inputText type="number" name="usernahhme"
            value="#{dashboard.amount}">
        </h:inputText>
        <h:selectOneMenu id="contact-last-nam4e" class="form-control"
            name="lastNameff" valueChangeListener="#{dashboard.calculateProcent}">
            <f:selectItem itemValue="highest_buy" itemLabel="Highest Buy" />
        </h:selectOneMenu>

        <h:commandButton id="buy" value="Put"
            action="#{dashboard.calculateProcessing}">
            <f:ajax render="@form :firstPanel :inform :intable"
                execute="@form :firstPanel :inform :intable" />
        </h:commandButton>
    </h:form>


    <h:panelGroup id="firstPanel">
        <h:form id="inform">

            <h:dataTable id="intable" value="#{orders.cdList}" var="cd">
                <h:column>
                    <f:facet name="header">Id</f:facet>
                    <h:outputText value="#{cd.id}" />
                </h:column>

            </h:dataTable>

        </h:form>
    </h:panelGroup>

我提交第一份表格时一无所有。仅当我重新加载页面时才会刷新数据表。可以通过ajax调用呈现简单文本时,看来本教程正在运行。

从ajax调用通过数据库操作重新加载数据的正确方法是什么? 第二个表使用ViewScope从另一个bean获取数据。这可能是问题吗?

0 个答案:

没有答案
相关问题