コミュニティアチーブメントバーを展開する。

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

この会話は、活動がないためロックされています。新しい投稿を作成してください。

解決済み

Passing Sling Model property from parent to child parsys component

Avatar

Level 2

Hi all,

as mentioned in the title is it possible to pass a sling model property to a child component dragged in a parsys?

 

I want to call an intensive method only once in the parent and then pass the result to all child components dragged in the page.

 

1 受け入れられたソリューション

Avatar

正解者
Employee Advisor

Do you mean this structure?

 

 component 1 (which contains this intensive computation)
  |-> parsys
    |-> sub component 2 (which

 In this case it is hardly possible, because the parsys does not do that (at least that I am aware of).

 

When I was required to do so always in the context of a request, I used the RequestParameters and stored the result of the computation (and made sure that if the expected key was not present the computation was done again and stored in there).

元の投稿で解決策を見る

3 返信

Avatar

正解者
Employee Advisor

Do you mean this structure?

 

 component 1 (which contains this intensive computation)
  |-> parsys
    |-> sub component 2 (which

 In this case it is hardly possible, because the parsys does not do that (at least that I am aware of).

 

When I was required to do so always in the context of a request, I used the RequestParameters and stored the result of the computation (and made sure that if the expected key was not present the computation was done again and stored in there).

Avatar

Level 2

Exactly, the same structure.

 

Maybe I found a solution which consist in setting the result of the computation in an attribute of the SlingHttpServletRequest

 

request.setAttribute("result", ruleList);
 
Then getting the attribute in the Sling Model of the child component and assigning it to a variable
 
String ruleList = request.getAttribute("result");
Could be a possible solution?

Avatar

Employee Advisor

I used this approach succesfully.