myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kienenberger" <mkien...@gmail.com>
Subject Re: SelectItem value property of type Integer
Date Thu, 25 Jan 2007 17:11:54 GMT
The value can be anything you like if there's a converter.
If there's no converter, then the value must be a string.

You can either explicitly force the converter for that input to be an
IntegerConverter, or, if the setter for the value binding is of type
int or Integer, I think it will automatically use the
IntegerConverter.

Posting your page code and your accessors would be helpful if this
information isn't enough to solve your problem.

On 1/25/07, urswagner@bluemail.ch <urswagner@bluemail.ch> wrote:
>
> Hello
>
> In f:selectItems in get a strange exception.
>
> Must the value property of type String? This is a bit strange
> because in the examples also
> value of type Integer is allowed. I think it should also be
> allowed.
>
> Caused by: java.lang.IllegalArgumentException: Value is no String
> and component _idJsp0:_idJsp1with path: {Component-Path : [Class:
> javax.faces.component.UIViewRoot,ViewId: /sellarticle.jsp][Class:
> javax.faces.component.html.HtmlForm,Id: _idJsp0][Class: javax.faces.
> component.html.HtmlSelectOneMenu,Id: _idJsp1]} does not have a
> Converter
>         at org.apache.myfaces.shared_impl.renderkit.RendererUtils.
> getConvertedStringValue(RendererUtils.java:536)
>         at org.apache.myfaces.shared_impl.renderkit.RendererUtils.
> getConvertedStringValue(RendererUtils.java:555)
>         at org.apache.myfaces.shared_impl.renderkit.html.HtmlRendererUtils.
> renderSelectOptions(HtmlRendererUtils.java:397)
>         at org.apache.myfaces.shared_impl.renderkit.html.HtmlRendererUtils.
> internalRenderSelect(HtmlRendererUtils.java:297)
>         at org.apache.myfaces.shared_impl.renderkit.html.HtmlRendererUtils.
> renderMenu(HtmlRendererUtils.java:251)
>         at org.apache.myfaces.shared_impl.renderkit.html.
> HtmlMenuRendererBase.encodeEnd(HtmlMenuRendererBase.java:54)
>
>

Mime
View raw message