4 Replies Latest reply on Mar 18, 2008 9:55 PM by Keith Naas

    Constructing s:link or s:button action dynamically

    Brom bie Newbie

      Hi everyone,


      Is there a way to construct the action inside an s:button or s:link dynamically?


      For example, I want to do something like the code below to create a new Fruit based on a Seed.  The code doesn't work since seedHome.instance.id is not getting evaluated and have its value rendered.


      <s:button   
          action="#{fruitHome.createNew(seedHome.instance.id)}"
          id="createFruit" 
          view="/Fruit.xhtml"
          value="Create New Fruit Based">          
      </s:button> 



      Is there a way to construct the action for a link/button either during render time, or through a javascript on the browser side?


      thanks!