Custom field to set value of another field #6077
Unanswered
georgobermayr
asked this question in
Q&A
Replies: 4 comments 5 replies
-
do this on the server side by listening to the entry saving/saved events and setting things there. |
Beta Was this translation helpful? Give feedback.
1 reply
-
You could probably use a field condition to slow a field dependent on the toggle when it’s true, and have the default value be true (or whatever you need) and the value won’t be populated unless the toggle is true.
Does that make sense? I’m in a pool at a resort right now just trying to help :)
… On May 23, 2022, at 1:42 PM, Georg Obermayr ***@***.***> wrote:
Thank you! I could certainly do that, but this would require a manual save and reload from the control panel user to trigger the event. I don't think that's the preferred editing experience here. There is no way to solve this on the client side? The value is already set correctly in the target field, it is just not shown.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Are you on the latest version?
… On May 24, 2022, at 10:06 AM, Georg Obermayr ***@***.***> wrote:
Thanks Jack for helping me from the pool! Basically, that is what I'm trying to do 😉
The value is set in the Replicator field, however it is not shown in the control panel UI.
This is how it looks like in the Vue inspector:
There is the _id property missing for each object in the array. However if I add it, still nothing is shown. If I save the entry and reload the browser window, the value is shown correctly. So I guess something is not happening correctly inside the Replicator field if I just commit the new value to the Vuex store.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Did you ever get this working @georgobermayr ? I'm looking to achieve a similar thing, but same issue occurs for me. Manually refreshing the page works as expected. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I try to create a custom field that extends a toggle. Once the toggle is checked, it should set the value of another field by fetching data from an internal API endpoint. My blueprint looks like this:
So my custom filed is named
overwrite_production_data
and the vue.js component looks like this:Basically on toggle I call a custom endpoint that delivers the data and then I commit an event to the Vuex store and set the value of the Replicator field. The data I receive is correct and has the data structure the Replicator field excepts.
The value of the Replicator field looks fine after I commit the new value via Vuex. However the value is not displayed in the Control panel. I have to save the page manually and reload it in order to view the new value of the field.
I think the commit to the Vuex store is not doing everything the Replicator field expects in order to view the data. The Replicator component seems to do a bit more, when a new entry is added via the user interface. Is there any way to trigger this chain of events? Or is there another approach to set the value of a field once something happens in another field?
Thanks,
Georg
Beta Was this translation helpful? Give feedback.
All reactions