users@woodstock.java.net

Re: Woodstock - TableRowGroup

From: Indu Kurup <indukurup_at_gmail.com>
Date: Wed, 19 Sep 2007 16:52:12 -0700

I am afraid, it's still not working and I am getting this exception now.

javax.faces.FacesException: javax.el.PropertyNotFoundException:
/searchResults.xhtml @32,151 text="#{item.value.itemName}":
java.lang.IllegalArgumentException: itemName

……..

Caused by: java.lang.IllegalArgumentException: itemName

               at
com.sun.data.provider.impl.ObjectListDataProvider.getFieldKey(ObjectListDataProvider.java:463)





itemName is a property of my Item class.

Do I have to wrap the list of objects into an ObjectListDataProvider
explicitly?

Thanks.


On 9/19/07, Dan Labrecque <Dan.Labrecque_at_sun.com> wrote:
>
> Your value expression should be #{item.value.itemName}. The "value"
> keyword is a DataProvider convention, indicating that this is not a method
> binding to a backing bean.
>
> Dan
>
> Indu Kurup wrote:
>
> This is what I was trying to implement where *backingBean.itemsList* is
> just a list of item objects.
>
>
> < webuijsf:tableRowGroup id= "rowGroup1" sourceData= "#{
> backingBean.itemsList}" sourceVar= "item">
>
> < webuijsf:tableColumn id= "col2">
>
> < webuijsf:staticText text= "#{item.itemName}"/>
>
> </ webuijsf:tableColumn>
>
> </ webuijsf:tableRowGroup>
>
>
>
> And I am getting this exception
>
> javax.faces.FacesException: javax.el.PropertyNotFoundException: /searchResults.xhtml @32,125 text="#{item.itemName}": Property 'itemName' not found on type
> com.sun.data.provider.impl.TableRowDataProvider
>
> at javax.faces.component.UICommand.getValue(UICommand.java:236)
> Am I missing something here?
>
> Thanks !
>
> Date: Wed, 19 Sep 2007 10:28:47 -0400
> From: Dan Labrecque <Dan.Labrecque_at_Sun.COM>
> Subject: Woodstock - TableRowGroup
>
> In addition to a DataProvider, you can also provide a array, List, or
> Object. The TableRowGroup will simply wrap that in either a
> ObjectListDataProvider or ObjectArrayDataProvider. (TableRowGroup always
>
> uses a DataProvider to access data.) You can obtain the underlying
> DataProvider by calling the getTableDataProvider() of TableRowGroup.
>
> Dan
>
> Indu Kurup wrote:
> >
> > I was trying to implement a simple table using Woodstock components.
>
> > Could anyone please tell me if it is always a requirement to have a
> > TableDataProvider instance as the sourceData, isn't there a way by
> > which I can simply call a collection in the tableRowGroup? I
>
> > appreciate any help.
> >
> > Thanks.
>
>
>
>