cancel
Showing results for 
Search instead for 
Did you mean: 

Smartedit refresh frontend components

phoude
Participant

I have components that are mostly render its content via Javascript code. The component initially looks fine in SmartEdit when the page is loaded. However, when the component is edited, it is no longer able to render itself. I think SmartEdit reloads the component from the backend but is not capable of rendering the component when it heavily relies on client-side code. There must be some kind of event (I hope) that I can intercept after a component is refreshed so I can trigger the client-side rendering of my component.

I am using SAP Commerce 2211 with accelarator storefront.

Accepted Solutions (1)

Accepted Solutions (1)

adamreisberg
Active Participant
0 Kudos

Hi phoude

Please reference the following two links in order to achieve what you are attempting to do:

  1. Rerendering Components and Content Slots After Editing | SAP Help Portal
  2. Adding reprocessPage Logic in SAP Accelerator Storefronts | SAP Help Portal
phoude
Participant
0 Kudos

It is working but it is not...

1) According to the documentation, if I make a modification to a component, the componentId should have the id of that component and parentId should be the id of the content slot. However, each time I modify a component, I get the componentId of the contentSlot and parentId is null.

I have done this very simple code to check it out.

window.smartedit.renderComponent = function(a,b,c) { console.log(a); console.log(b); console.log(c); }

2) I also tested the addOnReprocessPageListener and it appears this is being called twice every time I modify a component.

window.smartedit.addOnReprocessPageListener(function () {console.log('page reprocessed')});
adamreisberg
Active Participant
0 Kudos

Hi phoude

Unfortunately, I don't have further troubleshooting steps beyond what I posted.

Answers (0)