Function for each, in a html page.

Function for each, in a html page.


I have a code to enter all data "Model" on my subforms, but when I run the code me 5 data appear, all for the first record of my subform. I wish it were 5 data, the 5 Records in my subform.




htmlpage Verificador_de_Correos_SP(recId)
displayname = "Verificador de Correos SP"
content
<%{
    x = 0;
    if ((input.recId  !=  null)  &&  (input.recId  !=  ""))
    {
        orderRow  =  Ordenes  [ID == input.recId.toLong()];
        output2 = "";
        output3 = "";
        imagen = "";
        output = "";
        Foto2 = "";
        Link = "";
        foto = 0;
        comisiones = 0;
        comisiones_mes = 0;
        ventas = 0;
        ventas_mes = 0;
        n_Ventas = 0;
        n_Ventas_mes = 0;
        n_activos = 0;
        publicaciones_nuevas = 0;
        for each entry in input.orderRow.Registro_Mercancia
        {
            output = output + orderRow.Registro_Mercancia.Modelo + "<br>";
        }
    }