File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes h:selectManyCheckbox inside h:dataTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "h:selectManyCheckbox inside h:dataTable" Watch "h:selectManyCheckbox inside h:dataTable" New topic
Author

h:selectManyCheckbox inside h:dataTable

Wendell Miranda
Greenhorn

Joined: May 30, 2006
Posts: 11
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

Joined: Sep 14, 2001
Posts: 85
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

Joined: May 30, 2006
Posts: 11
Alright, i go to try!

thanks!
Wendell Miranda
Greenhorn

Joined: May 30, 2006
Posts: 11
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

Joined: May 30, 2006
Posts: 11
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
Marshal

Joined: Mar 22, 2005
Posts: 41591
    
  55
You can help us help you by not shouting at us in all uppercase.


Ping & DNS - my free Android networking tools app
Wendell Miranda
Greenhorn

Joined: May 30, 2006
Posts: 11
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

Joined: May 30, 2006
Posts: 11
Please everybody... i need help... please? how resolved ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: h:selectManyCheckbox inside h:dataTable