velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Heine <Hellhound...@web.de>
Subject Inner loops in Velocity?
Date Wed, 04 Dec 2002 08:59:31 GMT
Christian Heine <Hellhound_01@gmx.de> schrieb am 03.12.02 16:38:35:
> Hi all,
> 
> i've tryed to develop a Velocity-Portlet to request information from a
> database. From the database i read out different informations in differend
> requests. My task is to develop a data tree like the Explorer, and at this point i
> have the following problem:
> 
> At first i read out the main informations (Project datas) which i present in
> a HTML-Table by an foreach-Loop. One of these Projects could be selected, is
> this true, i must insert at this positon another loop to represent possible
> subdatas like in this way :
> 
> #set($projects = $dbRequest.getProjects())
> #set($sproject = $dbRequest.getSelectetProject())
> 
> #if(!$sproject)
>        $dbRequest.setSelectedproject($projets.get(0))
>        #set($sproject = $dbRequet.getSelectedProject())
> #end
> 
> <table>
> #foreach($project in projects)
> <tr>
>       #if($project == $sproject)
>       <td>
>              <IMG src="d:\icons\openfolder.jpg" border="0">
>       <td>
>       <td> $project </td>
>       
>       #else
>       <td>
>              <IMG src="d:\icons\folder.jpg" border="0">
>       <td>
>       <td> $project </td>
>       #end
> </tr>
> 
> Up to this point all works fine, now i try to implement an inner loop to
> consider the representation of the subprojets. For that i start an other request
> and set up an other loop :
> 
> #if($project == $sproject)
>      #set($subprojects = dbRequest.getSubProjects($project))
> 
>      #foreach($subproject in $subprojects)
>      <tr>
>          <td> </td>
>          <td><IMG src="folder.gif" border="0">
>          <td>$subproject</td>
>      </tr>
>      #end  ##close inner-loop
> #end  ##close if-condition
> 
> #end ##close outer-loop
> </table>
> 
> The Problem is, that Velocity breaks the outer-loop after representing the
> inner loop. I can't understand why ?? In logical consequence it must be
> continue ... The other Problem is, that after the inner loop, the array of the
> project-data have the same datas like the array for the inner-loop  why in hell?
> 
> Could it be possible, that i can't use the concept of inner-loops in
> Velocity? Thanks for any tip. It's realy urgent for me to know it is possible or
> not, either i must implement the hole thing in JAVA with ECS, but this is not
> fine, it breaks the MVC-Koncept ....
> 
> Thx in advance,
> Christian
> 
> 
>       
> 
> 
> -- 
> +++ GMX - Mail, Messaging & more  http://www.gmx.net +++
> NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!
> 


______________________________________________________________________________
Kursiv, fett, bunt,... WEB.DE FreeMail kann alles - mit der HTML-Mail
http://freemail.web.de/features/?mc=021143


--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message