powercat-creator-kit icon indicating copy to clipboard operation
powercat-creator-kit copied to clipboard

(SpinButton) DefaultValue field does not function, cannot reset control value

Open joneselliot opened this issue 3 years ago • 5 comments

The SpinButton component's DefaultValue property seems to have no effect on the control's value. In addition, Reset([SpinButtonControl]) does not work, meaning it is impossible to refresh the component's value without refreshing the app. This presents issues when using the SpinButton for submittable forms, etc.

AB#988

joneselliot avatar Feb 10 '23 19:02 joneselliot

I have the same issue. Impossible to use the spinbutton unfortunately. Hope someone has a look into it soon, because the spinbutton itself is an awesome thing!

hebbelmann avatar Mar 01 '23 05:03 hebbelmann

+1 I've seen the same thing. The value state can't be reset when moving back and forth between canvas screens. It is somehow maintaining the .value property and I can't reset. If I increment the control, it resets the value to what is displayed on the screen.

contecc avatar Mar 07 '23 21:03 contecc

While not a great solution, I did come across an interesting way to reset the SpinButton control leveraging the Suffix property.

Set a variable in the Suffix property of the SpinButton: image

When you want to reset the control to the DefaultValue. Set the suffix variable to an empty space (" ").

image

This triggers a re-render of the control which defualts it back to the DefaultValue.

After this, using a timer control I clear the tempSuffix variable back to blank, I found that in order for the re-render to occur the suffix had to be different. Having this allowed me to reuse the above logic throughout my app 🙂

image

Hopefully this workaround helps, its a great control so hopefully someone is having a look at this 🙂

JMS404 avatar Apr 24 '23 03:04 JMS404

This workaround works for me! thanks for that. It would be awesome for their to be a reset event or for it to re-render on visible or something similar

shammyowens avatar Jun 15 '23 14:06 shammyowens

I ran across this issue as well. The work-around above worked for me as well. I hope this is on the to be fixed list. Maybe a new Input Event?

sperry1625 avatar Aug 31 '23 14:08 sperry1625