In order to convert the string returned by the selectOneMenu, it must
know what datatype to convert it to. It does this by using
reflection-like behavior on the value binding (or looking it up in the
value binding -- same thing in practice). Since there was no valid
return value for the value setter, there was no way to determine what
type to convert the resulting data into.
On the other hand, I don't know why the manually inserted select item worked :)
On 11/16/05, Don Tam <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've found the problem, but it seems very odd to me. The issue was
> actually (also?) the fact that the underlying bound property,
> item.reportsTo, was null. I think the error message should indicate
> that instead of a converter error? And why did it work with a manually
> inserted (in the jsp) selectItem instead?
>
> Thanks,
>
> Don Tam 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]
>
>