Selection field type elements cannot be shown. How to properly add a custom entity represention to Sulu form?

Following by Sulu documentation, I try to add selection field type to display collection type resource (Room object) in admin form. Currently, I can select these elements from list,

select element

selected element

but after form submit and reload any record cannot be shown, despite that the Room object exist in Event entity:

empty list

What I do wrong?

Code:

sulu_admin.yaml

sulu_admin:
...

# Registering Selection Field Types in this section
field_type_options:
    selection:
        room_selection:
            default_type: list_overlay
            resource_key: rooms
            types:
                list_overlay:
                    adapter: table
                    list_key: rooms
                    display_properties:
                        - name
                    icon: su-clock
                    label: 'app.rooms'
                    overlay_title: 'app.rooms'

event_details.xml

        <property name="rooms" type="room_selection">
             <meta>
                 <title>app.rooms</title>
             </meta>
        </property>

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 1

Your email address will not be published. Required fields are marked *


jo

jo

Hey,

Got the same issue. Did you fix it ? if yes how did you do that ?

thanks man