users@woodstock.java.net

setProps invokes handling function value

From: Kenneth Suter <Kenneth.Suter_at_Sun.COM>
Date: Fri, 22 Feb 2008 16:00:33 -0600

Hello,

I am trying to replace the onClick handler of a Woodstock 4.2 button by
calling the button's setProps() function. I am surprised to find that
when I do this the handler itself is invoked. So for instance in this
example clicking the "Register" button causes an alert to pop up:

  <webuijsf:button id="testB1" text="Test"/>

  <input type="button" value="Register" onClick="document.getElementById('form1:testB1').setProps({onClick: alert('hi there')});return false"/>


Is this behavior expected? Is there a way to avoid the handling
function from being invoked?

Thanks,

-Kenneth