Forum OpenACS Q&A: Xowiki FormPages

Collapse
Posted by Richard Hamilton on
I am in the process of designing a data entry form specification for an Xowiki.FormPage and I have a question about how to implement one to many relationships.

To illustrate, suppose you wanted to have an Xowiki.FormPage for each of three towns:

London
Wein
New York

The main formpage has a name field, a description field, and a hotels field.

You want to allow users to add hotels to this field. You want them to add hotels using a different, hotel specific Xowiki.Formpage, but you want these hotels to be linked to the parent page (i.e. London). When rendered the London formpage should show name, description, and a list of child hotel pages in the hotels field.

Can this be done presently with Xowiki?

Regards
Richard

Collapse
2: Re: Xowiki FormPages (response to 1)
Posted by Richard Hamilton on
Just to clarify, from the formspec section of the Xowiki docs:

"The form-field class form_page allows to fill fields with instances of certain forms. One can e.g. define a form "Person" with a few form instance pages. The form field will list the possible values for selection."

I understand this to mean that all instances of 'Person' in this xowiki would be displayed in the form_page field, and I see that there is the facility to add a 'where' clause.

But what I am not clear on is how to make this 'where' clause say effectively "where instances of 'Person' are child objects of this xowiki.FormPage instance.

Regards & thanks,
Richard