1 Reply Latest reply on Dec 3, 2008 4:11 PM by Ingo Jobling

    <a4j:actionparam> with Seam's <s:link> ?

    Ingo Jobling Master

      Hello,

      I am attempting to use <a4j:actionparam> with Seam's <s:link>

      The paramater is included in the GET request, but its value is not being interpreted as Javascript, even though noEscape="true".

      <rich:treeNode>
       <s:link view="page.xhtml" value="node" >
       <a4j:actionparam noEscape="true" name="param" value="screen.width" />
       </s:link>
      </rich:treeNode>
      


      Resulting URL:

      http://localhost:8080/page.seam?param=screen.width


      The Richfaces documentation states,
      This doesn't work with non-AJAX components.


      Is there any way I can use Richfaces to accomplish this?

      Any help much appreciated!

        • 1. Re: <a4j:actionparam> with Seam's <s:link> ?
          Ingo Jobling Master

          Geez, don't all reply at once :-)

          Anyhow, here is how I managed to include a javascript variable in the url generated for <s:link>, maybe someone else will find this useful ...

          <script type="text/javascript" >
          function interpolateJsVar(target, search, replacement){
           alert('interpolateJsVar called');
           return target.replace('='+search, '='+replacement);
          }
          </script>
          <rich:jQuery selector=".interpolateSplitterPosition" query="bind('click', function() { this.href=interpolateJsVar( this.href,'splitterPosition',splitterPosition ); });" timing="onload"/>


          <rich:treeNode>
           <s:link view="/intranet/premises/PremisesIdentification.xhtml" value="Premises: #{premises.number}" styleClass="interpolateSplitterPosition">
           <f:param name="premisesId" value="#{premises.id}" />
           <a4j:actionparam name="splitterPosition" value="splitterPosition" />
           </s:link>
          </rich:treeNode>