# Obtaining xml variable values in a property widget

**URL:** https://discourse.paraview.org/t/obtaining-xml-variable-values-in-a-property-widget/8710
**Category:** ParaView Support
**Created:** [December 28, 2021, 10:18pm UTC](https://discourse.paraview.org/t/obtaining-xml-variable-values-in-a-property-widget/8710 "2021-12-28T22:18:30Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![anthomas](https://discourse.paraview.org/user_avatar/discourse.paraview.org/anthomas/32/7342_2.png) [@anthomas](https://discourse.paraview.org/u/anthomas)
#### Post date: [December 28, 2021, 10:18pm UTC](https://discourse.paraview.org/t/obtaining-xml-variable-values-in-a-property-widget/8710/1 "2021-12-28T22:18:30Z")

</div>

I have a plugin that implements a property widget, the plugin is an implementation of the vtkPOpenFOAMReader source.  
In a portion of the xml file I have:

```auto
<StringVectorProperty name="FileName" 
      command="SetFileName"
      animateable="0"
      number_of_elements="1">
      <FileListDomain name="files"/>
      <Documentation>This property specifies the file name for the
        reader.</Documentation>
    </StringVectorProperty>
      
    <IntVectorProperty name="pvOptAirfoil"
      number_of_elements="1"
      default_values="0"
      panel_widget="pvOptAirfoil">
      <BooleanDomain name="bool"/>
    </IntVectorProperty>

```

Where pvOptAirfoil is the property widget I am creating. Is it possible to expose the value of the filename to the code that handles the qt based property widget? Or obtain the value from the proxy somehow?

---

<div class="post-metadata">

### Author: ![anthomas](https://discourse.paraview.org/user_avatar/discourse.paraview.org/anthomas/32/7342_2.png) [@anthomas](https://discourse.paraview.org/u/anthomas)
#### Post date: [December 29, 2021, 1:36am UTC](https://discourse.paraview.org/t/obtaining-xml-variable-values-in-a-property-widget/8710/2 "2021-12-29T01:36:19Z")

</div>

I found a solution by creating a dummy QLineEdit object and linking the property value from the proxy.

```auto
  foamFilePath = new QLineEdit(this);
  this->addPropertyLink(foamFilePath, "text", SIGNAL(textChanged()), this->proxy()->GetProperty("FileName"));

```

It seems to work, but is there a more direct way of manipulating the properties?

---

<div class="post-metadata">

### Author: ![anthomas](https://discourse.paraview.org/user_avatar/discourse.paraview.org/anthomas/32/7342_2.png) [@anthomas](https://discourse.paraview.org/u/anthomas)
#### Post date: [December 29, 2021, 2:23am UTC](https://discourse.paraview.org/t/obtaining-xml-variable-values-in-a-property-widget/8710/3 "2021-12-29T02:23:55Z")

</div>

This fix also breaks the refresh (Modified command in xml) for some reason. Existing data loads fine but I cannot refresh the dataset.

---

<div class="post-metadata">

### Author: ![pavel](https://discourse.paraview.org/user_avatar/discourse.paraview.org/pavel/32/8287_2.png) [@pavel](https://discourse.paraview.org/u/pavel)
#### Post date: [December 30, 2021, 8:03am UTC](https://discourse.paraview.org/t/obtaining-xml-variable-values-in-a-property-widget/8710/4 "2021-12-30T08:03:41Z")

</div>

Hi Andrew,

In case you wrap your plugin in xml file, in RequestData() and RequestInformation() functions, which are the parts of your plugin, you have an access to FileName variable just by typing:  
`FileName`  
e.g.  
`print('FileName:', FileName)`  
(using last string, in ParaView’s Output Messages window you will see the value of FileName variable).

Best Regards,  
Pavel

---

<div class="post-metadata">

### Author: ![anthomas](https://discourse.paraview.org/user_avatar/discourse.paraview.org/anthomas/32/7342_2.png) [@anthomas](https://discourse.paraview.org/u/anthomas)
#### Post date: [December 30, 2021, 7:44pm UTC](https://discourse.paraview.org/t/obtaining-xml-variable-values-in-a-property-widget/8710/5 "2021-12-30T19:44:15Z")

</div>

The file I am trying to access the FileName variable in is an instance of pqPropertyWidget. I know the reader source code has access to FileName from RequestInformation, but does the pqPropertyWidget have access as well? If so do you have an example?
