[DOCU-2164] JSON multi field not working Created: 16/Apr/21  Updated: 28/Apr/21  Resolved: 28/Apr/21

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Simon Siefke Assignee: Ashraf Khamis
Resolution: Done Votes: 0
Labels: external
Remaining Estimate: Not Specified
Time Spent: 0.1h
Original Estimate: Not Specified

Attachments: PNG File magnolia-exception.png    
Documentation page URL: https://docs.magnolia-cms.com/product-docs/Templating/Dialog-definition/Field-definition/List-of-fields/Composite-field.html

 Description   

I'm trying to use the json multi fields from the docs (https://docs.magnolia-cms.com/product-docs/Templating/Dialog-definition/Field-definition/List-of-fields/Multi-field.html#_json_multi_field) however I am getting an error and I think there might be an issue with the example

 
This is the code i am using for a dialog

 

label: Test
form:  
  properties:     
    - name: stationboard
      label: Station Board
      $type: jsonMultiField
      field:         
        $type: jsonCompositeField
        idPropertyName: name
        properties:           
          name:             
            label: name
            $type: textField
          to:             
            label: to
            $type: textField

When trying to create a component by
1. Clicking on "New Content Component"
2. Then selecting the "Test" component
3. Then clicking "Next"
magnolia shows an exception:

 

RpcInvocationException: Unable to invoke method click in com.vaadin.shared.ui.button.ButtonServerRpc
 caused by InvocationTargetException
 caused by MethodException: Invocation of method buttonClick in info.magnolia.ui.dialog.ActionButton$$Lambda$1651/0x0000000840f71840 failed.
 caused by RuntimeException: info.magnolia.ui.api.action.ActionExecutionException: Action execution failed for action: commit
 caused by ActionExecutionException: Action execution failed for action: commit
 caused by NullPointerException

Additional Information:

  • Edition: Community Edition
  • Magnolia Version: 6.2.7
  • Java Version: Ubuntu 11.0.10 (build 11.0.10+9-Ubuntu-0ubuntu1.20.04)


 Comments   
Comment by Ashraf Khamis [ 28/Apr/21 ]

Hi Simon,

There's nothing wrong with the example. Both jsonMultiField and jsonCompositeField can only be used in an app with its own JSON data source. Otherwise, the fields won't know to which external service they should link. See also App descriptor.

I updated the description for multi and composite fields to make this clearer.

Best regards,

Ashraf

Generated at Mon Feb 12 01:24:37 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.