Sorry I didn't give too much detail before, since I was thinking it
wasn't such a difficult problem. However, now that I am getting this
error more often and I cannot figure it out, I shall explain.

I am storing the 270 items in a static class so I have only one instance
for all users. When a particular page to display these countries is
called, I load as shown in the example before. I have found that it is
NOT the browser because I tried to capture the error with an error.jsp
page which gave me the exception as being : null. I haven't figured out
what is 'null' yet, but, I tried using two different Vector references
on each select box but got the same results.

Here is a piece of the code, notice I am using acSize and the
allCountries references in both loops. Toward the end of the second loop
something becomes null.

Thanks for your ideas and time.

TOP OF PAGE :

  <select name=country>
  <option value="NONE">- SELECT COUNTRY -</option>
<%
  Vector allCountries = GlobalDataSets.getCountries();
  int acSize = allCountries.size();
  for (int i = 0; i < acSize; i++)
  {
%>
   <option value="<%= allCountries.elementAt(i) %>"><%=
allCountries.elementAt(i) %></option>
<%
   }
%>  </font>

........................................
html html
html html
........................................
BOTTOM OF PAGE:

   <select name=bill_country>
   <option value="NONE">- SELECT COUNTRY -
<%

   for (int i = 0; i < acSize; i++)
   {
%>
    <option value="<%= allCountries.elementAt(i) %>"><%=
allCountries.elementAt(i) %>

<%
    }
%>  </font>
   </select>


Christian Bollmeyer wrote:


Am Freitag, 20. Juni 2003 19:23 schrieb Yee, Richard K,,DMDCWEST:


Brian,
Have you tried different browsers? It might be a browser limitation.
You might want to re-think your user interface design.



Putting more than 30 items in a combobox might not be the best idea to think of, but in this case, *countries*. Hm. All sites I know of always present the country list this way. Hm. Anyway: if it's a browser limitation, you can instantly tell by looking at the HTML sources. If the missing items are there, the browser is the culprit. If not, something unexpected happened in-between. Given that Vector is thread-safe, the code that puts it in (request | page?) scope might be not. But one thing does strike me here, still, as appparently the countries list is being read from the back end facade each time the page is displayed. There could be reasons for doing so, but if it's just a dumb list of all countries known so far: what hinders you to from putting the Vector into application scope upon initialisation of the whole thing and leaving it there until either the server is rebooted or yet another rebellion is successful? If you just read from the list, an un-synchronized - read: faster - Collection like ArrayList might be fitting the needs as well and might be preferable to Vector in this case, too.

HTH,

-- Chris (SCPJ2)



Rgds,

Richard



-----Original Message-----
From: Brian P Bohnet [SMTP:[EMAIL PROTECTED]
Sent: Friday, June 20, 2003 10:21 AM
To:   [EMAIL PROTECTED]
Subject:      Large vector filling select box

Hello all,



[CLIP!]


===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com



=========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com

Reply via email to