Main Content

Magnolia Community Forums: Development: Using RichText in MultiValueField Issue


  • jennylyn
    jennylyn
    Full name: Jennylyn Sze
    Posts: 21
    Last post: May 9, 2016 4:16:27 PM
    Registered on: Mar 15, 2016
    Using RichText in MultiValueField Issue
    #1 by jennylyn on Mar 16, 2016 7:24:50 AM

    I use a RichTextFieldDefinition as one of the fields in the MultiValueFieldDefinition. If I click to change the display order, one of rich text will just disappear. Same thing happen when I delete a multivaluefield, then the other multivalue field rich text will be affected and gone also. Seems like it only happens to rich text field.

    Seems like a bug, not sure if this is a known issue?

    Any fix?

  • srood
    srood
    Full name: Simon
    Posts: 57
    Last post: Sep 14, 2016 10:37:35 AM
    Registered on: Oct 12, 2015
    Re: Using RichText in MultiValueField Issue
    #2 by srood on Mar 16, 2016 2:29:22 PM

    Can you show me the code you built this op with, and the version of Magnolia you are using?
    I can't reproduce this issue in magnolia 5.4.

  • jennylyn
    jennylyn
    Full name: Jennylyn Sze
    Posts: 21
    Last post: May 9, 2016 4:16:27 PM
    Registered on: Mar 15, 2016
    Re: Using RichText in MultiValueField Issue
    #3 by jennylyn on Mar 17, 2016 3:07:05 AM

    I'm using magnolia 5.4.5.
    I forgot to mention that I'm using a composite field.
    Although I tried to using only richtext as the field in the MultiValue but still have the same error.

    Try to add more than one rich text, then click the up down button to change the order of the rich text, then you'll see that one of the rich text is missing.

    Here's the code:


    tabs:
    - name: tncInfo
    label: T&Cs
    fields:
    - name: tnc
    class: info.magnolia.ui.form.field.definition.MultiValueFieldDefinition
    transformerClass: info.magnolia.ui.form.field.transformer.multi.MultiValueSubChildrenNodePropertiesTransformer
    label: Terms and Conditions
    field:
    name: compositeField
    class: info.magnolia.ui.form.field.definition.CompositeFieldDefinition
    description: Terms and Conditions
    layout: vertical
    fields:
    title:
    class: info.magnolia.ui.form.field.definition.TextFieldDefinition
    label: Title
    type: String
    content:
    class: info.magnolia.ui.form.field.definition.RichTextFieldDefinition
    height: 200
    label: Content
    type: String



    Thanks :)

  • srood
    srood
    Full name: Simon
    Posts: 57
    Last post: Sep 14, 2016 10:37:35 AM
    Registered on: Oct 12, 2015
    Re: Using RichText in MultiValueField Issue
    #4 by srood on Mar 17, 2016 11:25:55 AM

    Composite fields in multivaluefields are kind of an issue.
    You probably need a noopcomposite transformerclass on your composite field.
    I wrote up a solution on this page:
    https://documentation.magnolia-cms.com/display/DOCS/Transforming+field+values?focusedCommentId=114728444#comment-114728444

    Hope this helps :)

  • pbaerfuss
    pbaerfuss
    Full name: Philipp Bärfuss
    Posts: 266
    Last post: Mar 23, 2016 3:57:59 PM
    Registered on: Nov 3, 2010
    Re: Using RichText in MultiValueField Issue
    #5 by pbaerfuss on Mar 18, 2016 11:15:13 AM

    An alternative to very complex forms with composite and multi value fields is it to use multiple content types in an app. For instance an item 'company' can have sub items employees. Each item has then its own form. It is more work to setup the actions but it allows to build rather complex item trees without confusing the users to much.

    Have a nice day!

    Philipp

  • dmarquez
    dmarquez
    Full name: David Caviedes Marquez
    Posts: 2
    Last post: May 4, 2017 11:45:25 AM
    Re: Using RichText in MultiValueField Issue
    #6 by dmarquez on May 4, 2017 11:42:01 AM

    Hi all,

    I have the same issue, @jennylyn how did you solve it?

    @srood I am using NoOpCompositeTransformer in composite field but the error continues. Here is my dialog component properties file:

    form:
    tabs:
    - name: tabMain
    fields:
    - name: title
    class: info.magnolia.ui.form.field.definition.TextFieldDefinition
    i18n: true
    required: true
    - name: background
    required: true
    class: info.magnolia.ui.form.field.definition.LinkFieldDefinition
    targetWorkspace: dam
    appName: assets
    identifierToPathConverter:
    class: info.magnolia.ui.form.field.converter.BaseIdentifierToPathConverter
    contentPreviewDefinition:
    contentPreviewClass: info.magnolia.dam.app.ui.field.DamFilePreviewComponent

    - name: elements
    class: info.magnolia.ui.form.field.definition.MultiValueFieldDefinition
    transformerClass: info.magnolia.ui.form.field.transformer.multi.MultiValueSubChildrenNodePropertiesTransformer
    required: true
    field:
    name: compositeField
    class: info.magnolia.ui.form.field.definition.CompositeFieldDefinition
    transformerClass: info.magnolia.ui.form.field.transformer.composite.NoOpCompositeTransformer
    layout: vertical
    fields:
    - name: question
    class: info.magnolia.ui.form.field.definition.RichTextFieldDefinition
    i18n: true
    - name: answer
    class: info.magnolia.ui.form.field.definition.RichTextFieldDefinition
    i18n: true
    - name: separator
    class: info.magnolia.ui.form.field.definition.StaticFieldDefinition
    - name: anchor
    class: info.magnolia.ui.form.field.definition.TextFieldDefinition
    i18n: true
    defaultValue: faqs
    actions:
    commit:
    class: info.magnolia.ui.admincentral.dialog.action.SaveDialogActionDefinition
    cancel:
    class: info.magnolia.ui.admincentral.dialog.action.CancelDialogActionDefinition

    Cheers

You don't have the permission to post on this thread

Sign in

To login on this forum, you can use your Magnolia Forge, Support or Partner account, or, below, your Google, Yahoo! or OpenID account. If you have trouble logging in, or any other sort of issue, please let us know in the Meta forum, on the user-list, or simply by email at forum-admin at magnolia-cms dot com.

* Required

... or sign in with:

  • icon http://{your-openid-url}
  • icon
  • icon https://me.yahoo.com/