clearing the HtmlSelectManyCheckbox SelectedValues

Hi,

I want to clear the HtmlSelectManyCheckbox SelectedValues when i come back to page, The problem here is when i check some check boxes , those values should get cleared when i revisit the same page .But the selected values are not getting cleared but restoring with the previuosly selected values.

I am using the following to clear the selected values.

Backing Bean:

-

private HtmlSelectManyCheckbox queries = new HtmlSelectManyCheckbox();

public HtmlSelectManyCheckbox getQueries() {

return queries;

}

public void setQueries(HtmlSelectManyCheckbox queries) {

this.queries = queries;

}

..........

this.getQueries().setSelectedValues(null); //clearing selected values

jsp:

<h:selectManyCheckbox id="seleQry" styleClass="bodycopy" binding="#{onDemand.queries}" layout="pageDirection">

<f:selectItems value="#{onDemand.queryOptions}"/>

</h:selectManyCheckbox>

please some one guide me to find the solution for this.

I would to know if there is a problem with clearing the selected values with HtmlSelectManyCheckbox.

Help Appreciated....

Ram,

[1194 byte] By [gsrama] at [2007-11-26 19:32:39]
# 1

Check out the appropriate API:

http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/api/index.html

You can use your component binding to setSelectedValues(null). And it will clear your selection. You will need to do this when you know you are traversing back to the page with the select many checkbox.

CowKing

IamCowKinga at 2007-7-9 22:04:06 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...