# Icon won't show in boolean column

**URL:** <https://forum.inductiveautomation.com/t/icon-wont-show-in-boolean-column/35944>\
**Category:** Ignition\
**Created:** [June 23, 2020, 8:21pm UTC](https://forum.inductiveautomation.com/t/icon-wont-show-in-boolean-column/35944 "2020-06-23T20:21:51Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [June 23, 2020, 8:21pm UTC](https://forum.inductiveautomation.com/t/icon-wont-show-in-boolean-column/35944/1 "2020-06-23T20:21:51Z")

</div>

I run a query, add a boolean column called ‘Selection’, and assign it to a custom property. I have a power table bound to the custom property and I want to show the Boolean column as a built-in icon because the standard Boolean check box is too small. I use the following code in configureCell. My print statements show that everything is working and the returned attributes are correct, however it still shows the standard Boolean check box. What am I missing?

```auto
	attributes = {"background": "white"}
	if rowIndex % 2 == 0:
		attributes["background"] = "#8CF58C"
	if colName == "Selection":
		print'in colname'
		if self.data.getValueAt(rowIndex, "Selection") == True:
			print 'in true'
			attributes["iconPath"] = "Builtin/icons/24/check2.png"
			attributes["text"] = None
		else:
			attributes["text"] = None
			print 'in false'
	print attributes
	return attributes

```

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 23, 2020, 8:41pm UTC](https://forum.inductiveautomation.com/t/icon-wont-show-in-boolean-column/35944/2 "2020-06-23T20:41:32Z")

</div>

It looks like it should show your icon on true, but the default on false. Are you not seeing that?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [June 23, 2020, 8:53pm UTC](https://forum.inductiveautomation.com/t/icon-wont-show-in-boolean-column/35944/3 "2020-06-23T20:53:06Z")

</div>

Even adding `attributes["iconPath"] = None` after the else: doesn't change anything.

> [@nminchin](#):
>
> Are you not seeing that?

Honestly, what does this comment add?

---

<div class="post-metadata">

**Author:** ![code\_skin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@code\_skin](https://forum.inductiveautomation.com/u/code_skin)\
**Post date:** [June 23, 2020, 8:57pm UTC](https://forum.inductiveautomation.com/t/icon-wont-show-in-boolean-column/35944/4 "2020-06-23T20:57:52Z")

</div>

Looks like the Boolean datatype has some override attributes for the iconPath.

Simple test for anyone reading this:  
-use a new Power Table with the TestData enabled.  
-add **return {“iconPath” : “Builtin/icons/24/check2.png”}** to the configureCell extension function.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/6/567665bf512bbce739d6866f781c381ec01c0549.png)

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 23, 2020, 9:01pm UTC](https://forum.inductiveautomation.com/t/icon-wont-show-in-boolean-column/35944/5 "2020-06-23T21:01:02Z")

</div>

> [@dkhayes117](#):
>
> Honestly, what does this comment add?

We'll I'm not at my laptop so couldn't check anything, relying on online user manual 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![kaushik.shah](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@kaushik.shah](https://forum.inductiveautomation.com/u/kaushik.shah)\
**Post date:** [June 23, 2020, 9:13pm UTC](https://forum.inductiveautomation.com/t/icon-wont-show-in-boolean-column/35944/6 "2020-06-23T21:13:46Z")

</div>

Yes, can’t reproduce that with Boolean. May be use integer and only 0 and 1 ?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [June 23, 2020, 9:20pm UTC](https://forum.inductiveautomation.com/t/icon-wont-show-in-boolean-column/35944/7 "2020-06-23T21:20:23Z")

</div>

I tried that, but when I press the icon to change it from 1 to 0 or vice versa it just highlights the cell to where I have to physically punch in the new value and hit enter. This will not work for my situation. I guess I’m stuck with the tiny, default icon 😓

---

<div class="post-metadata">

**Author:** ![code\_skin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@code\_skin](https://forum.inductiveautomation.com/u/code_skin)\
**Post date:** [June 23, 2020, 9:22pm UTC](https://forum.inductiveautomation.com/t/icon-wont-show-in-boolean-column/35944/8 "2020-06-23T21:22:59Z")

</div>

You could make that cell non-editable and update the DB or dataset on the doubleClick event.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 23, 2020, 9:50pm UTC](https://forum.inductiveautomation.com/t/icon-wont-show-in-boolean-column/35944/9 "2020-06-23T21:50:23Z")

</div>

In `initialize`:

```auto
	from javax.swing import JLabel
	from com.inductiveautomation.ignition.client.images import PathIcon
	label = JLabel(PathIcon(self, "check2.png", 24, 24))
	self.putClientProperty("checked", label)

```

In `configureCell`:

```auto
	if colName == 'Boolean Column' and value:
		return {'renderer': self.getClientProperty("checked")}

```

Result:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/b/db196cf63b5eeb5e3c69e4d21687ad56281f0152.png)

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [June 24, 2020, 6:38pm UTC](https://forum.inductiveautomation.com/t/icon-wont-show-in-boolean-column/35944/10 "2020-06-24T18:38:23Z")

</div>

```auto
{'renderer': javax.swing.JLabel[,-95,-22,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=8388608,maximumSize=,minimumSize=,preferredSize=,defaultIcon=com.inductiveautomation.ignition.client.images.PathIcon@4dc2a563,disabledIcon=,horizontalAlignment=CENTER,horizontalTextPosition=TRAILING,iconTextGap=4,labelFor=,text=,verticalAlignment=CENTER,verticalTextPosition=CENTER], 'background': 'white', 'text': None}

```

With your code it seems to work except the icon has an error. the attributes shows invalid in renderer

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/0/507302c757cf965357d439b576ea7754c7547379.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 24, 2020, 7:38pm UTC](https://forum.inductiveautomation.com/t/icon-wont-show-in-boolean-column/35944/11 "2020-06-24T19:38:15Z")

</div>

`"check2.png"` in my code sample should match the image path; I didn’t have the builtin icons so I just dropped one in the root level of my image management. `"Builtin/icons/24/check2.png"` should work on your system.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [June 24, 2020, 7:47pm UTC](https://forum.inductiveautomation.com/t/icon-wont-show-in-boolean-column/35944/12 "2020-06-24T19:47:30Z")

</div>

Yep that fixed it. It still shows an error in the Designer but is perfect in the client. Isn’t there something about designers that doesn’t guarantee certain rendering properties?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 24, 2020, 10:14pm UTC](https://forum.inductiveautomation.com/t/icon-wont-show-in-boolean-column/35944/13 "2020-06-24T22:14:09Z")

</div>

If you close and re-open the window in the designer it should work - the `initialize` function of the power table doesn’t fire each time you enter preview mode, so the client property probably was either outdated or missing entirely.

---

<div class="post-metadata">

**Author:** ![maidamar](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@maidamar](https://forum.inductiveautomation.com/u/maidamar)\
**Post date:** [October 3, 2021, 9:47pm UTC](https://forum.inductiveautomation.com/t/icon-wont-show-in-boolean-column/35944/14 "2021-10-03T21:47:59Z")

</div>

Old post, sorry to bring it back but it shows on search results.

I wanted to share another possible solution instead of changing the renderers.  
Just change the original value (i.e. change the query if it comes from a database) to be an integer 0 or 1, instead of a boolean, and then use `iconPath` on the return of the `configureCell` function. That way the Power Table won’t try to use a checkbox as a renderer and use the icon you want.
