Magnolia Collapsible composite field with multivalue allows me to save but cannot reopen when editing - content-management-system

I have a not too complex form that is a Multivalue of a composite field and within that composite field there is a title and then a collapsible composite field with several fields below.
The tree looks like this:
- tab
- composite
- title
- collapsible composite
- field 1
- field 2
- ...
I'm doing it like this because there are too many fields and ordering them with all the fields open can be a pain, so the idea is to have a composite field with a title and a collapsible composite field so that I can collapse all the fields but have the title still shown.
This works fine, I can add things, reorder, collapse and everything saves correctly.
However, after saving, when I try to edit my component, I have the following error:
Caused by: java.lang.ClassCastException: info.magnolia.editor.app.field.CollapsibleCompositeFieldDefinition$$EnhancerByCGLIB$$ea3bb8e3 cannot be cast to info.magnolia.ui.form.field.definition.MultiValueFieldDefinition
And here's my code (only the interesting part).
- name: tabTiles
label: Tiles
fields:
- name: tiles
label: Tiles
i18n: true
class: info.magnolia.ui.form.field.definition.MultiValueFieldDefinition
transformerClass: info.magnolia.ui.form.field.transformer.multi.MultiValueSubChildrenNodePropertiesTransformer
field:
name: linksCompositeField
class: info.magnolia.ui.form.field.definition.CompositeFieldDefinition
transformerClass: info.magnolia.ui.form.field.transformer.composite.NoOpCompositeTransformer
label: Collapse
layout: vertical
fields:
- name: title
label: Tile title
class: info.magnolia.ui.form.field.definition.TextFieldDefinition
- name: linksCompositeField
class: info.magnolia.editor.app.field.CollapsibleCompositeFieldDefinition
transformerClass: info.magnolia.ui.form.field.transformer.composite.NoOpCompositeTransformer
label: Collapse
fields:
- name: icon
class: info.magnolia.ui.form.field.definition.LinkFieldDefinition
targetWorkspace: dam
appName: assets
required: true
label: Select image
identifierToPathConverter:
class: info.magnolia.dam.app.assets.field.translator.AssetCompositeIdKeyTranslator
contentPreviewDefinition:
contentPreviewClass: info.magnolia.dam.app.ui.field.DamFilePreviewComponent
- name: text
label: Tile text
class: info.magnolia.ui.form.field.definition.RichTextFieldDefinition
- name: information
class: info.magnolia.ui.form.field.definition.StaticFieldDefinition
label: Link
value: ''
- name: linkText
label: Link text
class: info.magnolia.ui.form.field.definition.TextFieldDefinition
- name: link
label: Link
class: info.magnolia.ui.form.field.definition.LinkFieldDefinition
targetWorkspace: website
appName: pages
- !include:/foundation-components/dialogs/include/linkTargetSelectField.yaml
- name: linkTitle
label: Link title
class: info.magnolia.ui.form.field.definition.TextFieldDefinition
Any help much appreciated.

Ok, it was frustrating but my composite fields both have the same names... hence the error.

Related

How to implement subtitle in sap.ui.core.message.Message of semantic page?

Demo of sap.m.MessagePopover
Demo of sap.m.semantic.MessagesIndicator
API of MessageManager
In MessagesIndicator of semantic page, it use sap.ui.core.message.Message to add message, but there is no subtitle property in sap.ui.core.message.Message.
In MessagePopover, it use MessagePopoverItem / MessageItem with subtitle.
So it seems if I want to use subtitle, my only choice is use MessagePopover with MessageItem.
I try to use semantic:customFooterContent to show message indicator:
<semantic:customFooterContent>
<OverflowToolbarButton icon="sap-icon://message-popup" text="Settings" press="onShowMessageIndicator"/>
</semantic:customFooterContent>
But semantic:customFooterContent button is in the right footer of semantic page, and I need it in the left footer, just like <semantic:messagesIndicator>. Any idea? I don't want to change semantic page to m.page.
Working Demo
Thanks to #AndriiNaumovych, I forgot to add {message>additionalText} in the MessageItem template.
(Changed MessagePopoverItem to MessageItem, because MessagePopoverItem is
deprecated since version 1.46)
template:
new MessagePopover({
items: {
path: "message>/",
template: new MessageItem({
description: "{message>description}",
subtitle: "{message>additionalText}",
type: "{message>type}",
title: "{message>message}"
})
}
});
Corresponding Messageļ¼š
new sap.ui.core.message.Message({
additionalText: "myAdditionalText",
description: "myDescription",
message: "Something wrong happened",
type: sap.ui.core.MessageType.Error,
processor: oMessageProcessor
})

