gavinbaumanis
06/02/2022, 4:32 PManswerStr = {
"Value" = "Value-1",
"Description" = "Description-1"
};
questionsStruct["Q1"] = answerStr;
answerStr = {
"Value" = "Value-2",
"Description" = "Description-2"
};
questionsStruct["Q2"] = answerStr;
Now I want the following outcome in my table
<tr>
<td>Q1</td>
<td>Value-1</td>
<td>Description-1</td>
</tr>
<tr>
<td>Q2</td>
<td>Value-2</td>
<td>Description-2</td>
</tr>
I have tried with the following (and so many other flavours....
DOT notaion
Square Brackets without DOTS / with DOTS / with Quotes / without Quotes...
I just can't seem to get it to output the actual contents of the structs
I can get the contents of the TD cell to look like the string literal; aQuestion.Q1.Value
- but not what it should evaluate to....
I tried wrapping the contents in DE()
, I tried saveContent()
....
i=0;
cfloop(collection=questionsStruct item="aQuestion"){
i++;
writeOutput('
<tr>
<td>Q#i#</td>
<td>aQuestion.Q#i#.#Value#</td>
<td>Q#i#.Description</td>
</tr>
');
}
Anyway - if someone wouldn't mind helping me out - I'd really appreciate it!zackster
06/02/2022, 4:54 PMzackster
06/02/2022, 4:55 PMseancorfield
Sathish
06/02/2022, 5:13 PMAdam Cameron
seancorfield
gavinbaumanis
06/03/2022, 12:14 AM