Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

h:selectManyCheckbox inside h:dataTable

 
Wendell Miranda
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, i'm try retrieve values of the h:selectManyCheckbox in dataTable but just can getting one value(the last register). What is problem? in my backing bean i using String[] like this:

private String[] marked;
public void setMarked( String[] marked ){
this.marked = marked;
}
public String[] getMarked(){
return this.marked;
}
StringBuffer subscriptions = new StringBuffer( );
if( marked != null ){
for (int i = 0; i < marked.length; i++) {
subscriptions.append( marked[ i ] ).append(",");
}

And into the JSF:
<h ataTable value="#{dataTable.all}" var="var" >
<h:selectManyCheckbox id="marked" value="#{vapreensoes.marked}">
<f:selectItem itemValue="var.id" />
</h:selectManyCheckbox>

Regards!

[Bear edit: removed URGENT from the title -- come on!]
[ May 30, 2006: Message edited by: Bear Bibeault ]
 
g madhava
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to provide <f:selectItems> for your list of check box items to appear.

<h: dataTable value="#{dataTable.all}" var="var" >
<h:selectManyCheckbox id="marked" value="#{vapreensoes.marked}">
<f:selectItem itemValue="var.id" />

<f:selectItems itemValue="#{vapreensoes.listOfResponses}" />

</h:selectManyCheckbox>

The #{vapreensoes.listOfResponses} is the value binding method that should return a SelectItems object or a List containing SelectItem object.



or

 
Wendell Miranda
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alright, i go to try!

thanks!
 
Wendell Miranda
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, when i use SelectItem, the message is shown:

Conversion Error setting value ' 181' for 'null Converter'.

Where 181 is the value(ID) of the register.

You can send the example running using the selectManyCheckbox and dataTable?

Regards!
 
Wendell Miranda
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HELP-ME!HELP-ME!HELP-ME!HELP-ME!HELP-ME!
THE PROBLEM IS NOT RESOLVED, I HAVE THAT SELECT THE ITEMS IN DATATABLE USING SELECTMANYCHECKBOX BECAUSE I HAVE RETRIEVE IDs OF THE REGISTERS IN DATATABLE.

HELP-ME!HELP-ME!HELP-ME!HELP-ME!HELP-ME!

REGARDS!
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can help us help you by not shouting at us in all uppercase.
 
Wendell Miranda
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is not resolved, i have that select the items in dataTable using h:selectManyCheckbox because i have retrieve IDs of the registers in dataTable.

Somebody has some example running using selectManyCheckbox and dataTable?

help-me please, my project is stopped by cause of this.

Regards!
 
Wendell Miranda
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please everybody... i need help... please? how resolved ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic