Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

is it possible to travel upward in data binding? like $.parent.parent.data?

Avatar

Level 1

hi there,

I'd like to ask a question that is it possible to travel upward in data binding? like $.parent.data?

we have xml like below


<level1>


     <name>Name</name>


     <level2>


          <data>Data</data>


     </level2>


</level1>



and in XDP, we have subfrom already bind to <level2>   $.level1.level2, but then could we access name inside it? and how?


<subfrom bind = "$.level1.level2">


     <textfield bind = "----$.??????.name----"> </textfield>


     <textfield bind = "$.data"> </textfield>


</subfrom>



thanks in advance,

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

The only trick to this is having to type in the binding expression and not use the data connection picker next to the Data Binding field.

Here's a sample https://sites.google.com/site/livecycledesignercookbooks/home/BindToParent.xdp?attredirects=0&d=1 and the data https://sites.google.com/site/livecycledesignercookbooks/home/BindToParent.data.xml?attredirects=0&d...

I've tested this on 10.0.2 so would be surprised if it is a version issue, but maybe I misunderstood the problem.

Bruce

View solution in original post

4 Replies

Avatar

Level 10

Hi,

The $.parent.name will work, you'll get a warning message "Data binding value '$.parent.name' does nor correspond to a data connection", but still picks up the correct value.

Bruce

Avatar

Level 1

hi Bruce

Thanks for the response, it should be a good solution, but I can not get it work yet...
does this need some document setting to work? or is related to software version?


I am using Designer to preview,  v11.0.1.20130830.1.901444, seems it is an out of dated version.

Avatar

Correct answer by
Level 10

Hi,

The only trick to this is having to type in the binding expression and not use the data connection picker next to the Data Binding field.

Here's a sample https://sites.google.com/site/livecycledesignercookbooks/home/BindToParent.xdp?attredirects=0&d=1 and the data https://sites.google.com/site/livecycledesignercookbooks/home/BindToParent.data.xml?attredirects=0&d...

I've tested this on 10.0.2 so would be surprised if it is a version issue, but maybe I misunderstood the problem.

Bruce

Avatar

Level 1

hi Bruce

Thanks a lot for your kindly help

the example helped me to revel the secret. a document setting is affecting the behavior. Form properties ->  Defaults ->  Choose target version,  it is set to 9.1+ in your sample XDP, but set to 10+ by default in mine.

this perfectly solved my case, and I surely could not find this secret without your help

Thanks again:) wish you a good day.

Regards

Wu, Xin

DocumentSetting.PNG