New to java: Drop Down Box filtering help

I have a drop down box on my jsp form with 4 options. I want to create a the option that displays all of the records BUT one. How do I create a filter (or If/else) statement that will display all records, except those match a certain criteria?
[250 byte] By [MDwyer75a] at [2007-11-27 5:56:05]
# 1
Options:1. In the page that calls the JSP with the drop down box, set the selection criteria. When the servlet behind the JSP gets called (doGet()), populate the dropdown accordingly.2. Some JavaScript wizardry in the JSP that contains the drop down box.
filestreama at 2007-7-12 16:25:55 > top of Java-index,Java Essentials,Java Programming...
# 2

Any ideas on what kind of wizardry on the drop down box?

What I want is similar to selecting all records. I have that. But, I want an option to select all records except those with a particluar ID number.

For example, the drop-down box has these 4 options:

All

1

2

3

I want to create a new option (called "Not 3") that will display only the results for 1 and 2.

MDwyer75a at 2007-7-12 16:25:55 > top of Java-index,Java Essentials,Java Programming...
# 3
I ain't no JavaScript programmer. You might want to do a Google search to see if someone has developed this functionality.Good luck.
filestreama at 2007-7-12 16:25:55 > top of Java-index,Java Essentials,Java Programming...
# 4

I am not sure I understand the question but the JavaScript is one of the following depending on what you are doing.

If you want to refresh a select list then something AJAX-y. So really just the other solution streamy mentioned with added bloat.

Or if you want to show hide data based on changing a select then something that uses spans or other suitable HTML elements with style attributes for display of either hider or show.

A simple example

<html>

<head>

<script type="text/javascript">

function doMagic(){

var ele = document.all["s1"];

if(document.test.example.selectedIndex==0){

ele.style.display = "none";

}else{

ele.style.display = "block";

}

}

</script>

</head>

<body>

<form name="test">

<select name="example" onchange="doMagic()">

<option>Hide

<option>Show

</select>

<span id="s1" style="background-color: #FFFFDD; width:300px; display: none;">

Dum de dum

</span>

</form>

</body>

</html>

cotton.ma at 2007-7-12 16:25:55 > top of Java-index,Java Essentials,Java Programming...
# 5

Here is a sample of the code I want to update:

<select name="statSel" >

<option value="*" ><%=FormsBean.getStatSel().equals("*") ? "selected" : ""%> >All</option>

<option value="1" ><%=FormsBean.getStatSel().equals("1") ? "selected" : ""%> >1</option>

<option value="2" ><%=FormsBean.getStatSel().equals("2") ? "selected" : ""%> >2</option>

<option value="3" ><%=FormsBean.getStatSel().equals("3") ? "selected" : ""%> >3</option>

</select>

I want to create a new option that has the value of "Not3" that if selected will display all of the results that do not have a value of 3.

MDwyer75a at 2007-7-12 16:25:55 > top of Java-index,Java Essentials,Java Programming...
# 6
<option value="Not3" ><%=FormsBean.getStatSel().equals("Not3") ? "selected" : ""%> >Not3</option>
DrClapa at 2007-7-12 16:25:55 > top of Java-index,Java Essentials,Java Programming...
# 7
I've already got that far. However, Iget "Cannot find any information on property 'Not757' " error. I need something that indicates to the java bean that IF Not3 is selected, get all data that is not 3
MDwyer75a at 2007-7-12 16:25:55 > top of Java-index,Java Essentials,Java Programming...
# 8
sorry, Not757 should be Not3
MDwyer75a at 2007-7-12 16:25:55 > top of Java-index,Java Essentials,Java Programming...