0

在我的 crud 应用程序中,我想选择一行,然后在弹出窗口中显示该行数据。导航到另一个页面有效并显示数据。当我尝试在弹出窗口中显示它时,不会显示任何值。我可能是错的,但我认为在方法 prepareView 完成之前会打开弹出窗口。

代码块:

<h:column>
                            <f:facet name="header">
                                <h:outputText value="&nbsp;"/>
                            </f:facet>
                            <h:commandLink id="myLink" value="Action" action="#{timeLoggingDetailController.prepareView}" rendered="#{item.timeLoggingId eq AdminTimeLogging.filteredId}" styleClass="auto-style5">
                                <rich:componentControl target="popup" operation="show"/>
                            </h:commandLink>
                        </h:column>
                    </h:dataTable>
                </h:panelGroup>
            </h:form>
            <rich:popupPanel id="popup" modal="false" autosized="true" resizeable="false" domElementAttachment="form">
                <f:facet name="header">
                    <h:outputText value="Approval level" />
                </f:facet>
                <f:facet name="controls">
                    <h:outputLink value="#" onclick="#{rich:component('popup')}.hide();
                            return false;">
                        Close
                    </h:outputLink>
                </f:facet>
                <h:form id="submitForm">
                    <h:panelGrid columns="2">
                        <h:outputText value="#{bundle.ViewTimeLoggingDetailLabel_date}"/>
                        <h:outputText value="#{timeLoggingDetailController.selected.date}" title="#{bundle.ViewTimeLoggingDetailTitle_date}">
                            <f:convertDateTime pattern="MM/dd/yyyy" />
                        </h:outputText>
                        <h:outputText value="#{bundle.ViewTimeLoggingDetailLabel_description}"/>
                        <h:outputText value="#{timeLoggingDetailController.selected.description}" title="#{bundle.ViewTimeLoggingDetailTitle_description}"/>
                        <h:outputText value="#{bundle.ViewTimeLoggingDetailLabel_normalHours}"/>
                        <h:outputText value="#{timeLoggingDetailController.selected.normalHours}" title="#{bundle.ViewTimeLoggingDetailTitle_normalHours}"/>
                        <h:outputText value="#{bundle.ViewTimeLoggingDetailLabel_overtimeHours}"/>
                        <h:outputText value="#{timeLoggingDetailController.selected.overtimeHours}" title="#{bundle.ViewTimeLoggingDetailTitle_overtimeHours}"/>
                        <h:outputText value="#{bundle.ViewTimeLoggingDetailLabel_doubleTimeHours}"/>
                        <h:outputText value="#{timeLoggingDetailController.selected.doubleTimeHours}" title="#{bundle.ViewTimeLoggingDetailTitle_doubleTimeHours}"/>
                        <h:outputText value="#{bundle.ViewTimeLoggingDetailLabel_approvalLevelsId}"/>
                        <h:outputText value="#{timeLoggingDetailController.selected.approvalLevelsId}" title="#{bundle.ViewTimeLoggingDetailTitle_approvalLevelsId}"/>
                    </h:panelGrid>
                    <br />
                    <h:panelGrid  class="auto-style4">
                        <h:commandLink   action="#{timeLoggingDetailController.update}" value="#{bundle.EditTimeLoggingDetailSaveLink}" onclick="#{rich:component('popup')}.hide();" styleClass="linkbutton"/>
                    </h:panelGrid>
                </h:form>
            </rich:popupPanel>
        </ui:define>
    </ui:composition>

</html>
4

1 回答 1

1

您可能想要使用<a4j:commandLink>,它提供oncomplete了在操作完成时触发的事件。

这应该适合你:

<a4j:commandLink id="myLink" value="Action" actionListener="#{timeLoggingDetailController.prepareView}" rendered="#{item.timeLoggingId eq AdminTimeLogging.filteredId}" styleClass="auto-style5">
    <rich:componentControl event="complete" target="popup" operation="show"/>
</a4j:commandLink>
于 2013-10-10T12:59:42.410 回答