Not really. The default Integer converter really should do the right thing.
Try setting up a simpler test case that just has the select item
pulldown on a page by itself.
Another thing to do is set a breakpoint where the exception is being
thrown ("javax.faces.FacesException: Value is no String and component
_id10:display_0:_id22 does not have a Converter") and see what type
Value currently has.
It probably wouldn't hurt to open a JIRA issue and submit a patch to
make that error message more informative by actually displaying the
class and value of the unconverted object.
On 11/16/05, Don Tam <[EMAIL PROTECTED]> wrote:
> Hi Mike,
>
> Thank you for your response. The component id10:... is the
> f:selectItems component. If I comment that one line out then the jsp
> generates normally.
>
> The kinds of objects in the selectList are javax.faces.model.SelectItem,
> with an Integer value and a String label, using the constructor
> SelectItem(Integer value, String label). The second dataTable in the
> code was included just to make sure they in fact have the expected value
> and label fields, and that the fields convert correctly when just using
> outputText.
>
> Does that info help figure out what's going on?
>
> Thanks,
>
> Mike Kienenberger wrote:
>
> >On 11/16/05, Don Tam <[EMAIL PROTECTED]> wrote:
> >
> >
> >>javax.faces.FacesException: Value is no String and component
> >>_id10:display_0:_id22 does not have a Converter
> >>
> >>
> >
> >Which component does the "_id10:display_0:_id22" string refer to?
> >Might help to put in some id attributes for the data tables and
> >selectOneMenu.
> >
> >Also, what does ManageInterviewersBean.supervisors.selectList look
> >like? What kinds of objects are in the list? It sounds like your
> >"nearly identical" list returns Integers (which there's a default JSF
> >converter for), but your list here returns Supervisors, for which
> >there will be no default converter.
> >
> >
> >
> >
> >>And this is bizarre, because I have a List of SelectItems, which is
> >>nearly identical to another list that works fine elsewhere - Integer
> >>value and String label (using new SelectItem(obj.getId(),
> >>obj.getName()). As you can see in my JSP, I even produced another table
> >>to make sure that no values or labels are crazy or null. Could someone
> >>please help me?
> >>
> >>JSP snippet:
> >><h:form styleClass="crudForm">
> >> <h:commandButton styleClass="crudButton"
> >> value="#{bundle.save_changes}"
> >> action="#{ManageInterviewersBean.saveChanges}"/>
> >>
> >> <t:dataTable id="display"
> >> styleClass="table-background"
> >> headerClass="table-header"
> >> footerClass=""
> >> rowClasses="row-odd,row-even"
> >> var="item"
> >> value="#{ManageInterviewersBean.interviewers.list}"
> >> preserveDataModel="true"
> >> sortColumn="#{ManageInterviewersBean.interviewers.sort}"
> >> sortAscending="#{ManageInterviewersBean.interviewers.ascending}"
> >> preserveSort="true">
> >> <h:column>
> >> <f:facet name="header">
> >> <h:outputText value="#{bundle.supervisor}" />
> >> </f:facet>
> >>
> >> <h:selectOneMenu value="#{item.reportsTo.id}">
> >> <%-- this next line causes the error! If commented out, the
> >>next dataTable will work --%>
> >> <f:selectItems
> >>value="#{ManageInterviewersBean.supervisors.selectList}"/>
> >> <%--<f:selectItem itemValue="1" itemLabel="Your Mom"/>--%>
> >> </h:selectOneMenu>
> >>
> >> </h:column>
> >></t:dataTable>
> >>
> >><t:dataTable
> >> var="item"
> >> value="#{ManageInterviewersBean.supervisors.selectList}">
> >> <h:column rendered="#{ManageInterviewersBean.debug}">
> >> <f:facet name="header">
> >> <h:outputText value="#{bundle.id}" />
> >> </f:facet>
> >> <h:outputText value="#{item.value}"/>
> >> </h:column>
> >>
> >> <h:column>
> >> <f:facet name="header">
> >> <h:outputText value="#{bundle.name}" />
> >> </f:facet>
> >> <h:outputText value="#{item.label}"/>
> >> </h:column>
> >></t:dataTable>
> >>
> >>Thanks,
> >>
> >>--
> >>Don Tam
> >>Manager, Software Development
> >>(416)493-6111x143
> >>[EMAIL PROTECTED]
> >>
> >>
> >>
> >>
>
> --
> Don Tam
> Manager, Software Development
> (416)493-6111x143
> [EMAIL PROTECTED]
>
>