Re: How to add footer section using DataTable
Yes you are right, we can do that. Thanks! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-add-footer-section-using-DataTable-tp2541058p2542678.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to add footer section using DataTable
I am using DataTable to display a table. I want to add some buttons to footer section. How do I do that? Currently it just shows empty tfoot elements in my html. Here is the sample code of the DataTable: DataTable table = new DataTable("datatable", columns, new CalculationInfoProvider(), 1); add(table); -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-add-footer-section-using-DataTable-tp2541058p2541058.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to add footer section using DataTable
You could use something like : table.addBottomToolbar(new YourFooterToolbar(...)); where YourFooterToolbar extends AbstractToolbar regards, Gabriel. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-add-footer-section-using-DataTable-tp2541058p2541390.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: retrieving item model object in a form using datatable
I think this will do what you want: https://wicketopia.svn.sourceforge.net/svnroot/wicketopia/trunk/example/src/main/java/org/wicketopia/example/web/page/HomePage.java On Thu, Sep 25, 2008 at 10:32 AM, zaheers <[EMAIL PROTECTED]> wrote: > > I am using a Datatable and DataProvider classes in a search form for paging > and sorting. I need to add a "link" column to display the item detail panel > upon clicking of the link. I am not sure how to obtain the model of an > individual item when using the datatable. Would you pl. provide some > pointers. Code and screenshot attached. > http://www.nabble.com/file/p19670783/screen-shot.doc screen-shot.doc > http://www.nabble.com/file/p19670783/SearchPanel.txt SearchPanel.txt > -- > View this message in context: > http://www.nabble.com/retrieving-item-model-object-in-a-form-using-datatable-tp19670783p19670783.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
retrieving item model object in a form using datatable
I am using a Datatable and DataProvider classes in a search form for paging and sorting. I need to add a "link" column to display the item detail panel upon clicking of the link. I am not sure how to obtain the model of an individual item when using the datatable. Would you pl. provide some pointers. Code and screenshot attached. http://www.nabble.com/file/p19670783/screen-shot.doc screen-shot.doc http://www.nabble.com/file/p19670783/SearchPanel.txt SearchPanel.txt -- View this message in context: http://www.nabble.com/retrieving-item-model-object-in-a-form-using-datatable-tp19670783p19670783.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using DataTable
will call Service >>>>> layer/DAO >>>>> to >>>>> do the actual query like this Select * from Employees where firstName >>>>> Like >>>>> 'ABC' and lastName Like 'XYZ' >>>>> >>>>> * finally in model ...I will call the CustomLoadableDetachableModel and >>>>> its >>>>> load() method will load the actual Employee model for each item that >>>>> will >>>>> be displayed on first page of the list being rendered in data table. >>>>> >>>>> >>>>> It seems that there are too many queries in case of datatable. If the >>>>> result >>>>> set has thousands of records and we are displaying 100 per page then it >>>>> will >>>>> do 100+ queries to render all the items. >>>>> >>>>> Questions: >>>>> 1. Did I sum up about DataTable correctly? >>>> >>>> no, there are only two queries per page render of datatable. >>>> >>>>> If yes, Won't this be a >>>>> bottleneck considering the number of queries? >>>> >>>>> 2. Is there a better way of doing this? >>>> >>>> not until someone finds one. >>>> >>>> -igor >>>> >>>>> >>>>> Thanks, >>>>> RG >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> View this message in context: >>>>> http://www.nabble.com/Using-DataTable-tp17543606p17543606.html >>>>> Sent from the Wicket - User mailing list archive at Nabble.com. >>>>> >>>>> >>>>> - >>>>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>>>> For additional commands, e-mail: [EMAIL PROTECTED] >>>>> >>>>> >>>> >>>> - >>>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>>> For additional commands, e-mail: [EMAIL PROTECTED] >>>> >>>> >>>> >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/Using-DataTable-tp17543606p17545174.html >>> Sent from the Wicket - User mailing list archive at Nabble.com. >>> >>> >>> - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > -- > View this message in context: > http://www.nabble.com/Using-DataTable-tp17543606p17545978.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using DataTable
Thanks for the reply... Herre is What I have... iterator() loads the list of employee instances public Iterator iterator(int first, int count) { List employees = empService.getEmployees(); return employees.iterator(); } in model() you give each of your detachable models an instance of the employee, public IModel model(Object object) { return new EmployeeModel((Employee) object, empService); } and in EmployeeModel.java public class EmployeeModel extends LoadableDetachableModel { private EmployeeService empService; private Long id; public EmployeeModel(Employee emp, EmployeeService empService) { super(emp); this.id = emp.getId(); this.empService= empService; } protected Object load() { return empService.getEmployee(String.valueOf(id)); } } So, I my question is: when load() gets called from model() then where should it look it up...as you said it does not need to go to database againbecause we already have the object. But, we did not store the object anywhereso that empService.getEmployee(String.valueOf(id)); can go and look it up. When I retrieved Object in iterator() it was stored locally. Where should I store it...so that above method can read it again? Thanks for your help, RG igor.vaynberg wrote: > > i dont really get what the problem is > > iterator() loads the list of employee instances > > in model() you give each of your detachable models an instance of the > employee, so during that request the model doesnt need to load > anything because its already there... > > -igor > > On Thu, May 29, 2008 at 1:31 PM, nanotech <[EMAIL PROTECTED]> wrote: >> >> Thanks Igor for your reply. >> >> So, what do you suggest I should do: >> >> 1. After making the call in iterator() method Should I store the result >> object (Employee object ) in EmployeeDAO and then refer it later when I >> call >>public IModel model(Object object) { >>return new DetachableEmployeeModel((Employee)object); >>} >> and then look it up (by employee Id) from that stored object? >> >> 2. Do I need to take care of synchronization when I store the object? >> >> Any other suggestions? >> >> Thanks, >> RG >> >> >> >> >> >> igor.vaynberg wrote: >>> >>> On Thu, May 29, 2008 at 12:09 PM, nanotech <[EMAIL PROTECTED]> >>> wrote: >>>> >>>> Hi, >>>> I have a search form (in a panel)with various search fields(as text >>>> fields) >>>> on it. User should be able to fill in any number of search parameters >>>> and >>>> the results are to be displayed in table (with pagenation + sorting >>>> capablity on columns) in a different panel on the same page under the >>>> search >>>> panel. >>>> >>>> I started looking at DataTable. It seems a option that will solve my >>>> need. >>>> >>>> Looking at the datatable example on >>>> http://www.wicket-library.com/wicket-examples/repeater/ >>>> >>>> I observed that the following methods get called in the order >>>> >>>> 1. size() from CustomSortableDataProvider. >>>> 2. iterator() from CustomSortableDataProvider >>>> 3. load() from CustomLoadableDetachableModel. >>>> >>>> If I understand it correctly:-(Please correct me if I am wrong) >>>> * size() requires , the number of records that provider will be >>>> working >>>> with. So, in above case i'll have to make query thrrough service layer >>>> /DAO >>>> like this Select count(*) from Employees where firstName Like 'ABC' >>>> and >>>> lastName Like 'XYZ' >>>> >>>> * iterator(final int first, final int count) will call Service >>>> layer/DAO >>>> to >>>> do the actual query like this Select * from Employees where firstName >>>> Like >>>> 'ABC' and lastName Like 'XYZ' >>>> >>>> * finally in model ...I will call the CustomLoadableDetachableModel and >>>> its >>>> load() method will load the actual Employee model for each item that >>>> will >>>> be displayed on first page of the list being rendered in data table. >>>> >>>> >>>> It seems that there are too many queries in case of datatable. If the >>>> result >>>> set has thousands of re
Re: Using DataTable
i dont really get what the problem is iterator() loads the list of employee instances in model() you give each of your detachable models an instance of the employee, so during that request the model doesnt need to load anything because its already there... -igor On Thu, May 29, 2008 at 1:31 PM, nanotech <[EMAIL PROTECTED]> wrote: > > Thanks Igor for your reply. > > So, what do you suggest I should do: > > 1. After making the call in iterator() method Should I store the result > object (Employee object ) in EmployeeDAO and then refer it later when I call >public IModel model(Object object) { >return new DetachableEmployeeModel((Employee)object); >} > and then look it up (by employee Id) from that stored object? > > 2. Do I need to take care of synchronization when I store the object? > > Any other suggestions? > > Thanks, > RG > > > > > > igor.vaynberg wrote: >> >> On Thu, May 29, 2008 at 12:09 PM, nanotech <[EMAIL PROTECTED]> >> wrote: >>> >>> Hi, >>> I have a search form (in a panel)with various search fields(as text >>> fields) >>> on it. User should be able to fill in any number of search parameters >>> and >>> the results are to be displayed in table (with pagenation + sorting >>> capablity on columns) in a different panel on the same page under the >>> search >>> panel. >>> >>> I started looking at DataTable. It seems a option that will solve my >>> need. >>> >>> Looking at the datatable example on >>> http://www.wicket-library.com/wicket-examples/repeater/ >>> >>> I observed that the following methods get called in the order >>> >>> 1. size() from CustomSortableDataProvider. >>> 2. iterator() from CustomSortableDataProvider >>> 3. load() from CustomLoadableDetachableModel. >>> >>> If I understand it correctly:-(Please correct me if I am wrong) >>> * size() requires , the number of records that provider will be working >>> with. So, in above case i'll have to make query thrrough service layer >>> /DAO >>> like this Select count(*) from Employees where firstName Like 'ABC' and >>> lastName Like 'XYZ' >>> >>> * iterator(final int first, final int count) will call Service layer/DAO >>> to >>> do the actual query like this Select * from Employees where firstName >>> Like >>> 'ABC' and lastName Like 'XYZ' >>> >>> * finally in model ...I will call the CustomLoadableDetachableModel and >>> its >>> load() method will load the actual Employee model for each item that >>> will >>> be displayed on first page of the list being rendered in data table. >>> >>> >>> It seems that there are too many queries in case of datatable. If the >>> result >>> set has thousands of records and we are displaying 100 per page then it >>> will >>> do 100+ queries to render all the items. >>> >>> Questions: >>> 1. Did I sum up about DataTable correctly? >> >> no, there are only two queries per page render of datatable. >> >>> If yes, Won't this be a >>> bottleneck considering the number of queries? >> >>> 2. Is there a better way of doing this? >> >> not until someone finds one. >> >> -igor >> >>> >>> Thanks, >>> RG >>> >>> >>> >>> >>> >>> >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/Using-DataTable-tp17543606p17543606.html >>> Sent from the Wicket - User mailing list archive at Nabble.com. >>> >>> >>> - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > -- > View this message in context: > http://www.nabble.com/Using-DataTable-tp17543606p17545174.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using DataTable
Thanks Igor for your reply. So, what do you suggest I should do: 1. After making the call in iterator() method Should I store the result object (Employee object ) in EmployeeDAO and then refer it later when I call public IModel model(Object object) { return new DetachableEmployeeModel((Employee)object); } and then look it up (by employee Id) from that stored object? 2. Do I need to take care of synchronization when I store the object? Any other suggestions? Thanks, RG igor.vaynberg wrote: > > On Thu, May 29, 2008 at 12:09 PM, nanotech <[EMAIL PROTECTED]> > wrote: >> >> Hi, >> I have a search form (in a panel)with various search fields(as text >> fields) >> on it. User should be able to fill in any number of search parameters >> and >> the results are to be displayed in table (with pagenation + sorting >> capablity on columns) in a different panel on the same page under the >> search >> panel. >> >> I started looking at DataTable. It seems a option that will solve my >> need. >> >> Looking at the datatable example on >> http://www.wicket-library.com/wicket-examples/repeater/ >> >> I observed that the following methods get called in the order >> >> 1. size() from CustomSortableDataProvider. >> 2. iterator() from CustomSortableDataProvider >> 3. load() from CustomLoadableDetachableModel. >> >> If I understand it correctly:-(Please correct me if I am wrong) >> * size() requires , the number of records that provider will be working >> with. So, in above case i'll have to make query thrrough service layer >> /DAO >> like this Select count(*) from Employees where firstName Like 'ABC' and >> lastName Like 'XYZ' >> >> * iterator(final int first, final int count) will call Service layer/DAO >> to >> do the actual query like this Select * from Employees where firstName >> Like >> 'ABC' and lastName Like 'XYZ' >> >> * finally in model ...I will call the CustomLoadableDetachableModel and >> its >> load() method will load the actual Employee model for each item that >> will >> be displayed on first page of the list being rendered in data table. >> >> >> It seems that there are too many queries in case of datatable. If the >> result >> set has thousands of records and we are displaying 100 per page then it >> will >> do 100+ queries to render all the items. >> >> Questions: >> 1. Did I sum up about DataTable correctly? > > no, there are only two queries per page render of datatable. > >> If yes, Won't this be a >> bottleneck considering the number of queries? > >> 2. Is there a better way of doing this? > > not until someone finds one. > > -igor > >> >> Thanks, >> RG >> >> >> >> >> >> >> >> -- >> View this message in context: >> http://www.nabble.com/Using-DataTable-tp17543606p17543606.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Using-DataTable-tp17543606p17545174.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using DataTable
On Thu, May 29, 2008 at 12:09 PM, nanotech <[EMAIL PROTECTED]> wrote: > > Hi, > I have a search form (in a panel)with various search fields(as text fields) > on it. User should be able to fill in any number of search parameters and > the results are to be displayed in table (with pagenation + sorting > capablity on columns) in a different panel on the same page under the search > panel. > > I started looking at DataTable. It seems a option that will solve my need. > > Looking at the datatable example on > http://www.wicket-library.com/wicket-examples/repeater/ > > I observed that the following methods get called in the order > > 1. size() from CustomSortableDataProvider. > 2. iterator() from CustomSortableDataProvider > 3. load() from CustomLoadableDetachableModel. > > If I understand it correctly:-(Please correct me if I am wrong) > * size() requires , the number of records that provider will be working > with. So, in above case i'll have to make query thrrough service layer /DAO > like this Select count(*) from Employees where firstName Like 'ABC' and > lastName Like 'XYZ' > > * iterator(final int first, final int count) will call Service layer/DAO to > do the actual query like this Select * from Employees where firstName Like > 'ABC' and lastName Like 'XYZ' > > * finally in model ...I will call the CustomLoadableDetachableModel and its > load() method will load the actual Employee model for each item that will > be displayed on first page of the list being rendered in data table. > > > It seems that there are too many queries in case of datatable. If the result > set has thousands of records and we are displaying 100 per page then it will > do 100+ queries to render all the items. > > Questions: > 1. Did I sum up about DataTable correctly? no, there are only two queries per page render of datatable. > If yes, Won't this be a > bottleneck considering the number of queries? > 2. Is there a better way of doing this? not until someone finds one. -igor > > Thanks, > RG > > > > > > > > -- > View this message in context: > http://www.nabble.com/Using-DataTable-tp17543606p17543606.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using DataTable
Hi, I have a search form (in a panel)with various search fields(as text fields) on it. User should be able to fill in any number of search parameters and the results are to be displayed in table (with pagenation + sorting capablity on columns) in a different panel on the same page under the search panel. I started looking at DataTable. It seems a option that will solve my need. Looking at the datatable example on http://www.wicket-library.com/wicket-examples/repeater/ I observed that the following methods get called in the order 1. size() from CustomSortableDataProvider. 2. iterator() from CustomSortableDataProvider 3. load() from CustomLoadableDetachableModel. If I understand it correctly:-(Please correct me if I am wrong) * size() requires , the number of records that provider will be working with. So, in above case i'll have to make query thrrough service layer /DAO like this Select count(*) from Employees where firstName Like 'ABC' and lastName Like 'XYZ' * iterator(final int first, final int count) will call Service layer/DAO to do the actual query like this Select * from Employees where firstName Like 'ABC' and lastName Like 'XYZ' * finally in model ...I will call the CustomLoadableDetachableModel and its load() method will load the actual Employee model for each item that will be displayed on first page of the list being rendered in data table. It seems that there are too many queries in case of datatable. If the result set has thousands of records and we are displaying 100 per page then it will do 100+ queries to render all the items. Questions: 1. Did I sum up about DataTable correctly? If yes, Won't this be a bottleneck considering the number of queries? 2. Is there a better way of doing this? Thanks, RG -- View this message in context: http://www.nabble.com/Using-DataTable-tp17543606p17543606.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]