使用 rich:modalPanel 编辑 rich:extendedDataTable

发布于 2024-12-06 15:42:24 字数 2762 浏览 0 评论 0原文

I have a <code>rich:extendedDataTable</code>.  Each row has a a4j:commandLink  as below.

Table Page:

     <a4j:commandLink     
      id="editlink" oncomplete="#{rich:component('editPanel')}.show()" 
      reRender="editPanel">

    <f:setPropertyActionListener value="#{archive}" 
      target="#{archiveOrderBean.currentOrder}" />

    <f:setPropertyActionListener value="#{row}" 
       target="#{archiveOrderBean.currentRow}" />

    <h:graphicImage value="/images/edit.png" 
       style="border:0;vertical-align: top;" />

    </a4j:commandLink>

单击该链接后,rich:modalPanel 将填充所选行的值。所选行的内容已正确获取,但是当编辑 modalpanel 中的数据时,该值未反映在 bean 中。

Bean Getter and Setter: 

    <code>public ArchiveOrderModel getCurrentOrder() {
        return currentOrder;
    }

    public void setCurrentOrder(ArchiveOrderModel currentOrder) {
        this.currentOrder = currentOrder;
    }
    </code>

ModalPanel Page : below contents are included in the  <code>rich:modalPanel</code>     and       <code>h:form</code>

    <h:panelGrid columns="1">
                <a4j:outputPanel>
                    <h:panelGrid columns="2">
                        <h:outputText value="Name" />
                        <h:outputLabel value="SL_#{archiveOrderBean.currentOrder.structureId}" />
                        <h:outputText value="Client" />
                        <h:inputText value="#{archiveOrderBean.currentOrder.customer}"  style="width:200px"/>
                        <h:outputText value="DateCreated" />
                        <h:outputText value="#{archiveOrderBean.currentOrder.date}" style="width:200px" />
                        <h:outputText value="Description" />
                        <h:inputText value="#{archiveOrderBean.currentOrder.version}" style="width:200px" />
                         <h:outputText value="Order Desription" />
                        <h:inputText value="#{archiveOrderBean.currentOrder.orderType}" style="width:200px" />
                    </h:panelGrid>
                    <rich:message showSummary="true" showDetail="false" for="price" />
                </a4j:outputPanel>
                <a4j:commandButton value="Update" 
                    action="#{archiveOrderBean.updateStruct}"
                    reRender="auftragListNew"
                    oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('editPanel')}.hide();" >
                    </a4j:commandButton>
            </h:panelGrid>

任何人都可以帮我解决这个问题吗?我只需要知道如何将 modalPanel 值更新回 bean。

I have a <code>rich:extendedDataTable</code>.  Each row has a a4j:commandLink  as below.

Table Page:

     <a4j:commandLink     
      id="editlink" oncomplete="#{rich:component('editPanel')}.show()" 
      reRender="editPanel">

    <f:setPropertyActionListener value="#{archive}" 
      target="#{archiveOrderBean.currentOrder}" />

    <f:setPropertyActionListener value="#{row}" 
       target="#{archiveOrderBean.currentRow}" />

    <h:graphicImage value="/images/edit.png" 
       style="border:0;vertical-align: top;" />

    </a4j:commandLink>

On click of the the link the rich:modalPanel is populated with the values of the selected row. The content of the selected row is fetched correctly, but when the data in the modalpanel is edited, the value is not being reflected in the bean.

Bean Getter and Setter: 

    <code>public ArchiveOrderModel getCurrentOrder() {
        return currentOrder;
    }

    public void setCurrentOrder(ArchiveOrderModel currentOrder) {
        this.currentOrder = currentOrder;
    }
    </code>

ModalPanel Page : below contents are included in the  <code>rich:modalPanel</code>     and       <code>h:form</code>

    <h:panelGrid columns="1">
                <a4j:outputPanel>
                    <h:panelGrid columns="2">
                        <h:outputText value="Name" />
                        <h:outputLabel value="SL_#{archiveOrderBean.currentOrder.structureId}" />
                        <h:outputText value="Client" />
                        <h:inputText value="#{archiveOrderBean.currentOrder.customer}"  style="width:200px"/>
                        <h:outputText value="DateCreated" />
                        <h:outputText value="#{archiveOrderBean.currentOrder.date}" style="width:200px" />
                        <h:outputText value="Description" />
                        <h:inputText value="#{archiveOrderBean.currentOrder.version}" style="width:200px" />
                         <h:outputText value="Order Desription" />
                        <h:inputText value="#{archiveOrderBean.currentOrder.orderType}" style="width:200px" />
                    </h:panelGrid>
                    <rich:message showSummary="true" showDetail="false" for="price" />
                </a4j:outputPanel>
                <a4j:commandButton value="Update" 
                    action="#{archiveOrderBean.updateStruct}"
                    reRender="auftragListNew"
                    oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('editPanel')}.hide();" >
                    </a4j:commandButton>
            </h:panelGrid>

Can Any one please help me out for this. I just need to know how the modalPanel values can be updated back to bean.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陪我终i 2024-12-13 15:42:24

问题是 a4j:commandButton 没有正确放置在 h:form 内。我现在可以找到更新的值

The problem was that the a4j:commandButton was not correctly placed inside the h:form. I could now find the updated values

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文