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

Wu_Xin

21-03-2016

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,

Accepted Solutions (1)

Accepted Solutions (1)

_Bruce_Robertson

MVP

28-03-2016

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

Answers (3)

Answers (3)

Wu_Xin

28-03-2016

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

Wu_Xin

27-03-2016

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.

_Bruce_Robertson

MVP

24-03-2016

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