on 07-18-2019 4:06 PM
A component have a list of other components inside, like brandsCarouselComponent with brandItem list inside. If we change an attribute of brandItem from smartedit, brandsCarouselComponent does not recognize the change and its not posible to sync or clone all the component.
<relation code="BenefitItemForBenefitsComponent" generate="true" localized="false" autocreate="true">
<sourceElement qualifier="benefitItems" type="BenefitElementComponent" cardinality="many" collectiontype="list">
<modifiers read="true" write="true" search="true" optional="true" partof="true"/>
</sourceElement>
<targetElement qualifier="benefitsComponent" type="BenefitsComponent" cardinality="one">
<modifiers read="true" write="true" search="true" optional="true" />
</targetElement>
</relation>
Also it's needed to set the following line in local.properties:
relation.BenefitItemForBenefitsComponent.markmodified=true
Before this configuration, in v1905 when child component attribute changes (smartedit) it is not neccesary to change any parent attribute. <bean id="accCmsModelCloningContextPartOfPredicates"
depends-on="cmsModelCloningContextPartOfPredicates" parent="listMergeDirective">
<property name="add" ref="cmsBenefitsComponentForBenefitElementComponentPredicate" />
</bean>
<alias name="defaultBenefitsComponentForBenefitElementComponentPredicate" alias="cmsBenefitsComponentForBenefitElementComponentPredicate" />
<bean id="defaultBenefitsComponentForBenefitElementComponentPredicate" />
Bean code:
public class BenefitsComponentForBenefitElementComponentPredicate implements BiPredicate<ItemModel, String>
{
private static final Logger LOG = Logger.getLogger(BenefitsComponentForBenefitElementComponentPredicate.class);
@Override
public boolean test(final ItemModel component, final String qualifier)
{
final boolean treatAsPartOf = (component instanceof BenefitsComponentModel)
&& qualifier.equals(BenefitsComponentModel.BENEFITITEMS);
if (treatAsPartOf)
{
LOG.debug("Should treatAsPartOf for : " + component.getItemtype() + " - " + qualifier);
}
return treatAsPartOf;
}
}
For more information visit: https://help.sap.com/viewer/86dd1373053a4c2da8f9885cc9fbe55d/1811/en-US/95e7d463fe704627a153685ff6a5...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Another issue too is the caché, it kind of component does not work fine with a list of components inside.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.