# Apply is not active

**URL:** https://discourse.paraview.org/t/apply-is-not-active/14024
**Category:** Development
**Created:** [February 26, 2024, 2:20pm UTC](https://discourse.paraview.org/t/apply-is-not-active/14024 "2024-02-26T14:20:42Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![joint](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@joint](https://discourse.paraview.org/u/joint)
#### Post date: [February 26, 2024, 2:20pm UTC](https://discourse.paraview.org/t/apply-is-not-active/14024/1 "2024-02-26T14:20:43Z")

</div>

Hello dear Paraview developers!

I have a filter with both a server side and a custom widget.

Custom widget uses client-server wrappings to call a widget’s function which itself calls python to select some points. Because of that, RequestData is somehow triggered and Apply button is not active.  
Dear Mathieu has suggested to call `this->Modified` from within a filter, and it works, Apply is active again.

However, I also have custom widgets which use client-server wrappings to modify server values

```auto
stream << vtkClientServerStream::Commands::Invoke << VTKOBJECT(given_proxy)
    << std::string("SetX") << ... << vtkClientServerStream::Types::End;

```

And when setX is actually called on the server, `this->Modify()` IS called.

But sadly enough, this Modify call does not make Apply button active

Could you please help me get Apply button active again?

Best regards,  
Mike

---

<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: [February 26, 2024, 2:25pm UTC](https://discourse.paraview.org/t/apply-is-not-active/14024/2 "2024-02-26T14:25:34Z")

</div>

> [@joint](#):
>
> ```auto
> stream << vtkClientServerStream::Commands::Invoke << VTKOBJECT(given_proxy)
> << std::string("SetX") << ... << vtkClientServerStream::Types::End;
> 
> ```

Do not talk to the server directly, use a property instead.

---

<div class="post-metadata">

### Author: ![joint](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@joint](https://discourse.paraview.org/u/joint)
#### Post date: [February 26, 2024, 2:37pm UTC](https://discourse.paraview.org/t/apply-is-not-active/14024/3 "2024-02-26T14:37:12Z")

</div>

```auto
<DoubleVectorProperty
	panel_widget="CustomWidget"	
	name="X"
	command="SetX"
	number_of_elements="1"
	default_values="0.0557"
	panel_visibility="advanced"
	label="Einstein X-factor">
</DoubleVectorProperty>

```

Could you clarify, please, if I write the following XML for my custom widget, what would I get in the constructor in smproxy

`CustomWidget::CustomWidget( vtkSMProxy* smproxy, vtkSMProperty* smproperty, QWidget* parentObject)`

Is it an object proxy for the filter object, or for the given element?

Is the recommended way to act is to call:  
`vtkSMPropertyHelper(smproxy, "X").Set(2);`

---

<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: [February 26, 2024, 2:40pm UTC](https://discourse.paraview.org/t/apply-is-not-active/14024/4 "2024-02-26T14:40:57Z")

</div>

> [@joint](#):
>
> Is the recommended way to act is to call:  
> `vtkSMPropertyHelper(smproxy, "X").Set(2);`

Yes

---

<div class="post-metadata">

### Author: ![joint](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@joint](https://discourse.paraview.org/u/joint)
#### Post date: [February 26, 2024, 2:57pm UTC](https://discourse.paraview.org/t/apply-is-not-active/14024/5 "2024-02-26T14:57:48Z")

</div>

If I use this line of code only, nothing happens.

If I add  
` given_proxy->UpdateVTKObjects();`

The value is indeed updated

Apply is not activated, but RequestData and RequestDataObject are called

---

<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: [February 26, 2024, 3:14pm UTC](https://discourse.paraview.org/t/apply-is-not-active/14024/6 "2024-02-26T15:14:33Z")

</div>

Sorry, I cant help much more witout looking at the code. You can find a working example here:

`Examples/Plugins/PropertyWidgets/Plugin`

[https://gitlab.kitware.com/paraview/paraview/-/tree/master/Examples/Plugins/PropertyWidgets?ref\_type=heads](https://gitlab.kitware.com/paraview/paraview/-/tree/master/Examples/Plugins/PropertyWidgets?ref_type=heads)
