Antwort: iterate tag and html:option

2002-10-15 Thread Cetin.Ergen


Hi,

i think it's a typo, but  html:option value=%= AemGroupBean.getMo %  is
wrong, it must be: html:option value=%= AemGroupBean.getMo() %. Notice
the brackets in the scriplet.

Sincerely
Çetin Ergen



   
 
  Marcus Biel  
 
  Marcus.Biel@bmw.An:   
[EMAIL PROTECTED] 
  de  Kopie:  
 
   Thema:iterate tag and html:option   
 
  15.10.02 12:42   
 
  Bitte antworten  
 
  an Struts Users 
 
  Mailing List
 
   
 
   
 




Hi, I am trying to do a dynamic select box.
Therefore, I create an ArrayList, containing Beans with my properties.
Then I want to create a select box with one of those properties.

What works is to simply print the mo value of my ArrayList:
logic:iterate id=AemGroupBean collection=%=werkeList% 
bean write name=AemGroupBean property=mo/
/logic:iterate

Now I tried to create the dynamic select box the same way:

html:select property=werkAuswahl
 logic:iterate id=AemGroupBean collection=%=werkeList% 
 html:option value=%= AemGroupBean.getMo % /
 /logic:iterate
/html:select


Unfortunately this doesn't work.

Any idea what's wrong / how to correct it ?


thx,

marcus

--
To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: 
mailto:[EMAIL PROTECTED]







--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Antwort: iterate tag and html:option

2002-10-15 Thread Marcus Biel

Yes, this was just a typo. :-

Would be much easier then! ;-)

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Antwort: Re: Antwort: iterate tag and html:option

2002-10-15 Thread Cetin.Ergen



Ok,

i have send my mail before realy completing ;-)

You must set the type of youre collection element. For example:

html:select property=werkAuswahl
 logic:iterate id=AemGroupBean type
=com.company.BeanClassName collection=%=werkeList% 
 html:option value=%= AemGroupBean.getMo() %
/
 /logic:iterate
/html:select


BG-SYS oHGmailto:[EMAIL PROTECTED]
Brunnenstr. 111 Tel. 030/245-52210
13355 Berlin-WeddingFax 030/245-52763


   
 
  Marcus Biel  
 
  Marcus.Biel@bmw.An:   
[EMAIL PROTECTED] 
  de  Kopie:  
 
   Thema:Re: Antwort: iterate tag and 
html:option   
  15.10.02 13:29   
 
  Bitte antworten  
 
  an Struts Users 
 
  Mailing List
 
   
 
   
 




Yes, this was just a typo. :-

Would be much easier then! ;-)

--
To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: 
mailto:[EMAIL PROTECTED]







--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Antwort: Re: Antwort: iterate tag and html:option

2002-10-15 Thread Marcus Biel

Hi Cetin, there really was an error:
AemGroupBean is the Class name of the bean, I didn't have the name of
the beans.
All my beans are called datarecord, as they are created inside a loop.

Now I wrote:

%
ArrayList werkeList= SimpleQuery.getAemWerkUnique();
%
html:form action=selectWerk
select name=werkAuswahl
logic:iterate id=dataRecord collection=%=werkeList%
type=AemGroupBean 
html:option value=%= dataRecord.getMo() % /
/logic:iterate
/select
/html:form

And thid is the error I get:
javax.servlet.ServletException: Cannot retrieve definition for form bean
null.

Here again is what I am trying to do:

form action=/aem_group/Aem_Group.jsp method=GET 
Werk:  select name=werk size=1
  option alle


%// alle Werke die in der Tabelle vorkommen als
  // Auswahloption angeben
  ArrayList werkCollection = null;

  try {// ArrayList zusammenstellen
   werkCollection = SimpleQuery.getAemWerkUnique();
}
catch(SQLException sql)
{
   System.err.println(sql);
   sql.printStackTrace();
}

// wenn die Abfrage erfolgreich war alle Werke ausgeben
if (werkCollection != null)
{
   Iterator i = werkCollection.iterator();

   while(i.hasNext() )
   {
 AemGroupBean bean = (AemGroupBean)i.next();

 % option %= bean.getMo()%


% }
}
%
   /select
 p

 input type=submit value=get it
  /form





[EMAIL PROTECTED] schrieb:
 
 Ok,
 
 i have send my mail before realy completing ;-)
 
 You must set the type of youre collection element. For example:
 
 html:select property=werkAuswahl
  logic:iterate id=AemGroupBean type
 =com.company.BeanClassName collection=%=werkeList% 
  html:option value=%= AemGroupBean.getMo() %
 /
  /logic:iterate
 /html:select
 
 BG-SYS oHGmailto:[EMAIL PROTECTED]
 Brunnenstr. 111 Tel. 030/245-52210
 13355 Berlin-WeddingFax 030/245-52763
 
 
   Marcus Biel
   Marcus.Biel@bmw.An:   
[EMAIL PROTECTED]
   de  Kopie:
Thema:Re: Antwort: iterate tag 
and html:option
   15.10.02 13:29
   Bitte antworten
   an Struts Users
   Mailing List
 
 
 
 Yes, this was just a typo. :-
 
 Would be much easier then! ;-)
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]