Server-Side Component with two inputs possible without hack? #1115
Replies: 3 comments 2 replies
-
So I got a cleaner version now that calls the same js function from both range inputs. What I don't like yet, is that I'm referencing the input elements directly from the script by id. This can cause bugs if the ids are changed or other elements have the same id in future. |
Beta Was this translation helpful? Give feedback.
-
Just tested the deployment with the hack and without the hack. Both behave the same to me and the value after the |
Beta Was this translation helpful? Give feedback.
-
At me https://mvazyimwyigdiuhmhhfrninfnhuwkqzw.ihpapp.com/ShowCo2Producer?co2ProducerId=c8d6f416-ad52-484f-9f7e-b510dac2c158 is now working also! :O Can it be that I had something in the cache that could caused the problem? |
Beta Was this translation helpful? Give feedback.
-
I have a server-side component with two inputs inside. I need them to have two variable values to calculate a total.
With a hack I was able to get it work: I added the input values of each input to both actions that handle changes of the inputs. Only like that the websocket returns with two createNode instructions and every value that needs to update is actually updated. Without the hack the total value is only updated after each input hat been changed by the user.
With this hack it works. "otherValue" is the value of the other input:
philschonholzer/co2db@9b7bf4e
Here is a deployment without the hack. You can see that the total (after "=") is only updated after both inputs sliders are changed:
https://mvazyimwyigdiuhmhhfrninfnhuwkqzw.ihpapp.com/ShowCo2Producer?co2ProducerId=c8d6f416-ad52-484f-9f7e-b510dac2c158
And here it is deploy with the hack:
https://co2db.ihpapp.com/ShowCo2Producer?co2ProducerId=c8d6f416-ad52-484f-9f7e-b510dac2c158
Beta Was this translation helpful? Give feedback.
All reactions