select manylistbox

i am using selectmanylistbox

but when i select some values ,it displays the result for that .next time when i select nothing still it is retaining last selected values.

code is here

jsp

<h:selectManyListbox id="CATG" value="#{PersInp.category}" styleClass="option" style="font-family: Verdana; font-size: 8pt; padding: 0" size="3" >

<f:selectItems id = "CATGLIST" value ="#{PersInp.catgList}" />

</h:selectManyListbox></td>

/**

* set method for category

* @param as_category

*/

public void setCategory(Object[] as_category)

{

int len=0;

if (null == as_category || ( len = as_category.length)==0 )

{

return;

}

category.clear();

category = new ArrayList(len);

for ( int i = 0 ; i < len ; i++)

{

category.add(as_category);

}

}

/**

* get method for category

* @return category

*/

public Object[] getCategory()

{

return category.toArray();

}

also catglist is there

[1120 byte] By [shila] at [2007-11-26 15:47:00]
# 1
In the action method of the form, do category.clear().
BalusCa at 2007-7-8 22:06:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...