Hi Experts,
I am developing web application using Smart GWT 2.2, and I am trying to apply a custom css style for CheckboxItem, what I want to do is to change the checked and unchecked images, but I don’t want the URL to be hard coded in the java code, I want to use css elements to change the images.
This is sample code:
formItems1.add(createTextItem(“Best way to contact you?”, top, 0, axisLeft));
CheckboxItem homePhoneCheckbox = new CheckboxItem(“homePhone”);
homePhoneCheckbox.setTitle(“Home Phone”);
setRect(homePhoneCheckbox, top, axisRight, 80);
homePhoneCheckbox.setTextBoxStyle(“consultation_form_value”);
formItems1.add(homePhoneCheckbox);
The generated html code is this:
<span id=“isc_1H” $89=“isc_CheckboxItem_3” eventproxy=“isc_DynamicForm_0” style=“white-space: nowrap;”>
<table id=“isc_1I” class=“” cellspacing=“0” cellpadding=“0” border=“0” style=“border: 0px none ; margin: 0px; padding: 0px; background-image: none; background-color: transparent; white-space: normal;”>
<tbody>
<tr>
<td valign=“middle” style=“border: 0px none ; margin: 0px; padding: 0px; background-image: none; background-color: transparent; height: 20px;”>
<div id=“isc_1J” class=“consultation_form_value” tabindex=“1404” style=“min-width: 80px; white-space: nowrap;” $9a=“$9d” $89=“isc_CheckboxItem_3”>
<img id=“isc_1K” height=“13” border=“0” align=“texttop” width=“13” suppress=“TRUE” style=“vertical-align: middle; margin-left: 4px; margin-right: 3px;” eventpart=“valueicon” src=“http://127.0.0.1:8888/showroomconsultation/sc/skins/Enterprise/images/DynamicForm/unchecked.png”/>
Home Phone
</div>
</td>
</tr>
</tbody>
</table>
</span>
If you notice you will see that setTextBoxStyle is applied to the div tag, but not the nested img, any idea how to change the image using css?
Thx!