Javascript Field

30 views
Skip to first unread message

Sandra Díaz Hergueta

unread,
Jan 17, 2024, 10:30:12 AM1/17/24
to Magnolia User Mailing List
Hi, 

Has anyone ever used a javascript field inside a switchable field inside a jcrmultifield?

It returns a casting error and I don't know if anyone has managed to do it before or just this case is not covered.

Thank you very much,

Best regards

class info.magnolia.ui.editor.SwitchableFormView cannot be cast to class info.magnolia.ui.editor.FormView (info.magnolia.ui.editor.SwitchableFormView and info.magnolia.ui.editor.FormView are in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @3fcee220)

Roman Kovařík

unread,
Jan 18, 2024, 2:16:41 AM1/18/24
to Magnolia User Mailing List, sandra-dia...@rentokil-initial.com
Hey,

Could you share the complete stacktrace and the YAML configuration? If the ClassCastException occurs directly in the JavaScript field module, it's likely an uncovered use case, as you mentioned. 

Regards,
Roman

Sandra Díaz Hergueta

unread,
Jan 18, 2024, 3:15:11 AM1/18/24
to Magnolia User Mailing List, Roman Kovařík, sandra-dia...@rentokil-initial.com

Yeah, for sure

Maybe Im doing something wrong, just let me know. 

Thank you in advance!

Regards

products-app.yaml
Javascript Field Error

Roman Kovařík

unread,
Jan 18, 2024, 4:17:17 AM1/18/24
to Magnolia User Mailing List, sandra-dia...@rentokil-initial.com, Roman Kovařík
Looking at this code FormFieldsExtractor.java, it always expects the multifield to hold FormViews. Maybe wrapping the switchableField into a compositeField would work as a workaround.

Hope that helps, Roman

Sandra Díaz Hergueta

unread,
Jan 18, 2024, 4:45:54 AM1/18/24
to Magnolia User Mailing List, Roman Kovařík, sandra-dia...@rentokil-initial.com
It works with the wrapper! Thanks you so much!
Reply all
Reply to author
Forward
0 new messages