やりたいことは次のとおりです。私のデータテーブルでは、最後の列にビュー、編集、および削除があります。ビューには、行データを取得する次のメソッドがあります。
public String prepareView() {
current = (TimeLoggingDetail) getItems().getRowData();
selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex();
return "View";
}
ビューをクリックすると、選択した値を表示できるページにリダイレクトされます。それをポップアップに値を表示するように変更し、表示されているページにリダイレクトされないようにしたいと考えています。
だから私は次のことを試しました:
<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>
ボタンをクリックしてもポップアップは表示されず、削除するevent="complete"
とポップアップは表示されますが、値はありません。ポップアップ コードを完全に削除し、表示をクリックしてからポップアップ コードを再度追加すると、表示されますが、ポップアップ コードなしで選択した古い値のみが表示されます。メモリ内の値です。
私も試しました:
<a4j:commandLink id="myBut" action="#{timeLoggingDetailController.prepareView}" execute="@this" value="Test" styleClass="auto-style5" render="popup" oncomplete="#{rich:component('popup')}.show()">
</a4j:commandLink>
ポップアップも開きません。さまざまな方法で使用してみましたが、開きません。特定の何かを返すよう#{rich:component('popup')}.show()
にメソッドを変更する必要がありますか? prepareView
これらの値でポップアップを表示する条件を設定する必要がありますか? メソッドが終了する前にポップアップが開くようです。これ<a4j:commandLink/>
はコード内にあります:
<h:column>
<f:facet name="header">
<h:outputText value=" "/>
</f:facet>
<a4j:commandLink id="myBut" action="#{timeLoggingDetailController.prepareView}" execute="@this" value="Test" styleClass="auto-style5" render="popup" oncomplete="#{rich:component('popup')}.show()">
</a4j:commandLink>
<h:column/>
私のポップアップパネル:
<h:column>
<f:facet name="header">
<h:outputText value=" "/>
</f:facet>
<a4j:commandLink id="myBut" action="#{timeLoggingDetailController.prepareView}" execute="@this" value="Test" styleClass="auto-style5" render="popup" oncomplete="#{rich:component('popup')}.show()">
</a4j:commandLink>
<rich:popupPanel id="popup" modal="true" autosized="true" resizeable="false" domElementAttachment="form">
<f:facet name="header">
<h:outputText value="TEST" />
</f:facet>
<f:facet name="controls">
<h:outputLink value="#" onclick="#{rich:component('popup')}.hide();
return false;">
Close
</h:outputLink>
</f:facet>
<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>value="#{approvalLevelsController.selected.description}" title="#{bundle.ViewApprovalLevelsTitle_description}"/>
<br />
<h:panelGrid class="auto-style4">
<h:commandLink action="#{timeLoggingDetailController.update}" value="#{bundle.EditTimeLoggingDetailSaveLink}" onclick="#{rich:component('popup')}.hide();" styleClass="linkbutton"/>
</h:panelGrid>
</rich:popupPanel>
</h:column>