Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

Multifield in content fragment

Avatar

Level 1

i need two types of fields in multified in CF, tried creating a multifield  component and linked to cf, in cf i can see multified but value are not storing after second field

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Your question is not clear, but let's assume that you are trying to add a multifield feature to the "date and time" CF model component.

Before you start coding or anything, you'd need to do some investigation. Create a new CF model, and then author a "Single line text", out of the box CF model component, into your content fragment model... save it, and create a new CF. Edit the CF to include a single line of text. Next, take a careful look at the node structure in CRX/DE.
Moving next, go back into the CF model, and update the "render as" to "render as multi-field". Head back into your CF and add some some text using the multi-field UI. Immediately take a look at the CRX/DE; Take note of how additional nodes are generated when "render as multi-field" is selected. 

If you wish to enable date and time with "render as multi-field", you'd need to somehow work your magic to have the same node structure as the "Single line text" CF model component, "render as multi-field".

View solution in original post

3 Replies

Avatar

Level 3

Hey @satishpothabathula ,

I am having a little hard time understanding the problem statement. Can you explain a bit more with screenshots?

Avatar

Community Advisor

Hello @satishpothabathula -

 

  • Confirm that the CF definition allows for the inclusion of multiple instances of the field. In the Content Fragment Models console, check the field's definition to ensure the cq:isMultiple property is set to true.
  • Make sure the data structure of the field in the multifield component matches the structure expected by the CF. Ensure that the field names and data types match between the multifield component and the CF definition.

 

If you have custom code or a custom submit handler, review the code responsible for processing and persisting the form data?

 

Regards,

Tanika

 

Avatar

Correct answer by
Community Advisor

Your question is not clear, but let's assume that you are trying to add a multifield feature to the "date and time" CF model component.

Before you start coding or anything, you'd need to do some investigation. Create a new CF model, and then author a "Single line text", out of the box CF model component, into your content fragment model... save it, and create a new CF. Edit the CF to include a single line of text. Next, take a careful look at the node structure in CRX/DE.
Moving next, go back into the CF model, and update the "render as" to "render as multi-field". Head back into your CF and add some some text using the multi-field UI. Immediately take a look at the CRX/DE; Take note of how additional nodes are generated when "render as multi-field" is selected. 

If you wish to enable date and time with "render as multi-field", you'd need to somehow work your magic to have the same node structure as the "Single line text" CF model component, "render as multi-field".