开发者社区> 问答> 正文

从ajax调用重新加载数据表

想用数据表来实现这个例子:

<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获取数据。这可能是问题吗?

展开
收起
几许相思几点泪 2019-12-22 18:28:22 584 0
0 条回答
写回答
取消 提交回答
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载