# Best way to update/rerun cell after widget change - compatible with Voila

**URL:** <https://discourse.jupyter.org/t/best-way-to-update-rerun-cell-after-widget-change-compatible-with-voila/4762>\
**Category:** General\
**Created:** [June 8, 2020, 4:11pm UTC](https://discourse.jupyter.org/t/best-way-to-update-rerun-cell-after-widget-change-compatible-with-voila/4762 "2020-06-08T16:11:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Florian\_Ludwig](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/florian_ludwig/32/2220_2.png) [@Florian\_Ludwig](https://discourse.jupyter.org/u/Florian_Ludwig)\
**Post date:** [June 8, 2020, 4:11pm UTC](https://discourse.jupyter.org/t/best-way-to-update-rerun-cell-after-widget-change-compatible-with-voila/4762/1 "2020-06-08T16:11:38Z")

</div>

With a simple example:

Cell 0:

```python
import ipywidgets as widgets
slider = widgets.IntSlider()

def value_changed(change):
   update_cell(1) # <-- how to do this

slider.observe(value_changed, 'value')
slider

```

Cell 1:

```python
slider.value

```

I would like to rerun cell `1` when the slider value changes. I’ve looked so for into:

- execute\_cells which works with jupyter notbooks, but not lab
- [#6563 Programatically execute cells](https://github.com/jupyterlab/jupyterlab/issues/6563#) which someone solved by writing their own plugin

Interestingly both solutions are client side which makes me wonder if that is the best way of approaching this issue. The callback is running inside the python kernel and should execute another piece of python code, so I am unsure if this is even the right angle to go at this.

Any pointers are welcome 🙂
