cancel
Showing results for 
Search instead for 
Did you mean: 

RotatingImagesComponent is rendered as SimpleBannerComponent

oscar_san
Explorer
0 Kudos
606

Hi experts

We are using SAP Commerce 2005 with no Spartacus

In the landing page, we have a RotatingImagesComponent that works well in local and QA environments. But we have a problem in PROD, this component ( it has 5 images and some of them have restrictions) sometimes is displayed as a SimpleBannerComponent and only the last image of the carousel is displayed (so it is not displayed as a carousel but a simple image). When this happens I can only see the last image rendered in the HTML. After refreshing the page, the carousel is displayed as it should be.

What can I check in order to see why sometimes only one image is recognized and rendered? I cannot see any relevant information in the logs, and the console in the browser does not show any error when only an image is displayed. I'm not sure how the lifecycle of a component is.

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

oscar_san
Explorer
0 Kudos

The problem was caused because the jsp code was using a nested component, so there was a conflict with the variables. We had a tag with a component, and inside that component we called another tag with another component. So I took the code from the nested component and placed it inside the parent component (insted of calling the tag) and it resolved the issue. Thanks

safin
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Oscar,

For RotatingImagesComponent, it will invoke 'ycommerce:evaluateRestrictions(banner)' for each contained banner component to decide whether or not related banner component is shown (you can refer to rotatingimagescomponent.jsp for detail). On the other hand, 'ycommerce:evaluateRestrictions(banner)' will check attached restrictions to decide returning true or false.

So I think it's possible that some of your attached restrictions result in so called 'random' or 'dynamic' behavior in the RotatingImagesComponent.

For example, i can reproduced your case in my local environments by these steps

  • Develop a new sub type for AbstractRestriction type
  • Develop a corresponding implementation class for CMSRestrictionEvaluator interface, adding some random behavior in the implementation class, for example return true or false in the evaluate() method by using random number
  • Create and insert a new RotatingImagesComponent in the homepage, which contain two banner component, the first one will be attached with this new created restriction

Anyway, I suggest to check whether or not these restrictions contain some dynamic behavior.

Thanks

oscar_san
Explorer
0 Kudos

Hi. This behaviour happens even with no restrictions, so unfortunately this is not the way, thanks for the idea anyway 🙂