incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Lessard" <simon.lessar...@gmail.com>
Subject Re: selectedRowKeys
Date Thu, 31 Aug 2006 13:30:25 GMT
You have to use the binding attribute of the table to point on one of your
managed bean. That bean should be request scoped, if your processing is done
in a session scoped bean then inject that session bean in the request bean
and delegate the processing as binding should never be linked to session.
Anyway, in the request scoped bean, you'llhave access to the table component
and you can call .getSelectionState().getSelectedRowKeys on it.


Regards,

~ Simon

On 8/31/06, Baker,Jonathan <BakerJ@oclc.org> wrote:
>
> I just really want to know the easiest and most straightforward way to
> know what rows were selected in my table.  I have all of the code
> working once I know which rows are selected.
>
> I just really want to know if that selectedRowKeys attribute is
> functional, and if not is there an alternative to keeping a reference to
> the whole table component just to ask it which rows it thinks are
> selected.
>
>
> JB
>
> -----Original Message-----
> From: Simon Lessard [mailto:simon.lessard.3@gmail.com]
> Sent: Thursday, August 31, 2006 8:58 AM
> To: adffaces-user@incubator.apache.org
> Subject: Re: selectedRowKeys
>
> Hello Jonathan,
>
> Can you precise the use case please so we can come up with a possible
> solution?
>
>
> Thanks,
>
> ~ Simon
>
> On 8/31/06, Baker,Jonathan <BakerJ@oclc.org> wrote:
> >
> > According to the documentation:
> >
> > Name                            Type
> > Supports EL?     Description
> > selectedRowKeys org.apache.myfaces.trinidad.model.RowKeySet     Yes
> > the selection state for this component.
> >
> > I tried using this attribute for my table like this:
> >
> > selectedRowKeys="#{inbox.selectedRows}"
> >
> > Where selected rows exists as a field in my backing bean.
> >
> > private RowKeySet selectedRows;
> >
> >     public RowKeySet getSelectedRows() {
> >         return selectedRows;
> >     }
> >
> >     public void setSelectedRows(RowKeySet selectedRows) {
> >         this.selectedRows = selectedRows;
> >     }
> >
> > The problem is, neither the setter nor the getter is ever called on
> > this field when my form is submitted.
> >
> > I looked at the source code for
> > org.apache.myfaces.trinidad.component.core.data.CoreTable.java and
> > there is no reference in there for this attribute whatsoever.  I also
> > looked at the demo code, but it was not using this attribute at all,
> > and the way the demo worked seemed a bit too low level for my tastes.
>
> > Of course if there is no alternative I will proceed as the demo did,
> > but I was just curious as to why this attribute seemingly is not
> functional.
> >
> >
> > JB
> >
> >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message