users@woodstock.java.net

Re: Woodstock - TableRowGroup

From: Jason Suplizio <suplizio_at_gmail.com>
Date: Thu, 20 Sep 2007 14:35:41 -0700

When Seam wraps the List object using the @DataModel the object is now a
ListDataModel object - you need then to call getWrappedData as the source
data for the table row group.


On 9/20/07, Dan Labrecque <Dan.Labrecque_at_sun.com> wrote:
>
> I've personally tested the table with JBoss and it runs fine. I'm not
> familiar with Seam, but it's probably not a good idea to evaluate the
> expression syntax yourself. The expression is evaluated by a JSF property
> resolver and is based on the current row of the DataProvider.
>
> Dan
>
> Indu Kurup wrote:
>
> Thank you for your help, my issue was because I was using JBoss Seam's
> Factory component pattern to expose the list to the jsf. And correct me if I
> am wrong, it looks like this won't work well with webuijsf:tableRowGroup.
>
> Thanks !
>
> On 9/20/07, Dan Labrecque < Dan.Labrecque_at_sun.com> wrote:
> >
> > Your itemName property must reference a field key in the DataProvider.
> > Whether you provide an ObjectListDataProvider or List (ultimately wrapped in
> > ObjectListDataProvider), the objects within must have getter methods to
> > retrieve the data. Please see the table, tableRowGroup, and tableColumn
> > examples in the TLD docs.
> >
> > Dan
> >
> > Indu Kurup wrote:
> >
> > 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.
> > >
> > >
> > >
> > >
> >
> >
>
>


-- 
"Be the change you wish to see in the world." - Mahatma Ganhdi
"Never think that war, no matter how necessary, nor how justified, is not a
crime. "
Earnest Hemingway