[Opensource] REPOST: Outputting elements in JSP (Marc Schipperheyn)

Turgay Zengin turgay_zengin at hotmail.com
Sat Jul 6 07:18:10 PDT 2002


Hi Marc,
Search the opensource archive for subjects "AttributeTag", "InputTag" and 
"ElementCollection". I have sent some files which may solve your problem 
(Brian Rook has also posted on the same subject) (Look in the June and May 
archives).

Try to change the Expresso classes with the posted ones, compile them, and 
see if your page displays well or not.

Hope this helps,
Turgay Zengin

>From: "Marc Schipperheyn" <m.schipperheyn at thefactore.com>
>Reply-To: opensource at jcorporate.com
>To: <opensource at jcorporate.com>
>Subject: [Opensource] REPOST: Outputting elements in JSP (Marc 
>Schipperheyn)
>Date: Fri, 5 Jul 2002 15:49:12 +0200
>
>Hi all,
>
>I'm a newbie running into a wall trying to output 'blocked' information. I
>can't seem to get anything on screen and I don't know what to try anymore.
>Please help! As a newbie it is pretty hard getting to grips with Expresso!
>The documentation in this area is virtually non-existent.
>
>Here's my code:
>**External State run method**
>             Block blockList = new Block("Dierenoverzicht");
>             Dier dierInit = new Dier();
>             dierInit.setDBName("dieren");
>
>             ArrayList list = soortInit.searchAndRetrieveList("Categorie");
>
>             int size = list.size();
>
>                 ArrayList lDier = dierInit.searchAndRetrieveList("Dier");
>                 System.out.println(lDier.size());//recordcount = 2
>                 for(int x=0; x < lDier.size();x++){
>                     Dier dier = (Dier) lDier.get(x);
>                     Block blok2 = new Block("Dier" + x);
>                     Output out = new Output();
>                     out.setName("dierOverzicht");
>                     out.setAttribute("dierID", dier.getField("dierID"));
>                     out.setAttribute("DierNaam", dier.getField("dier"));
>                     blok2.add(out);
>                     Transition trans = new Transition("KlikDier",
>getClass().getName());
>                     trans.addParam("id", dier.getField("dierID"));
>                     blok2.add(trans);
>                     blockList.add(blok2);
>             }
>             res.add(blockList);
>
>**JSP file**
><expresso:ElementCollection type="block">
>   <expresso:ElementIterator>
>     <expresso:IfElementExists name="blok2" type="block">
>xx
>       <expresso:ElementCollection type="block">
>yy
>         <expresso:ElementIterator>
>zz
>            <expresso:ElementCollection type="output">
>output
>                 <expresso:ElementIterator>
>                   <expresso:OutputTag name="dierOverzicht">
>overzicht
>            <table>
>               <tr>
>                   <td colspan="2">
>                   <!--Dier naam-->
>                   <expresso:AttributeTag name="DierNaam" />
>                   </td>
>               </tr>
>            </table>
>
>                 </expresso:OutputTag>
>           </expresso:ElementIterator>
>         </expresso:ElementCollection>
>       </expresso:ElementIterator>
>     </expresso:ElementCollection>
>   </expresso:IfElementExists>
>  </expresso:ElementIterator>
></expresso:ElementCollection>
>
>The page is printing:
>xx
>yy
>zz
>
>Can anyone shine some light on this? It would be really great if we could
>create a tag that'll take any kind of Block structure and dump a structure
>view of it on screen for debugging puposes (similar to CFDUMP in Cold
>Fusion). My problem is not just how to get this to work but also how to
>debug this kind of problem properly.
>
>Kind regards,
>
>Marc
>
>
>_______________________________________________
>Opensource mailing list
>Opensource at jcorporate.com
>http://mail.jcorporate.com/mailman/listinfo/opensource
>Archives: http://mail.jcorporate.com/pipermail/opensource/




_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com




More information about the Opensource mailing list