• Post Reply Bookmark Topic Watch Topic
  • New Topic

Data Table --> Conversion Error Occurred (!!!)  RSS feed

 
Mike London
Ranch Hand
Posts: 1476
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an updateable resultSet from a MySQL database displayed in a Data Table.

The data type, in MySQL, for the checkbox column is currently smallint -- I've tried other data types as well (BIT, TINYINT, INTEGER...).

On my JSP (JSF) form, I have a Data Table with a checkbox.

If I check the check box and click Submit, my <h:messages/> tag says:

"_id33": Conversion error occurred.

<h:column>
<f:facet name="header">
<h utputText value="#{msgs.wasUsed}" />
</f:facet>
<h:selectBooleanCheckbox value="#{form.wasUsed}" />
<h:messages layout="table" />
</h:column>

=================

The ResultSet is updateable.

I created a boolean property with getters/setters in the Managed Bean. I've tried int, byte, and short also as data types for the property's getters/setters.

The "Core JSF" book says (page 209) that the JSF implementation will do converters for you automatically for primitive types.

------------

I'm stumped!!!

The error message is kind of helpful, but not helpful enough. I've tried changing the Managed Bean's property type, but it doesn't seem to be getting called anyway due to the "conversion error".

There are lots of posts about this but for SQL Server, not for MySQL.

===========================

Has *anybody* gotten this error and knows what I need to try next?

This is incredibly frustrating.

Thanks very very much for any ideas at all!!!

<s>

-- Mike
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "Core JSF" book says (page 209) that the JSF implementation will do converters for you automatically for primitive types.


All my research and experience suggests that if your data is of type int coming into the page, then the rendering type won't be able to be a boolean. The conversion from int to boolean needs to happen between the data layer and the model. But I am still looking into it to be sure.
[ December 25, 2005: Message edited by: Gregg Bolinger ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!