Dev at weitling napisaĆ(a):
No, sorry, it's a bit difficult to explain. The web site shall contain a
table like structure. From left to right the columns represent different
languages. From top to bottom there's first a row containing a question
followed by one or more answers. If the user removes/adds/reorders the
languages this should be done for the questions as well as for the
answers, meaning the language order of the question list has to be the
same as that of the answers (which are - to make it worse - put it a
nested list, too).
The simplified structure:
question object (Q) containing
- a list of question languages (QL)
- a list of localized question texts (QD)
- a list of answer objects (A) containing each
- a list of localized answer texts (AD)
I think that I understand your case but I don't know where is the problem. It's quite complicated situation for binding
and runtime of a form but CForms are able to manage it, surely.
I guess that you will need to write your own binding or on-change handlers (or
both) but they will not be much troublesome.
First, you must realize that you are dealing with semi-three-dimensional table. One dimension is number of languages,
second is number of question-anwsers sets and third is number of answers. Since rendering three-dimensional tables is
rather tricky you will need... five repeaters ;-)
QL must be simple repeater with on-change handler that updates questions and answers repeaters according to the changes
performed on QL by user. Next, you will need question+answers repeater that holds as row pair of question and answers.
Question is just simple repeater that have a row for each language (rendered as column, though). Answers is repeater
that have a row for each answer. Answer, similarly to the question, is repeater that holds answer for each language.
Yeah, rendering five repeaters in HTML nicely will demand some of your own rendering by is doable. Hope that this helps
a little. If not, explain what is exact problem, please.
- How to do it when I have a HashMap (key -> data) and I want to display
the keys as well as their data?
Can you give more details... doesn't the binding already have to know
the key to get at the value?
Besides Cocoon & Co. I can let me show the list of keys and after look
up with ech key its value.
You should use @name (or child:name) path for accessing key and "." for
accessing value as explained here:
http://jakarta.apache.org/commons/jxpath/users-guide.html#Map_Element_Access
--
Grzegorz Kossakowski
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]