Form Option Datasource error in getItems() | Community
Skip to main content
chandeshj240320
March 25, 2021
Solved

Form Option Datasource error in getItems()

  • March 25, 2021
  • 1 reply
  • 1164 views

Hi all,

 

I'm writing sling model with exporter framework to print JSON formatted output.

While rest all components work fine, there is some issue with form option component extended from core/wcm/components/form/options/v2/options.

I can get the output in Items when using the component with local and list.

But whenever using Datasource with correct datasource value then t throws following error:

 

Failed to include the datasource at weretail/components/form/options/datasource/countriesdatasource
org.apache.sling.api.request.RecursionTooDeepException

 

However same datasource works with normal rendering: http://localhost:4502/content/we-retail/us/en/user/checkout.html?wcmmode=disabled

 

Current code is as shown below, here superSelf.getItems() returns empty in case of datasource while in other case it works fine:


@9944223
public List<OptionItem> getItems() {
return superSelf.getItems();
}

 

Any help in this would be a great relief.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Vijayalakshmi_S

Hi @chandeshj240320,

Can you confirm if you are overriding the options component dialog as well or just the custom implementation for Options Interface. 

1 reply

Vijayalakshmi_S
Vijayalakshmi_SAccepted solution
Level 10
March 25, 2021

Hi @chandeshj240320,

Can you confirm if you are overriding the options component dialog as well or just the custom implementation for Options Interface. 

Vijayalakshmi_S
Level 10
April 12, 2021

Hi @chandeshj240320,

Sorry for the delayed response, I missed this thread. 

Try creating sample datasource within your project code base and try using the same in Options component. 

Also, could you please let know the below

  • Parent class that you are using(superSelf in your snippet)
  • Need for custom implementation for Options component. (all OOTB core component exposes data in JSON format using Sling Model Exporter)