jeudi 23 juillet 2015

Displaying an indeterminate checkbox with GWT Bootstrap

I want to be able to set a Bootstrap checkbox to "indeterminate" status in GWT. I wrote the following code:

/**
 * JavaScript to give an ID'd element in a form the focus
 * 
 * @param checkbox      Element to manipulate
 * @param indeterminate True if indeterminate, false if not
 */
public static native void setIndeterminate (Element checkbox, boolean indeterminate) /*-{
    checkbox.indeterminate = indeterminate;
}-*/;

Running this in Chrome the debugger tells me that the checkbox is set to indeterminate = true, but it still displays as unselected. When I display this page I see the indeterminate checkbox correctly, so it's not a browser problem.

Any suggestions on how to fix this?




Aucun commentaire:

Enregistrer un commentaire