title: Call and pass parameters to method of actionclass from a generic modal panel (JSF, SEAM)
body: <p>in our project we have a lot of modal panels to ensure that the user knows what he is about to do. all these panels look alike with just two buttons (ok and cancel).</p>
  
  <p>The only difference is the action that the OK-Button is performing.</p>
  
  <p>Now my idea is to build a generic modal panel that I just call and pass the action which is working fine until I need to pass parameters to the action-method.</p>
  
  <p>I am using this as OK-Button:</p>
  
  <pre><code>&lt;a:commandButton
    id="okGenericPanel"
    action="#{actionBean[action]}"
    value="#{messages['wizard.button.ok.label']}"
    oncomplete="#{oncomplete}"&gt;
  &lt;/a:commandButton&gt;
  </code></pre>
  
  <p>which is working fine. Calling this looks like the following:</p>
  
  <pre><code>&lt;a:commandLink id="testLink"
     value="#{messages['home.test']}" ajaxSingle="true"&gt;
     &lt;rich:componentControl for="genericPanel" 
        attachTo="testLink" operation="show" event="onclick" /&gt;
  &lt;/a:commandLink&gt;
  &lt;ui:include src="/components/genericModalPanel.xhtml"&gt;
     &lt;ui:param name="actionBean" value="#{adminHomeAction}"/&gt;
     &lt;ui:param name="action" value="sayHello"/&gt;
     &lt;ui:param name="oncomplete" value="alert('im done');" /&gt;
  &lt;/ui:include&gt;
  </code></pre>
  
  <p>I already tried to give the parameter direclty into the ui:param like this:</p>
  
  <pre><code>&lt;ui:param name="action" value="sayHello('hello')"/&gt;
  </code></pre>
  
  <p>or in the actual call:</p>
  
  <pre><code>action="#{actionBean[action]('hello')}"
  </code></pre>
  
  <p>but neither works.</p>
  
  <p>Is there another way to do this? Or is it only possible to call methods without any parameters this way?</p>
  
  <p>thanks a lot for any help,
  Martin</p>