# Is a "NamedValuesDomain" a good addition ?

**URL:** https://discourse.paraview.org/t/is-a-namedvaluesdomain-a-good-addition/1892
**Category:** Development
**Created:** [May 21, 2019, 8:39am UTC](https://discourse.paraview.org/t/is-a-namedvaluesdomain-a-good-addition/1892 "2019-05-21T08:39:56Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 21, 2019, 8:39am UTC](https://discourse.paraview.org/t/is-a-namedvaluesdomain-a-good-addition/1892/1 "2019-05-21T08:39:56Z")

</div>

In ParaView, ArraySelectionDomain allows to select wich array (actually which string) to enable/disable on a vtk object, using a widget like this one :  
 ![2019-05-21-110444_263x93_scrot](https://discourse.paraview.org/uploads/default/original/2X/e/e388915a5ddd2e9a418f20b7bbf2f252a5e969fe.png)

StringListDomain, in the other hand, allow to select a single string within a list of string , using a simple combobox.

Not using domains at all, we can also produce, for a repeatable property, this kind of widgets :  
 ![2019-05-21-110851_270x76_scrot](https://discourse.paraview.org/uploads/default/original/2X/b/b0960d577bed2073eeda5f9d7c269fe830e0a020.png)

What about creating the last kind of widget when using a StringListDomain in a repeatable property. The first being filled up be provided string or from an information property with a StringArrayHelper ?  
Unless it would be better to create a new domain altogether , eg “NamedValuesDomain” ?

For the information property version, it would be nice to have default values on each string, so instead of a StringArrayHelper, a more modern si\_class may be a nice way to implement it.

Any thoughts ?

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [May 21, 2019, 12:37pm UTC](https://discourse.paraview.org/t/is-a-namedvaluesdomain-a-good-addition/1892/2 "2019-05-21T12:37:19Z")

</div>

before we think of the solution, a few questions.

1. What are the values, in your intended case? Looks like the information property is only providing information about “names” not the values. Is that correct?
2. Is there any default value that is expected to be set on the property?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 21, 2019, 12:39pm UTC](https://discourse.paraview.org/t/is-a-namedvaluesdomain-a-good-addition/1892/3 "2019-05-21T12:39:29Z")

</div>

> [@utkarsh.ayachit](#):
>
> before we think of the solution, a few questions.
> 
> 1. What are the values, in your intended case? Looks like the information property is only providing information about “names” not the values. Is that correct?

Indeed

> [@](#):
>
> 1. Is there any default value that is expected to be set on the property?

I suppose they should come from the information property as well.

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [May 21, 2019, 12:48pm UTC](https://discourse.paraview.org/t/is-a-namedvaluesdomain-a-good-addition/1892/4 "2019-05-21T12:48:57Z")

</div>

> [@mwestphal](#):
>
> For the information property version, it would be nice to have default values on each string, so instead of a StringArrayHelper, a more modern si\_class may be a nice way to implement it.

BTW, the `ArrayHelpers` in XML are indeed replaced by appropriate `si_class` when the XML is parsed. ArrayHelpers we indeed things that existed before the `si_class` thing came about.

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [May 21, 2019, 12:50pm UTC](https://discourse.paraview.org/t/is-a-namedvaluesdomain-a-good-addition/1892/5 "2019-05-21T12:50:06Z")

</div>

A new domain sounds reasonable.
