Highlighted

XML data binding, filter data

Avatar

25-06-2008

Hello,<br /><br />I was able to create a dynamic form that displays all elements with a certain tagname into a table (inside a 'flowing' subform). But now I want to display not ALL, but a selection (e.g. all <book> elements with an attribute author = jim). How to specify this in the 'Default Binding' field of the Binding tab of my text-field?<br /><br />regards,<br />Peter, Belgium

Replies

Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

25-06-2008

The attribute becomes a node inside our our heirarchy so you should be able to do it the same way.
Highlighted

Avatar

25-06-2008

Hi, thank you for your answer. In the 'Default Binding' field on the 'Binding' tab of my textfield I have now: $record.book[*].title. Due to the fact that the field is inside a table with dynamic rows, I get a list of all book-titles. This is fine. But now I don't want the complete list, but only a selection of it, based on an attribute of the book-element. What should I write in the 'Default Binding' field? I thought I could use something like '$record.book[author=xxx].title' but this does not work.



All help appreciated!
Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

27-06-2008

I have been working on this and cannot get it to work the way you wan, but I have another idea. Why not let it bind as normal then on the docReady event of the field test its rawValue. If it is not want you want remove the subform instance. This is not as noice as solution as yours but it should work.