JSF jsValueChangeListener with checkbox
Did anybody try to create using JavaServerFaces, a checkBox and a textBox, and when the checkBox is unchecked the textbox should disable immediatly?
I've tried and it works fine in mozilla but in IE the checkbox doesn't disable immediatly, just after a second click on the page. Does anybody know what's wrong ?
Thanks
[340 byte] By [
veveua] at [2007-11-27 7:00:13]

# 2
this is my code:
<t:selectBooleanCheckbox disabled="#{someBean.disabled}" id="checkBoxId" onchange="this.form.submit()" value="#{someBean.checkValue}">
<t:jsValueChangeListener for="myTextBox" expressionValue="if ($srcElem.checked) { $destElem.disabled=false } else {$destElem.disabled=true}"/>
</t:selectBooleanCheckbox>
<t:inputText id="myTextBox"
value="#{someBean.textBoxValue}"
size="3"
maxlength="3"
required="true">
<f:validateLongRange minimum="0"/>
</t:inputText>
Can anyone try this scenario and check if it works in IE ?
Thanks
veveua at 2007-7-12 18:50:54 >

# 3
Oh, you're talking about the Tomahawk component. Take a look on their mailing list and eventually report a bug. Maybe there's something wrong in the generated Javascript -if any, take a look in the generated source yourself.
I was expecting that you're using the valueChangeListener of the h:selectBooleanCheckbox.
# 6
I haven't used the jsValueChangeListener, but a little investigation suggests that it works entirely on the client side. So in this case I suspect that the onchange attribute you added to the selectBooleanCheckbox is interfering with the jsValueChangeListener.
See http://myfaces.apache.org/tomahawk/javascriptListener.html for more information.
# 7
Yes, the onchange attribute there is useless. But even if I remove it it doesn't work. I can't believe I can't find someone who had this problem, or someone who created a checkbox that disables a textbox in jsf !!!!!Any example would help me a lot, thanks.
veveua at 2007-7-12 18:50:54 >