How do I change Add button & Search labels in list view in EasyAdmin

How do I change Search & Add labels in List view ?
To change label for search and new action button on list, add this in the configuration file.
list:
actions:
- { name: 'search', label: 'My Search'}
- { name: 'new', label: 'My New action'}

Autoform bootstrap themes

I'm using aldeed's autoform, simpleschema and collection2. I am looking to change the way the radio buttons / check boxes look. I've read through the documentation but am unable to find how to incorporate different ways how the buttons are visually rendered. On the GIT issue page, I read through how to implement custom class in the schema itself. Example:
"type":{
type: String,
autoform:{
type: "select-radio-inline",
class: "radio-primary",
options: function(){
return [
{label: "Well Known", value: "well-known"},
{label: "Basic", value: "basic"},
{label: "Extended", value: "extended"}
];
},
But somehow it does not change the look of the default radio buttons. Is there a workaround for this?

Radio buttons acts as Check-box in TinyMce 4

Here's the fiddle, the type is radio but acts like check-box
{type: 'radio', name: 'letter', label: 'Letter'},
{type: 'radio', name: 'custom', label: 'Custom'},
I tried using them under one name that didn't work out, and my 2nd question: how to make one of them as default(as selected).
Keep Smiling :)
It seems like the tinymce/ui/Radio class is not implemented yet. It act like a tinymce/ui/Checkbox.
You can use the tinymce/ui/ListBox class as a workaround.
for the 2nd question: {type: 'radio', name: 'a', label: 'Letter', checked:'checked'}
Radio - not implemented yet
See message here: https://github.com/tinymce/tinymce/blob/ca0f454b9001b9f20aa26349b25f6d839c1a1146/js/tinymce/skins/lightgray/Radio.less
and almost empty class Radio.js
https://github.com/tinymce/tinymce/blob/0ab3af181284a060683b566d50e81381cc6445a9/js/tinymce/classes/ui/Radio.js

ExtJs 4 dynamic form fields in nested panels aren't submitted

Let's say I have multiple nested panels (plain ones, not form.Panel) containing form fields.
The user can copy such a panel and its fields to a different panel.
I somehow need to add those newly created fields to a main formpanel so they get submitted, but don't know how.
I can't do
formpanel.add(fields)
because then they're rendered to the formpanel's body and not the panel they were in in the first place. Setting the fields' renderTo property doesn't help either.
So basically I need a way of adding a field to a normal panel (or any other component for that matter), but also adding it to a specific formpanel so its values are submitted on form submit.
Has anyone done this or could at least point me in the right direction?
You can wrap all your panels inside one form panel and all the fields inside will be submitted. I did this way with accordeons, tabpanel and normal panels deeply nested inside each other. Example:
var form = Ext.create('Ext.form.Panel', {
// form attributes goes here...
// ...
initComponent: function(){
// all your panels goes here.
this.items = [
{
xtype:'panel',
title: 'First panel',
layout: 'anchor',
frame: true,
defaults: {anchor: '100%'},
items: [
{xtype:'textfield', name: 'foo',fieldLabel: 'Foo'},
{xtype:'textfield', name: 'foo',fieldLabel: 'Bar'}
]
},
{
xtype:'panel',
title: 'Second panel',
layout: 'anchor',
frame: true,
defaults: {anchor: '100%'},
items: [
{xtype:'textfield', name: 'baz',fieldLabel: 'Baz'},
{
xtype: 'panel',
items: [/* another set of fields */]
}
]
},
];
this.buttons = [/* ... your buttons here ...*/];
this.callParent(arguments);
}
});