# UI Text Input state is not saved (time, date, week color picker)

**URL:** <https://discourse.nodered.org/t/ui-text-input-state-is-not-saved-time-date-week-color-picker/3896>\
**Category:** Dashboard\
**Created:** [11 October 2018 14:32 UTC](https://discourse.nodered.org/t/ui-text-input-state-is-not-saved-time-date-week-color-picker/3896 "2018-10-11T14:32:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gil27255](https://avatars.discourse-cdn.com/v4/letter/g/8e8cbc/32.png) [@gil27255](https://discourse.nodered.org/u/gil27255)\
**Post date:** [11 October 2018 14:32 UTC](https://discourse.nodered.org/t/ui-text-input-state-is-not-saved-time-date-week-color-picker/3896/1 "2018-10-11T14:32:06Z")

</div>

If the "Mode" property for a Text Input UI Dashboard node is changed to color, time, month, week etc. picker the state (value) is not saved as is with all the other controls included as part of the Dashboard. Note that the state is saved if the Mode property is set to the default value of "Text Input". By "not saved" I mean if you close the UI browser window and then reopen it, the previously selected value is gone.

I'm trying to figure out a good workaround to refresh the value

The obvious solution is to save the state in a flow level variable and then send an input message with the payload set to the stored value. However, I cannot find a way to detect an event for "UI browser opened". One solution is to use an Inject Node that repeats every second. This results in lots of mostly unnecessary messages and therefore is not an efficient solution. Any suggestions would be greatly appreciated. Thanks!

---

<div class="post-metadata">

**Author:** ![hugobox](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hugobox/32/2948_2.png) [@hugobox](https://discourse.nodered.org/u/hugobox)\
**Post date:** [11 October 2018 14:46 UTC](https://discourse.nodered.org/t/ui-text-input-state-is-not-saved-time-date-week-color-picker/3896/2 "2018-10-11T14:46:32Z")

</div>

Look at the "ui control" dashboard node, it emits a msg everytime a browser client connects or disconnects.

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [11 October 2018 14:52 UTC](https://discourse.nodered.org/t/ui-text-input-state-is-not-saved-time-date-week-color-picker/3896/3 "2018-10-11T14:52:27Z")

</div>

> [@gil27255](#):
>
> One solution is to use an Inject Node that repeats every second. This results in lots of mostly unnecessary messages

Why not check this option in the inject node ? The node will send the payload only once.

![r-01](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/4871c471f56d2328af6aad4e9404f39e0f0dc75e.png)

---

<div class="post-metadata">

**Author:** ![gil27255](https://avatars.discourse-cdn.com/v4/letter/g/8e8cbc/32.png) [@gil27255](https://discourse.nodered.org/u/gil27255)\
**Post date:** [11 October 2018 19:57 UTC](https://discourse.nodered.org/t/ui-text-input-state-is-not-saved-time-date-week-color-picker/3896/4 "2018-10-11T19:57:21Z")

</div>

It is my understanding that startup means when u redeploy or restart Node-Red proper. The information disappears when the UI browser window is closed. Thus I have no event to trigger an injection node.

---

<div class="post-metadata">

**Author:** ![gil27255](https://avatars.discourse-cdn.com/v4/letter/g/8e8cbc/32.png) [@gil27255](https://discourse.nodered.org/u/gil27255)\
**Post date:** [11 October 2018 19:58 UTC](https://discourse.nodered.org/t/ui-text-input-state-is-not-saved-time-date-week-color-picker/3896/5 "2018-10-11T19:58:49Z")

</div>

That sounds like what I was looking for. Thank you!
