Hi all,
I am having a hard time figuring out how to do the following:
I have :
Question {
id
text
}
Answer {
id
questionId
text
}
A question can have multiple answers.
When editing a question, I'd like to show the list of possible answers
that has been added to the Question and allow the user to add more
answers on that same page.
I have been able to create a ViewQuestion element that shows the
question and possible answers using ContentQueryManager's for
Question and Answer and a primitive template that shows the Question
and the array of answers for it.
I have two questions:
1) Is it possible to somehow "augment" the nice data form that is
generated by CRUD for the Question bean and add the Answer listing to
it ? Using CRUD, and the MetaData for Question generates a nice
data entry form for question. Looking at CustomMenu code of one of
the examples I see that one can get a handle to one of the CRUD
generated forms using something like:
mElement.getSite().resolveId(".Admin.question.EDIT")
If answer is no to above and I have to role my own data entry form for
Question+Answers then :
When I use:
template.setBean(question);
template.appendBlock("thequestion","question");
I have to add individual FORM:INPUT fields for the Question bean to my
template. Is there a way to auto-generate a FORM for all the fields
in the Question bean ?
also appreciate suggestions on how to create this sort of Parent/Child
relationship. So far I have been able to limp along by looking at the
simple-blog code on newsItem and newsComments that have sort of same
relationship.
J.
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users