You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Behrang Saeedzadeh <be...@gmail.com> on 2006/12/18 10:52:58 UTC
h:dataTable and h:commandLink: once again :-(
Hi all,
What is the best practice to show h:commandLinks inside a h:dataTable
whose data are
fetched from a database (say, bound to #{TableBean.rows})?
As you know, when I click on a commandLink inside a h:dataTable, the
TableBean's getRows is invoked again and this causes some serious
usability problems.
I don't like storing the data in session scope. Also I cannot fetch
the data on every
request, because the result of the query that fetches data (select *
from FOO) can
change, as new rows might have been inserted to/removed from/updated
in the FOO table
in the time between the calls.
t:saveState seems to be network-bandwidth-hungry because it serializes the
#{TableBean.rows} to the client, and the client transfers it back to
the server on form
submit (am I right?)
Regards,
Behi
--
"Science is a differential equation. Religion is a boundary condition"
- Alan Turing
Behrang Saeedzadeh
http://www.jroller.com/page/behrangsa
http://my.opera.com/behrangsa
Re: h:dataTable and h:commandLink: once again :-(
Posted by Behrang Saeedzadeh <be...@gmail.com>.
David,
Thanks for the response. Actually I am using (evaluating) Quipukit's
TreeTable component which behaves like the standard DataTable in this
regard. The component is damn very cool and elegant but so far it has
left me with no solution for the problem I am facing.
I will search the 'net more and hit back to the mailing list again
seeking for more advice.
Regards,
Behi
On 12/18/06, David Delbecq <de...@oma.be> wrote:
> My suggestions:
>
> 1) with a bit of javascript
> <form>
> <inputfield "selectedRowId"/>
> <button for action/>
>
> <datatable>
> <commandlink
> onclick="setSelectedRowId('#{dbrow.Id}');call_submit_on_button_action();return
> false;"/>
> </datatable></form>
>
> 2) Create you own datatable component for showing datas, a component
> that will not iterate when it broadcasts for action.
>
> 3) Look in the net for a 'select row' jsf and datatable, there are
> plenty of tips there using javascript to choose a row to perform an
> action on.
>
> 4) check the net (tomahawk, myfaces sandbox, adf faces, trinidad?) for
> an existing component that goes around your problem (am sure such
> component has already been developped)
>
> Note datatable was meaned to show datas in ouput, not to create N input
> component. At least that how i see limitations on datatable.
> Behrang Saeedzadeh a écrit :
> > Hi all,
> >
> > What is the best practice to show h:commandLinks inside a h:dataTable
> > whose data are
> > fetched from a database (say, bound to #{TableBean.rows})?
> >
> > As you know, when I click on a commandLink inside a h:dataTable, the
> > TableBean's getRows is invoked again and this causes some serious
> > usability problems.
> >
> > I don't like storing the data in session scope. Also I cannot fetch
> > the data on every
> > request, because the result of the query that fetches data (select *
> > from FOO) can
> > change, as new rows might have been inserted to/removed from/updated
> > in the FOO table
> > in the time between the calls.
> >
> > t:saveState seems to be network-bandwidth-hungry because it serializes
> > the
> > #{TableBean.rows} to the client, and the client transfers it back to
> > the server on form
> > submit (am I right?)
> >
> > Regards,
> > Behi
> >
>
>
--
"Science is a differential equation. Religion is a boundary condition"
- Alan Turing
Behrang Saeedzadeh
http://www.jroller.com/page/behrangsa
http://my.opera.com/behrangsa
Re: h:dataTable and h:commandLink: once again :-(
Posted by David Delbecq <de...@oma.be>.
My suggestions:
1) with a bit of javascript
<form>
<inputfield "selectedRowId"/>
<button for action/>
<datatable>
<commandlink
onclick="setSelectedRowId('#{dbrow.Id}');call_submit_on_button_action();return
false;"/>
</datatable></form>
2) Create you own datatable component for showing datas, a component
that will not iterate when it broadcasts for action.
3) Look in the net for a 'select row' jsf and datatable, there are
plenty of tips there using javascript to choose a row to perform an
action on.
4) check the net (tomahawk, myfaces sandbox, adf faces, trinidad?) for
an existing component that goes around your problem (am sure such
component has already been developped)
Note datatable was meaned to show datas in ouput, not to create N input
component. At least that how i see limitations on datatable.
Behrang Saeedzadeh a écrit :
> Hi all,
>
> What is the best practice to show h:commandLinks inside a h:dataTable
> whose data are
> fetched from a database (say, bound to #{TableBean.rows})?
>
> As you know, when I click on a commandLink inside a h:dataTable, the
> TableBean's getRows is invoked again and this causes some serious
> usability problems.
>
> I don't like storing the data in session scope. Also I cannot fetch
> the data on every
> request, because the result of the query that fetches data (select *
> from FOO) can
> change, as new rows might have been inserted to/removed from/updated
> in the FOO table
> in the time between the calls.
>
> t:saveState seems to be network-bandwidth-hungry because it serializes
> the
> #{TableBean.rows} to the client, and the client transfers it back to
> the server on form
> submit (am I right?)
>
> Regards,
> Behi
>