Rich PopupPanel の以下のようなコードが 1 つあります。
コード:-
<rich:popupPanel id="simplePopup1" autosized="true" width="300"
height="60" moveable="true" resizeable="false" zindex="100"
onmaskclick="#{rich:component('simplePopup1')}.hide()">
<f:facet name="header">
<h: outputText value="Popup" />
</f:facet>
<f:facet name="controls">
<h: outputLink value="#"
onclick="#{rich:component('simplePopup1')}.hide(); return false;">
X
</h: outputLink>
</f:facet>
<a4j:region>
<a4j: outputPanel ajaxRendered="true">
<h:form ajaxSubmit="true">
<h:panelGrid columns="1">
<a4j:commandLink action="#{popupBean.eventHandler.onClose}"
value="close" immediate="true" />
</h:panelGrid>
</h:form>
</a4j: outputPanel>
</a4j:region>
</rich:popupPanel>
a4j:commandbutton を使用して、このポップアップを表示することができます。しかし、その代わりに、javascript コードを使用してこのポップアップ ウィンドウを表示したいと考えています。
それを達成する方法は誰にでもあります。
以下のコードを試してみましたが、うまくいきません。
<a4j: outputPanel>
<script type="text/javascript">
javascript:document.getElementById('simplePopup1').style.display = 'none'; //or javascript:rich:component('simplePopup1')}.show();
</script>
</a4j: outputPanel>
注:- 私は JBoss6.1 で RF4.0 と JSF2.0 を使用しています ありがとう Jaikrat Singh