Custom form: have to identical fields for different purpose

33 views
Skip to first unread message

Diego Brice

unread,
Dec 19, 2024, 3:27:00 AM12/19/24
to DSpace Technical Support
Hi!. I needed a form to add contributor.author from a drop-down list but also to have the option to write the author's name in case it is not in the list. So I defined the following fields:

<row>
                <field>
                    <dc-schema>dc</dc-schema>
                    <dc-element>contributor</dc-element>
                    <dc-qualifier>author</dc-qualifier>

                    <repeatable>true</repeatable>
                    <label>Autor</label>
    <style>col-sm-4</style>
                    <input-type value-pairs-name="autores">dropdown</input-type>
                    <hint>Nombre del autor.</hint>
                    <required>Obligatorio</required>
                </field>
                <field>
                    <dc-schema>dc</dc-schema>
                    <dc-element>contributor</dc-element>
                    <dc-qualifier>author</dc-qualifier>

                    <repeatable>true</repeatable>
                    <label>Autor</label>
    <style>col-sm-4</style>
                    <input-type>onebox</input-type>
                    <hint>Nombre del autor.</hint>
                    <required></required>
                </field>
            </row> 

Everything is OK if I set values for only one of those fields. If I set values for both, the result is that the record only has the values from the onebox field as you can see in the images.figure1.png
figure2.png

Thanks for any help!

Diego

DSpace Technical Support

unread,
Dec 19, 2024, 4:59:52 PM12/19/24
to DSpace Technical Support
Hi Diego,

I don't believe this is currently supported in DSpace at this time.  DSpace assumes that each metadata field (e.g. dc.contributor.author) will only have one form field associated.  Associating multiple fields may cause odd behavior.

That said, maybe someone else on this list has found a way to work around this?

My only immediate thoughts would be to consider storing these values in separate "dc" metadata fields.  Otherwise, it'd likely require custom Java code to create a new type of form field which supports both a dropdown & text entry.

Tim

Diego Brice

unread,
Dec 20, 2024, 4:13:36 AM12/20/24
to DSpace Technical Support
Thanks Tim.
Reply all
Reply to author
Forward
0 new messages