myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Robinson" <andrew.rw.robin...@gmail.com>
Subject Re: java.lang.IllegalArgumentException: Value is no String
Date Wed, 29 Nov 2006 20:13:38 GMT
Found a work around -->
if "value.typeText" is set to one of the values instead of null I
don't get the exception. What I don't understand is why it works the
other times but not the 3rd AJAX call.

On 11/29/06, Andrew Robinson <andrew.rw.robinson@gmail.com> wrote:
> I am getting a bit stuck on this one exception. I have two
> selectOneRadio components within an included facelet (source file)
> that bind to a property on a facelet attribute. The value is a custom
> bean with string properties and the select items have string values,
> so no converter should be needed. What is odd is that this behavior is
> not constant.
>
> Setup:
> index.xhtml defines this component:
>         <ost:liveReportFilterDialog
>           id="liveReportFilterDlg"
>           ajaxZone="reportListZone"
>           rendered="#{liveReportBean.filterDialogVisible}"
>           onAcceptListener="#{liveReportBean.filterDialogAccepted}"
>           onCancelListener="#{liveReportBean.filterDialogCanceled}"
>           value="#{liveReportBean.filter}" />
>
> It is this "value" that I use within the "liveReportFilterDialog.xhtml":
>
>   <t:selectOneRadio
>     id="#{id}TypeOptions"
>     value="#{value.typeText}"
>     layout="pageDirection"
>     required="true">
>     <f:selectItem
>       itemLabel="#{msg.liverep_filterdlg_typefilter_graph}"
>       itemValue="osoft/livechart" />
>     <f:selectItem
>       itemLabel="#{msg.liverep_filterdlg_typefilter_report}"
>       itemValue="osoft/livereport" />
>     <f:selectItem
>       itemLabel="#{msg.liverep_filterdlg_typefilter_schedule}"
>       itemValue="osoft/liveschedule" />
>   </t:selectOneRadio>
>
> The other radio is:
>
>   <t:selectOneRadio value="#{value.ownerStr}"
>     layout="pageDirection">
>     <f:selectItem itemLabel="#{msg.liverep_filterdlg_item_all}"
>       itemValue="ALL" />
>     <f:selectItem itemLabel="#{msg.liverep_filterdlg_item_owner}"
>       itemValue="CURRENT_USER" />
>   </t:selectOneRadio>
>
>
> This dialog is usually not rendered, I change the value that the
> rendered attribte points to in an AJAX call ActionListener method.
> When I click the show, it works. Then, I click the cancel (close the
> dialog), still okay, but when I try to open the dialog again (3rd AJAX
> call) I get the following exception:
> java.lang.IllegalArgumentException: Value is no String
> (class=org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils$1,
> value=org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils$1@53c483)
> and component zfpPanel:liveReportFilterDlgDialogControl:_gridBagPanelID_3:liveReportFilterDlgTypeOptionswith
> path: {Component-Path : [Class:
> javax.faces.component.UIViewRoot,ViewId:
> /pages/liveReport/index.xhtml][Class:
> javax.faces.component.html.HtmlForm,Id: zfpForm][Class:
> com.outlooksoft.cpm.faces.controls.HtmlGridBagPanel,Id:
> zfpPanel][Class:
> com.outlooksoft.cpm.faces.controls.HtmlGridBagCell,Id:
> zfpContentCell][Class:
> com.outlooksoft.cpm.faces.controls.UIAjaxZone,Id: zfpBodyZone][Class:
> com.outlooksoft.cpm.livereport.controls.HtmlReportFilterDialog,Id:
> liveReportFilterDlg][Class:
> com.outlooksoft.cpm.faces.controls.UIDialog,Id:
> liveReportFilterDlgDialogControl][Class:
> com.outlooksoft.cpm.faces.controls.HtmlGridBagPanel,Id:
> _gridBagPanelID_3][Class:
> com.outlooksoft.cpm.faces.controls.HtmlGridBagCell,Id:
> _gridBagCellID_29][Class:
> org.apache.myfaces.component.html.ext.HtmlSelectOneRadio,Id:
> liveReportFilterDlgTypeOptions]} does not have a Converter
>         at org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.getConvertedStringValue(RendererUtils.java:536)
>         at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlRadioRendererBase.encodeEnd(HtmlRadioRendererBase.java:93)
>         at org.apache.myfaces.renderkit.html.ext.HtmlRadioRenderer.encodeEnd(HtmlRadioRenderer.java:71)
>         at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
>         at org.ajaxanywhere.jsf.ZoneUIComponent.renderComponent(ZoneUIComponent.java:90)
> ...
>
> The "ownerStr" is "ALL" and the "typeText" is null. I have been unable
> to determine why it fails on this 3rd call and not 1 or 2. If I
> refresh the page, the dialog is rendered & shown fine. I verified that
> it isn't a problem with the message bundle (msg), as it still happens
> if I hard code the itemLabel values.
>
> I am on a 1.1.3 patched version of both Tomahawk and Core.
>
> Any ideas? (also, I haven't yet found the RendererUtils$1 anonymous
> class yet to find where it is coming from)
>
> Thanks,
> -Andrew
>

Mime
View raw message