# Power Table configureEditor inside Template Repeater

**URL:** <https://forum.inductiveautomation.com/t/power-table-configureeditor-inside-template-repeater/22203>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [January 29, 2019, 7:47pm UTC](https://forum.inductiveautomation.com/t/power-table-configureeditor-inside-template-repeater/22203 "2019-01-29T19:47:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bvaldovinos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bvaldovinos/32/6315_2.png) [@bvaldovinos](https://forum.inductiveautomation.com/u/bvaldovinos)\
**Post date:** [January 29, 2019, 7:47pm UTC](https://forum.inductiveautomation.com/t/power-table-configureeditor-inside-template-repeater/22203/1 "2019-01-29T19:47:17Z")

</div>

On a window I have a Power Table and a Template Repeater, and inside the Template Repeater contains two buttons and a Power Table.

The Power Table inside the Template Repeater has a custom dataset property that I’m trying to use as a dropdown for one specific column.

### Power table configureEditor that works.

isCellEditable isn’t turned off. Rows are for display and selecting only. The column “Procedure Name” successfully acts as a dropdown list.

```auto
	ds = system.dataset.toPyDataSet(self.ProcedureData)
	options = [(row["id"],row["name"]) for row in ds]
	if colName == "Procedure Name":
		return {"options":options}

```

### Power table configureEditor inside Template Repeater that doesn’t work.

isCellEditable isn’t turned on, but I have logic to change that for the column “Type.” I have tried this with the column “Type” as editable, and still this doesn’t work. I’m stuck. I would like Type to have a dropdown list. The custom property on this Power Table is not empty; it contains a dataset 2C x 5R. **Should I bind the custom property to the Template Repeater instead?**

```auto
#isCellEditable
	if colName <> "Type":
		return True
	else:
		return False

#configureEditor
	ds = system.dataset.toPyDataSet(self.select_agitation)
	options = [(row["idSelect"], row["select_text"]) for row in ds]
	if colName == "Type":
		return {"options":options}

```

Also, can I not use system.util.getLogger() inside of an extension function?

---

<div class="post-metadata">

**Author:** ![bvaldovinos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bvaldovinos/32/6315_2.png) [@bvaldovinos](https://forum.inductiveautomation.com/u/bvaldovinos)\
**Post date:** [January 29, 2019, 10:25pm UTC](https://forum.inductiveautomation.com/t/power-table-configureeditor-inside-template-repeater/22203/2 "2019-01-29T22:25:08Z")

</div>

In configureEditor, I’ve tried reading the dataset directly from tags, custom properties on the power table, and custom properties on the template repeater. I’m at a loss here and any help is appreciated.

---

<div class="post-metadata">

**Author:** ![bvaldovinos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bvaldovinos/32/6315_2.png) [@bvaldovinos](https://forum.inductiveautomation.com/u/bvaldovinos)\
**Post date:** [January 29, 2019, 11:10pm UTC](https://forum.inductiveautomation.com/t/power-table-configureeditor-inside-template-repeater/22203/3 "2019-01-29T23:10:01Z")

</div>

From the power table inside the template repeater, I cannot print from the configureEditor function. Neither that nor system.util.getLogger() work from that location.

---

<div class="post-metadata">

**Author:** ![bvaldovinos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bvaldovinos/32/6315_2.png) [@bvaldovinos](https://forum.inductiveautomation.com/u/bvaldovinos)\
**Post date:** [January 30, 2019, 5:46pm UTC](https://forum.inductiveautomation.com/t/power-table-configureeditor-inside-template-repeater/22203/4 "2019-01-30T17:46:53Z")

</div>

Figured it out finally. Not sure if another setting in my Power Table is causing an issue when used in a Template repeater, but this worked for me. In case anyone else has the same issue:

#### Doesn't work on a power table in a template repeater

```python
#configureEditor
        target = system.tag.read('[Client]Config/select_agitation').value
	ds = system.dataset.toPyDataSet(target)
	options = [(row["idSelect"], row["select_text"]) for row in ds]
	if colName == "Type":
		return {"options":options}

```

#### Works on a power table in a template repeater

```python
		root = self
		from javax.swing import JComboBox, DefaultCellEditor, DefaultComboBoxModel
		
		class CustomCellEditor(DefaultCellEditor):
			def getTableCellEditorComponent(self, table, value, isSelected, row, column):
				comp = DefaultCellEditor.getTableCellEditorComponent(self, table, value, isSelected, row, column)
				data = []
				# get the available options for agitation type column from client tag. 
				target = system.tag.read('[Client]Config/select_agitation').value
				pyData = system.dataset.toPyDataSet(target)
				for row in pyData:
					# append second column (select_text)
					data.append(row[1])
				comp.setModel(DefaultComboBoxModel(data))
				return comp
		return {'editor': CustomCellEditor(JComboBox())}

```

> [@Force configure cell update in power table](http://forum.inductiveautomation.com/t/force-configure-cell-update-in-power-table/16318/4):
>
> Maybe I’m misunderstanding the problem but it seems like you could create 2 datasets as custom properties on your root container. Whenever the user changes the items in the popup, you just refresh the datasets. Then in you configureEditor event, you could read the values in the appropriate dataset and return those items as options.

---

<div class="post-metadata">

**Author:** ![bvaldovinos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bvaldovinos/32/6315_2.png) [@bvaldovinos](https://forum.inductiveautomation.com/u/bvaldovinos)\
**Post date:** [January 30, 2019, 9:04pm UTC](https://forum.inductiveautomation.com/t/power-table-configureeditor-inside-template-repeater/22203/5 "2019-01-30T21:04:35Z")

</div>

Now I take back what I said. No idea why, but the code below works inside a template repeater. Totally baffled as to why it works only sometimes.

```auto
#configureEditor
        target = system.tag.read('[Client]Config/select_agitation').value
	ds = system.dataset.toPyDataSet(target)
	options = [(row["idSelect"], row["select_text"]) for row in ds]
	if colName == "Type":
		return {"options":options}

```
