1 Reply Latest reply on Oct 3, 2009 8:50 AM by amitev

    pass an el method as a parameter on an include

    scphantm.scphantm.gmail.com

      im trying to come up with a bunch of control templates.  my problem is i need to pass not only strings to the parameters, but occationally el methods.


      so in one situation i need the end control to look like this


      <h:commandButton action="continue"/>



      and in another situation i need


      <h:commandButton action="#{bean.runmethod}"/>



      is that possible?

        • 1. Re: pass an el method as a parameter on an include
          amitev

          This is currently not supported by facelets. However there is an ugly workaround:


          <h:inputTextarea id="#{id}" 
              value="#{input}" required="true">
              <a4j:support ajaxSingle="true" onsubmit="changed()"
                event="onchange" action="#{actionBean[action]}"  />
          </h:inputTextarea>



          Usage:


          <ui:include src="shared/inputTextArea.template.xhtml">
             <ui:param name="id" value="numberOfObjects"/>
             <ui:param name="input" value="#{selectedProject.projectBasis.numberOfObjects}"/>
             <ui:param name="actionBean" value="#{selectedProject.projectBasis}"/>
             <ui:param name="action" value="touch}"/>
          </ui:include>



          In JSF2 this king of stuff is supported.