Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yes I dont see any problems with doing this. You can use my code if you want: </p> <pre><code>&lt;rich:modalPanel id="popup" width="261" height="386" autosized="true"left="180" top="200" keepVisualState="true"&gt; &lt;h:panelGrid id="panelGrid"&gt; &lt;h:outputText value="#{PopupBean.output}" id="popupMessage"/&gt; &lt;a4j:commandLink action="#"&gt; &lt;h:outputText value="Close" /&gt; &lt;rich:componentControl for="popup" operation="hide" event="onclick"/&gt; &lt;/a4j:commandLink&gt; &lt;/h:panelGrid&gt; &lt;/rich:modalPanel&gt; &lt;h:panelGrid columns="2"&gt; &lt;a4j:commandLink action="#" reRender="panelGrid"&gt; &lt;h:outputText value="Yes" /&gt; &lt;rich:componentControl for="popup" operation="show" event="onclick"/&gt; &lt;a4j:actionparam name="message" assignTo="#{PopupBean.output}" value="#{TestBean.input1}"/&gt; &lt;/a4j:commandLink&gt; &lt;a4j:commandLink action="#" reRender="panelGrid"&gt; &lt;h:outputText value="No" /&gt; &lt;rich:componentControl for="popup" operation="show" event="onclick"/&gt; &lt;a4j:actionparam name="message2" assignTo="#{PopupBean.output}" value="#{TestBean.input2}"/&gt; &lt;/a4j:commandLink&gt; &lt;/h:panelGrid&gt; </code></pre> <p>Basicly the output in the modal panel will contain the values in the TestBean</p> <p><strong>Edit (the misunderstanding)</strong>: </p> <p>I believe you will have to define your modal panel like this: </p> <pre><code>&lt;rich:modalPanel id="popup" width="261" height="386" autosized="true"left="180" top="200" keepVisualState="true" binding="#{PopupBean.popupPanel}"&gt; &lt;/rich:modalPanel&gt; </code></pre> <p>And in your managed bean you will have to addChildren to your modal panel dynamically with java like this:</p> <pre><code>public String action_PoppingThePanel() { HtmlCommandButton button = new HtmlCommandButton(); button.setValue("Yes"); String action = "#{TestBean.action_yes}"; MethodExpression methodExpression = FacesContext.getCurrentInstance().getApplication().getExpressionFactory(). createMethodExpression(FacesContext.getCurrentInstance().getELContext(), action, null, new Class&lt;?&gt;[0]); button.setActionExpression(methodExpression); getPopupPanel().getChildren().add(button); button = new HtmlCommandButton(); button.setValue("No"); String action = "#{TestBean.action_no}"; methodExpression = FacesContext.getCurrentInstance().getApplication().getExpressionFactory(). createMethodExpression(FacesContext.getCurrentInstance().getELContext(), action, null, new Class&lt;?&gt;[0]); button.setActionExpression(methodExpression); getPopupPanel().getChildren().add(button); getPopupPanel().setRendered(true); getPopupPanel().setShowWhenRendered(true); return null; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload