4 Replies Latest reply on Jun 26, 2009 5:57 PM by Tanya Ruttenberg

    Neither s:link nor s:button giving correct results with onclick

    Tanya Ruttenberg Expert

      I am tearing my hair out over what I think must be a simple problem.

      I'm trying to add a button that, when you click it, takes you to an external web page. I think this is the HTML I want, but I can't figure out how to get Seam to render this HTML:

      <button onclick="location.href='http://smc.ba.ssa.gov'" type="button">SMC</button>

      I would simply use the HTML, but I want the button to match all the others.  And anyway, this should work, right??

      I have tried
      <s:button> and <s:link> and the code is never rendered correctly.

      Here is the rendering of the s:link :

      <a href="/newOnd/ONDResultPage.seam" onclick="location.href='http://smc.ba.ssa.gov'">SMC</a>

      Here is the rendering of the s:button:

      <input onclick="location.href='http://smc.ba.ssa.gov'; location.href='/newOnd/ONDResultPage.seam; return false;" value="SMC" type="button" />

      I have seen a previous forum posting advising people to stay away from s:button and style your s:link as a button. Fine. I'm happy to do that. But s:link isn't working either!  Argh. This is making me nuts.

      Using the latest and greatest Seam.