I attached the onCheck event with a combo which has been initialized from a select box. When on the UI, I check any checkbox, it doesn’s fire any event. Why is that so?
Here’s the code that I am using:
// Struts tag for select combo
<s:select label=“broker” id=“brokerId”
listValue=“name” listKey=“id” opt_type=“checkbox”
multiple=“true” size=“3” cssClass=“inputfield-style” />
type=“hidden” name=“broker” id=“broker”>
Ideally it should alert ‘hello’ as soon as i check any checkbox in the combo. Please suggest if I am missing something.
the onCheck event occurs when the checkbox of combo options is selected. The event won’t fire if you’ve selected the checkbox in combo header.
I’ve attached the demo.
sample.zip (21.6 KB)
I checked the sample that you sent. The only difference that i can see is that I am initializing the combo from struts select tag ie. <s:select>
It doesn’t fire any onCheck event. Is that an issue with the dhtmlxcombo integration with struts select tag?
if the combo object is correctly created and onCheck event is set, the event will fire. And it doesn’t matter how select tag has been generated
Let me narrate the exact the issue that I m facing. I have a multi select combo for I hve attached an ‘onBlur’ event. The onBlur event sets the combo text to the value checked. If a single value is selected then it sets the combo.getChecked() value. In case of multiple selection it sets the combo text as “various”.
Here’s the issue:
When I open the combo and use the mouse to scroll down through the scroll bar and select the checkbox for the item in the list and tab out it doesn’t fire the onBlur event. This is because clicking on the checkbox doesn’t get the focus on the combo. The same thing works fine if I do not use scrollbar and use the keys. That is the reason why I was thinking of taping the onCheck event.
Please suggest on how can we solve this issue. For more info the js code is below:
<s:select label=“broker” id=“brokerId” name=“broker” list="#session.brokerlist" listValue=“name” listKey=“id” opt_type=“checkbox” required=“false” multiple=“true” size=“3” cssClass=“inputfield-style” />
Do you use the latest combo version ?
onCheck event was added in 2.1 version.
I am using 2.5 PRO version of dhtmlx
Is this a known issue with the combo? Just to add on to the description, when a value is chosen by scrolling down the combo list and the check box is clicked and I tab out of the combo, the checked value isn’t shown in the combo text. However if I go back to the same combo and tab out again, the value is shown in the combo text. Definitely the focus gained/lost issue.
In the latest version the onBlur event is fired when tab is clicked
dhtmlxcombo.zip (9.8 KB)