RE: URGENT: html:options

2003-10-14 Thread Daniel Haynes
I think your collection needs to implement the List interface (use an
ArrayList instead of a vector)

-Original Message-
From: ajay brar [mailto:[EMAIL PROTECTED]
Sent: 14 October 2003 12:45
To: [EMAIL PROTECTED]
Subject: URGENT: html:options

hi!
i'm getting a problem with my html:options
what i have is a MyUtils class with a method to retrieve a list of agency
id's from the database
class MyUtils
{
   //gets agencyIds creates LabelValueBeans and chucks them into a Vector
 public static Vector getAgencyIds()
}

in my jsp page i had
<%@ page import="MyUtils" %>

<%  agencyIds= MyUtils.getAgencyIds();   %>
i then had

  


this gave me an error, setCollection(java.lang.String) cannot be applied to
java.util.Vector
this was a compiler error.

i tried doing,
changed MyUtils to
class MyUtils
{
   private Vector agencyIds=new Vector();
   //gets agencyIds creates LabelValueBeans and chucks them into a Vector
 public Vector getAgencyIds()
}
<%@ page import="MyUtils" %>


  


this gave me an error saying it couldn't find bean agencyId in any scope.

could someone please help.

thanks
cheers
ajay

_
ninemsn Premium transforms your e-mail with colours, photos and animated
text. Click here  http://ninemsn.com.au/premium/landing.asp


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


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



RE: URGENT: html:options

2003-10-14 Thread ajay brar
hi!

I think your collection needs to implement the List interface (use an
ArrayList instead of a vector)
but a vector implements the List interface, or so says the api
any other ideas


-Original Message-
From: ajay brar [mailto:[EMAIL PROTECTED]
Sent: 14 October 2003 12:45
To: [EMAIL PROTECTED]
Subject: URGENT: html:options
hi!
i'm getting a problem with my html:options
what i have is a MyUtils class with a method to retrieve a list of agency
id's from the database
class MyUtils
{
   //gets agencyIds creates LabelValueBeans and chucks them into a Vector
 public static Vector getAgencyIds()
}
in my jsp page i had
<%@ page import="MyUtils" %>

<%  agencyIds= MyUtils.getAgencyIds();   %>
i then had

  

this gave me an error, setCollection(java.lang.String) cannot be applied to
java.util.Vector
this was a compiler error.
i tried doing,
changed MyUtils to
class MyUtils
{
   private Vector agencyIds=new Vector();
   //gets agencyIds creates LabelValueBeans and chucks them into a Vector
 public Vector getAgencyIds()
}
<%@ page import="MyUtils" %>


  
value="value" />


this gave me an error saying it couldn't find bean agencyId in any scope.

could someone please help.

thanks
cheers
ajay
_
ninemsn Premium transforms your e-mail with colours, photos and animated
text. Click here  http://ninemsn.com.au/premium/landing.asp
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
E-mail just got a whole lot better. New ninemsn Premium. Click here 
http://ninemsn.com.au/premium/landing.asp

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


Re: URGENT: html:options

2003-10-14 Thread Nicolas De Loof
collection attribute of  tag is used to set the name of a bean (in some 
scope) that is a collection of the
items off the select-box.

You need to put your Vector into page or request scope to use this tag:

<%
request.setAttribute("items", agencyIds);
%>


   


Nico.


- Original Message - 
From: "ajay brar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 14, 2003 2:53 PM
Subject: RE: URGENT: html:options


> hi!
>
> >I think your collection needs to implement the List interface (use an
> >ArrayList instead of a vector)
> but a vector implements the List interface, or so says the api
> any other ideas
>
>
>
> >
> >-Original Message-
> >From: ajay brar [mailto:[EMAIL PROTECTED]
> >Sent: 14 October 2003 12:45
> >To: [EMAIL PROTECTED]
> >Subject: URGENT: html:options
> >
> >hi!
> >i'm getting a problem with my html:options
> >what i have is a MyUtils class with a method to retrieve a list of agency
> >id's from the database
> >class MyUtils
> >{
> >//gets agencyIds creates LabelValueBeans and chucks them into a Vector
> >  public static Vector getAgencyIds()
> >}
> >
> >in my jsp page i had
> ><%@ page import="MyUtils" %>
> >
> ><%  agencyIds= MyUtils.getAgencyIds();   %>
> >i then had
> >
> >>labelProperty="label" />
> >
> >
> >this gave me an error, setCollection(java.lang.String) cannot be applied to
> >java.util.Vector
> >this was a compiler error.
> >
> >i tried doing,
> >changed MyUtils to
> >class MyUtils
> >{
> >private Vector agencyIds=new Vector();
> >//gets agencyIds creates LabelValueBeans and chucks them into a Vector
> >  public Vector getAgencyIds()
> >}
> ><%@ page import="MyUtils" %>
> >
> >
> >>label="label"
> >value="value" />
> >
> >
> >this gave me an error saying it couldn't find bean agencyId in any scope.
> >
> >could someone please help.
> >
> >thanks
> >cheers
> >ajay
> >
> >_
> >ninemsn Premium transforms your e-mail with colours, photos and animated
> >text. Click here  http://ninemsn.com.au/premium/landing.asp
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> _
> E-mail just got a whole lot better. New ninemsn Premium. Click here
> http://ninemsn.com.au/premium/landing.asp
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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



Re: URGENT: html:options

2003-10-14 Thread ajay brar
hi!
thanks for the reply.
doesn't the jsp import statement followed by the usebean ie,
%@ page import="MyUtils" %>

introduce the agencyIds into page scope.
also with the example you gave me should

   

shouldn't the value of collections be items, since that is the key you used.

thanks
cheers
ajay

From: "Nicolas De Loof" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: Re: URGENT: html:options
Date: Tue, 14 Oct 2003 15:11:57 +0200
collection attribute of  tag is used to set the name of a 
bean (in some scope) that is a collection of the
items off the select-box.

You need to put your Vector into page or request scope to use this tag:

<%
request.setAttribute("items", agencyIds);
%>

   

Nico.

- Original Message -
From: "ajay brar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 14, 2003 2:53 PM
Subject: RE: URGENT: html:options
> hi!
>
> >I think your collection needs to implement the List interface (use an
> >ArrayList instead of a vector)
> but a vector implements the List interface, or so says the api
> any other ideas
>
>
>
> >
> >-Original Message-
> >From: ajay brar [mailto:[EMAIL PROTECTED]
> >Sent: 14 October 2003 12:45
> >To: [EMAIL PROTECTED]
> >Subject: URGENT: html:options
> >
> >hi!
> >i'm getting a problem with my html:options
> >what i have is a MyUtils class with a method to retrieve a list of 
agency
> >id's from the database
> >class MyUtils
> >{
> >//gets agencyIds creates LabelValueBeans and chucks them into a 
Vector
> >  public static Vector getAgencyIds()
> >}
> >
> >in my jsp page i had
> ><%@ page import="MyUtils" %>
> >
> ><%  agencyIds= MyUtils.getAgencyIds();   %>
> >i then had
> >
> >   
> >labelProperty="label" />
> >
> >
> >this gave me an error, setCollection(java.lang.String) cannot be 
applied to
> >java.util.Vector
> >this was a compiler error.
> >
> >i tried doing,
> >changed MyUtils to
> >class MyUtils
> >{
> >private Vector agencyIds=new Vector();
> >//gets agencyIds creates LabelValueBeans and chucks them into a 
Vector
> >  public Vector getAgencyIds()
> >}
> ><%@ page import="MyUtils" %>
> >
> >
> >   
> >label="label"
> >value="value" />
> >
> >
> >this gave me an error saying it couldn't find bean agencyId in any 
scope.
> >
> >could someone please help.
> >
> >thanks
> >cheers
> >ajay
> >
> >_
> >ninemsn Premium transforms your e-mail with colours, photos and 
animated
> >text. Click here  http://ninemsn.com.au/premium/landing.asp
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> _
> E-mail just got a whole lot better. New ninemsn Premium. Click here
> http://ninemsn.com.au/premium/landing.asp
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Get less junk mail with ninemsn Premium. Click here  
http://ninemsn.com.au/premium/landing.asp

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


Re: URGENT: html:options

2003-10-14 Thread Nicolas De Loof


create a scripting variable "agencyIds" and a page scope bean "agencyIds". This 
created vector is empty.

<%  agencyIds= MyUtils.getAgencyIds();   %>

chags the object referenced by the scripting variable, but not the page scoped bean.

You should use something like this, assuming populateAgencyIds(List) adds items to an 
existing List :

<% MyUtils.populateAgencyIds(agencyIds); %>

Nico.



- Original Message - 
From: "ajay brar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 14, 2003 3:18 PM
Subject: Re: URGENT: html:options


> hi!
> thanks for the reply.
> doesn't the jsp import statement followed by the usebean ie,
> %@ page import="MyUtils" %>
> 
> introduce the agencyIds into page scope.
> also with the example you gave me should
> >
> > > label="label"
> > value="value" />
> >
> shouldn't the value of collections be items, since that is the key you used.
> 
> thanks
> cheers
> ajay
> 
> 
> >From: "Nicolas De Loof" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >Subject: Re: URGENT: html:options
> >Date: Tue, 14 Oct 2003 15:11:57 +0200
> >
> >collection attribute of  tag is used to set the name of a 
> >bean (in some scope) that is a collection of the
> >items off the select-box.
> >
> >You need to put your Vector into page or request scope to use this tag:
> >
> ><%
> > request.setAttribute("items", agencyIds);
> >%>
> >
> >
> > > label="label"
> > value="value" />
> >
> >
> >Nico.
> >
> >
> >- Original Message -
> >From: "ajay brar" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Tuesday, October 14, 2003 2:53 PM
> >Subject: RE: URGENT: html:options
> >
> >
> > > hi!
> > >
> > > >I think your collection needs to implement the List interface (use an
> > > >ArrayList instead of a vector)
> > > but a vector implements the List interface, or so says the api
> > > any other ideas
> > >
> > >
> > >
> > > >
> > > >-Original Message-
> > > >From: ajay brar [mailto:[EMAIL PROTECTED]
> > > >Sent: 14 October 2003 12:45
> > > >To: [EMAIL PROTECTED]
> > > >Subject: URGENT: html:options
> > > >
> > > >hi!
> > > >i'm getting a problem with my html:options
> > > >what i have is a MyUtils class with a method to retrieve a list of 
> >agency
> > > >id's from the database
> > > >class MyUtils
> > > >{
> > > >//gets agencyIds creates LabelValueBeans and chucks them into a 
> >Vector
> > > >  public static Vector getAgencyIds()
> > > >}
> > > >
> > > >in my jsp page i had
> > > ><%@ page import="MyUtils" %>
> > > >
> > > ><%  agencyIds= MyUtils.getAgencyIds();   %>
> > > >i then had
> > > >
> > > >> > >labelProperty="label" />
> > > >
> > > >
> > > >this gave me an error, setCollection(java.lang.String) cannot be 
> >applied to
> > > >java.util.Vector
> > > >this was a compiler error.
> > > >
> > > >i tried doing,
> > > >changed MyUtils to
> > > >class MyUtils
> > > >{
> > > >private Vector agencyIds=new Vector();
> > > >//gets agencyIds creates LabelValueBeans and chucks them into a 
> >Vector
> > > >  public Vector getAgencyIds()
> > > >}
> > > ><%@ page import="MyUtils" %>
> > > >
> > > >
> > > >> > >label="label"
> > > >value="value" />
> > > >
> > > >
> > > >this gave me an error saying it couldn't find bean agencyId in any 
> >scope.
> > > >
> > > >could someone please help.
> > > >
> > > >thanks
> > > >cheers
> > > >ajay
> > > >
> > > >_
> > > >ninemsn Premium transforms your