The after edit works fine and it refreshes the page after edit , but the before edit isnt working as expected . I have multiple components on the page and the new component should read a value from previous created component on the page .. I am trying to pick a value from last created component and use it in the newly created component. Am i missing something which is causing the beforeedit to fail , or is there any other way to achieve this?
We had the same use case regarding the multifield. if you want to do it with the component-wise. then it would be difficult for you.
- if you want to use the last component content into the newly created then you will have to use the last authored component classes or if want to use custom class then granite:class on the field level would work.
- once you get the classes, use these classes to write a custom js.
- your component values are saved in DOM, now use js function queryselector OR queryselectorall and fetch those properties and set it to the new component.
- logic may vary with the use case.
This weekend we are coming with an article for this.