thanks!!

On Thu, May 21, 2009 at 2:29 PM, Martin Gainty <mgai...@hotmail.com> wrote:

>
> //Assuming we have this Action
> //A Simple Action Class which demonstrates placing information in a Map
> public class GetEntryAction extends ActionSupport
> {
>    private ArrayList stats_list=new ArrayList(30); //a collection of stats
>    private class stats
>    {
>      private ArrayList entries_list=new ArrayList(30); // a collection of
> Entries
>      String StatusGroupName="StatusGroupName";
>      String StatusGroupID="StatusGroupID";
>    }
>    private class Entry
>    {
>                String HOHName;
>                public String getHOH Name()
>                {
>                        return HOHName;
>                }
>                public void setHOH Name(String HOHName)
>                {
>                        this.HOHName=HOHName;
>                }
>                String Price;
>                public String getPrice()
>                {
>                        return Price;
>                }
>                public void setPrice(String price)
>                {
>                        Price=price;
>                }
>                String OriginalValue;
>                public String getOriginalValue()
>                {
>                        return OriginalValue;
>                }
>                public void setOriginalValue(String str)
>                {
>                        OriginalValue=str;
>                }
>        }
>    public String execute() throws Exception
>    {
>
>                        Map session =
> ActionContext.getContext().getSession();
>
>              //construct new Uber stats class
>                        stats stats1=new stats();
>                        stats1.StatusGroupName=new
> String("StatusGroupName1");
>                        stats1.StatusGroupID=new String("StatusGroupID");
>
>                        //Name,Value,OriginalValue
> //construct the 1st entry
>                        Entry entry1=new Entry();
>                        entry1.setHOHName("ALL");
>                        entry1.setPrice("50.00");
>                        entry1.setOriginalValue("10.00");
> //put it into stats Map
>                        stats1.entries_list.add(entry1);
>
> //construct the second entry
>                        Entry entry2=new Entry();
>                        entry2.setHOHName("ALL");
>                        entry2.setPrice("50.00");
>                        entry2.setOriginalValue("10.00");
> //put it into entries Map
>                        stats1.entries_list.add(entry2);
>
>                        //put the stats class into stats_list
>                        stats_list.add(stats1);
>
>              //construct new Uber stats class
>                        stats stats2=new stats();
>                        stats2.StatusGroupName=new
> String("StatusGroupName2");
>                        stats2.StatusGroupID=new String("StatusGroupID2");
>
> //construct the 1st entry
>                        Entry entry2a=new Entry();
>                        entry2a.setHOHName("ALL");
>                        entry2a.setPrice("50.00");
>                        entry2a.setOriginalValue("10.00");
> //put it into stats Map
>                        stats2.entries_list.add(entry2a);
>
> //construct the second entry
>                        Entry entry2b=new Entry();
>                        entry2b.setHOHName("ALL");
>                        entry2b.setPrice("50.00");
>                        entry2b.setOriginalValue("10.00");
> //put it into entries Map
>                        stats2.entries_list.add(entry2b);
>
>                        session.put("stats_list",stats_list);
> //All of the information you require is now in the map which is now in the
> Session
>                        return SUCCESS;
>    }
> }
>
> <s:iterator value="#session.stats_list" status="statsStatus">
>     <tr class="<s:if test="#statsStatus.odd == true
> ">odd</s:if><s:else>even</s:else>">
>         <td><s:property value="name" /></td>
>         <td><s:property value="description" /></td>
>         <td>
>             <!-- notice the statsStatus.indexis used to refer to iterate
> from -->
>             <s:iterator
> value="#session.stats_list.entries_list('#statsStatus.index')"
> status="userStatus">
>
>                 <!-- display HOHName for anything other than 0 entry -->
>                 <s:property value="HOHName" /><s:if
> test="!#userStatus.index">,</s:if>
>
>             </s:iterator>
>         </td>
>     </tr>
>  </s:iterator
> HTH
> Martin Gainty
> ______________________________________________
> Jogi és Bizalmassági kinyilatkoztatás/Verzicht und
> Vertraulichkeitanmerkung/Note de déni et de confidentialité
>  Ez az
> üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
> jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
> készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
> semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
> könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
> ezen üzenet tartalma miatt.
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
>
> > Date: Thu, 21 May 2009 12:28:50 -0400
> > Subject: Nested Struts2 iterator tags
> > From: bhaara...@gmail.com
> > To: user@struts.apache.org
> >
> > Hi
> > I have two nested struts iterator tags.
> >
> > The value for second iterator tag is property from the first iterator.
> >
> > Something like this
> >
> > <s:iterator value="stats">
> >         <th colspan="4">
> >             HOH Name <s:property value="hohName"/> | HOH DOB  <s:property
> > value="DOB"/>  | Project  <s:property value="developmentName"/>
> >         </th>
> >          <tr>
> >             <th class="cols">Member Name</th>
> >             <th class="cols">Member DOB</th>
> >             <th class="cols">Failed Verification Description</th>
> >         </tr>
> >       <s:iterator value="<s:property: value="memberDetails"/>"/>
>  <!--
> >  this is the second tag where 'memberDetails' is property from first
> > iterator tag. ofcourse this syntax is not correct-->
> >            .....
> >              .....
> >       <s:/iterator>
> > </s:iterator>
> >
> > I would like to know what is the current syntax to achieve something like
> > this?
>
> _________________________________________________________________
> Hotmail® goes with you.
>
> http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_Tutorial_Mobile1_052009
>

Reply via email to