struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Matthieu.M...@ensam.eu>
Subject RE: Iterator tag and enumeration
Date Fri, 13 May 2011 06:11:49 GMT
getListLocalization() is a method of my Enum, not of my Action class.


Matthieu MARC


-----Message d'origine-----
De : Steven Yang [mailto:kenshin520@gmail.com] 
Envoyé : vendredi 13 mai 2011 03:03
À : Struts Users Mailing List
Objet : Re: Iterator tag and enumeration

I dont quite get what exactly you want

if your getListLocalization has all the information of you Enum then you probably just do
list="listLocalization.entrySet"
but then you still need to provide the listValue and listKey attribute

On Thu, May 12, 2011 at 6:56 PM, <Matthieu.Marc@ensam.eu> wrote:

> This code is working :
>        <s:select list="@org.ensam.annuaire.enumeration.Localization@values()"
> />
>
> This one is not working :
>        <s:select 
> list="@org.ensam.annuaire.enumeration.Localization@getListLocalization ()" /> Neither
this one :
>        <s:select 
> list="@org.ensam.annuaire.enumeration.Localization@listLocalization ()" /> And neither
this one :
>        <s:select 
> list="@org.ensam.annuaire.enumeration.Localization@listLocalization " 
> />
>
> I would be great to make the getListLocalization() work because I will 
> be able to have a nice display of select element.
>
> Thank
>
> Matthieu MARC
>
>
> -----Message d'origine-----
> De : Steven Yang [mailto:kenshin520@gmail.com] Envoyé : jeudi 12 mai 
> 2011 12:34 À : Struts Users Mailing List Objet : Re: Iterator tag and 
> enumeration
>
> try
> <s:select list="@{full package name}.Localization@values()"/>
>
> On Thu, May 12, 2011 at 3:33 PM, <Matthieu.Marc@ensam.eu> wrote:
>
> > Hi,
> >
> > I have an enumeration 'Localization' :
> >
> > public enum Localization {
> >
> >        AIX("Aix-en-provence"),
> >        ANGERS("Angers") ;
> > }
> >
> > And I want to put a form select in a jsp using s:select tag with all 
> > Localization items, like :
> >
> > <s:select list="Localization enum"/>
> >
> > But I don't know what to put in the list parameter.
> >
> > In my Localization enum, I wrote a function to retrieve Localization 
> > item through a sorted map :
> >
> >        public Map<String, String> getListLocalization() {
> >                [...]
> >        }
> >
> > So that my select will be like :  <option 
> > value="aix">Aix-en-provence</option>
> >
> > My question is finally : how to put an enumeration in a s:select tag ?
> >
> > Thanks,
> >
> > Matthieu MARC
> >
> > ---
> > Matthieu MARC
> > Responsable du Service Informatique du Centre d'Angers Arts et 
> > Métiers ParisTech Tél : 02 41 20 73 61
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message