Object Dynamic Select depending on other field

#1

Good morning folks,

is there already a solution/bundle for the following?

The DataObject as has a Dynamic Select field which options should be dependend on a multihref/href/objects field.
Basically the Dynamic Select Provider gets the select options from a certain field within the object which is set in the objects field in the same DataObject.

So far I was not successful to find anything but I am pretty sure there is a sweet solution)

cheers
Renzo

0 Likes

#2

Old tpoic.
In the meantime, did you find a solution for this ?

0 Likes

#3

Hm… Only solution I have in mind is an EventListener. Hook into the pre-send-data event from the admin interface (https://github.com/pimcore/pimcore/blob/master/lib/Event/AdminEvents.php#L304) and there you can retrieve the data from one field and change the data of the select-field before the object is opened.

But; This is definitely not the best solution because you have to reload the object after saving it in order to make the data available for the select field.

I just used this to dynamically set the data for a select field but the data gets selected from another place and not from the same object (which makes this so difficult).

BR

0 Likes

#4

Thanks for the answer.
I will look on th js side.

0 Likes