Your .script file should look something like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script PUBLIC "-//Apache Software Foundation//Tapestry Script Specification 3.0//EN" "http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd";>
<script>
   <input-symbol key="questionList" class="java.util.List" required="yes"/>
   <let key="question"></let>
   <let key="index"></let>
   <body>
       <foreach expression="questionList" key="question" index="index">
           mc_questions[${index}] = "${question.label}";
       </foreach>
   </body>
</script>

Paul

Henrik wrote:

Hi

I have an object that contains a java.util.List of Question objects. I want to generate an array that is of the size of the question list, and that is populated with questions. I cannot figure out how to do this in a Tapestry script.


I want the end result in the client browser to be like this:

mc_questions[0] = "Question 1";
mc_questions[1] = "Question 2";
mc_questions[2] = "Question 3";

Can anybody help me?

Regards,
Henrik


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to