You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Ryan Holmes (JIRA)" <ta...@jakarta.apache.org> on 2006/04/29 23:30:37 UTC
[jira] Created: (TAPESTRY-933) Add getRowCount() to ITableModel
interface
Add getRowCount() to ITableModel interface
------------------------------------------
Key: TAPESTRY-933
URL: http://issues.apache.org/jira/browse/TAPESTRY-933
Project: Tapestry
Type: Improvement
Components: Contrib
Versions: 4.0.1
Environment: N/A
Reporter: Ryan Holmes
Priority: Minor
All classes that implement ITableModel already have a getRowCount() method. It would be useful to call this method from subclasses of AbstractTableViewComponent, which can access the underlying ITableModel through ITableModelSource.getTableModelSource().getTableModel().
My specific use case is a "PageInfo" component included in a custom Table component that displays something along the lines of "Viewing items x - x of xx." Because any combination of "source" and "columns" parameters to a TableView component results in an AbstractTableModel (which defines getRowCount() as protected), I currently cast getTableModelSource().getTableModel() to an AbstractTableModel and use reflection to call getRowCount(). This works for the range of data sources I currently use with TableView, but is obviously an ugly hack.
Adding getRowCount() to ITableModel would require the following additional changes:
1. Make getRowCount() in AbstractTableModel public.
2. Mage getRowCount() in BasicTableModelWrap public.
3. Make getRowCount() in SqlTableModel public.
I am aware that repeated calls to getRowCount() could create performance issues, especially for database-backed table models such as IBasicTableModel. However, caching the row count can be handled easily in an IBasicTableModel class and is outside the scope of the Table components anyway.
If a change to the ITableModel interface is considered too radical in the near term, a workaround would be to change the access modifier of AbstractTableModel.getRowCount() from protected to public. This would provide easy access to getRowCount in most cases.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
[jira] Updated: (TAPESTRY-933) Add getRowCount() to ITableModel
interface
Posted by "Jesse Kuhnert (JIRA)" <ta...@jakarta.apache.org>.
[ http://issues.apache.org/jira/browse/TAPESTRY-933?page=all ]
Jesse Kuhnert updated TAPESTRY-933:
-----------------------------------
Fix Version/s: 4.1.2
> Add getRowCount() to ITableModel interface
> ------------------------------------------
>
> Key: TAPESTRY-933
> URL: http://issues.apache.org/jira/browse/TAPESTRY-933
> Project: Tapestry
> Issue Type: Improvement
> Components: Contrib
> Affects Versions: 4.0.1
> Environment: N/A
> Reporter: Ryan Holmes
> Priority: Minor
> Fix For: 4.1.2
>
>
> All classes that implement ITableModel already have a getRowCount() method. It would be useful to call this method from subclasses of AbstractTableViewComponent, which can access the underlying ITableModel through ITableModelSource.getTableModelSource().getTableModel().
> My specific use case is a "PageInfo" component included in a custom Table component that displays something along the lines of "Viewing items x - x of xx." Because any combination of "source" and "columns" parameters to a TableView component results in an AbstractTableModel (which defines getRowCount() as protected), I currently cast getTableModelSource().getTableModel() to an AbstractTableModel and use reflection to call getRowCount(). This works for the range of data sources I currently use with TableView, but is obviously an ugly hack.
> Adding getRowCount() to ITableModel would require the following additional changes:
> 1. Make getRowCount() in AbstractTableModel public.
> 2. Mage getRowCount() in BasicTableModelWrap public.
> 3. Make getRowCount() in SqlTableModel public.
> I am aware that repeated calls to getRowCount() could create performance issues, especially for database-backed table models such as IBasicTableModel. However, caching the row count can be handled easily in an IBasicTableModel class and is outside the scope of the Table components anyway.
> If a change to the ITableModel interface is considered too radical in the near term, a workaround would be to change the access modifier of AbstractTableModel.getRowCount() from protected to public. This would provide easy access to getRowCount in most cases.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Resolved: (TAPESTRY-933) Add getRowCount() to ITableModel
interface
Posted by "Jesse Kuhnert (JIRA)" <de...@tapestry.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-933?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jesse Kuhnert resolved TAPESTRY-933.
------------------------------------
Resolution: Fixed
Assignee: Jesse Kuhnert
> Add getRowCount() to ITableModel interface
> ------------------------------------------
>
> Key: TAPESTRY-933
> URL: https://issues.apache.org/jira/browse/TAPESTRY-933
> Project: Tapestry
> Issue Type: Improvement
> Components: Contrib
> Affects Versions: 4.0.1
> Environment: N/A
> Reporter: Ryan Holmes
> Assignee: Jesse Kuhnert
> Priority: Minor
> Fix For: 4.1.2
>
>
> All classes that implement ITableModel already have a getRowCount() method. It would be useful to call this method from subclasses of AbstractTableViewComponent, which can access the underlying ITableModel through ITableModelSource.getTableModelSource().getTableModel().
> My specific use case is a "PageInfo" component included in a custom Table component that displays something along the lines of "Viewing items x - x of xx." Because any combination of "source" and "columns" parameters to a TableView component results in an AbstractTableModel (which defines getRowCount() as protected), I currently cast getTableModelSource().getTableModel() to an AbstractTableModel and use reflection to call getRowCount(). This works for the range of data sources I currently use with TableView, but is obviously an ugly hack.
> Adding getRowCount() to ITableModel would require the following additional changes:
> 1. Make getRowCount() in AbstractTableModel public.
> 2. Mage getRowCount() in BasicTableModelWrap public.
> 3. Make getRowCount() in SqlTableModel public.
> I am aware that repeated calls to getRowCount() could create performance issues, especially for database-backed table models such as IBasicTableModel. However, caching the row count can be handled easily in an IBasicTableModel class and is outside the scope of the Table components anyway.
> If a change to the ITableModel interface is considered too radical in the near term, a workaround would be to change the access modifier of AbstractTableModel.getRowCount() from protected to public. This would provide easy access to getRowCount in most cases.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Commented: (TAPESTRY-933) Add getRowCount() to ITableModel
interface
Posted by "Ryan Holmes (JIRA)" <ta...@jakarta.apache.org>.
[ http://issues.apache.org/jira/browse/TAPESTRY-933?page=comments#action_12427966 ]
Ryan Holmes commented on TAPESTRY-933:
--------------------------------------
Is there any reason not to make this change? It would be great to get some feedback...
> Add getRowCount() to ITableModel interface
> ------------------------------------------
>
> Key: TAPESTRY-933
> URL: http://issues.apache.org/jira/browse/TAPESTRY-933
> Project: Tapestry
> Issue Type: Improvement
> Components: Contrib
> Affects Versions: 4.0.1
> Environment: N/A
> Reporter: Ryan Holmes
> Priority: Minor
>
> All classes that implement ITableModel already have a getRowCount() method. It would be useful to call this method from subclasses of AbstractTableViewComponent, which can access the underlying ITableModel through ITableModelSource.getTableModelSource().getTableModel().
> My specific use case is a "PageInfo" component included in a custom Table component that displays something along the lines of "Viewing items x - x of xx." Because any combination of "source" and "columns" parameters to a TableView component results in an AbstractTableModel (which defines getRowCount() as protected), I currently cast getTableModelSource().getTableModel() to an AbstractTableModel and use reflection to call getRowCount(). This works for the range of data sources I currently use with TableView, but is obviously an ugly hack.
> Adding getRowCount() to ITableModel would require the following additional changes:
> 1. Make getRowCount() in AbstractTableModel public.
> 2. Mage getRowCount() in BasicTableModelWrap public.
> 3. Make getRowCount() in SqlTableModel public.
> I am aware that repeated calls to getRowCount() could create performance issues, especially for database-backed table models such as IBasicTableModel. However, caching the row count can be handled easily in an IBasicTableModel class and is outside the scope of the Table components anyway.
> If a change to the ITableModel interface is considered too radical in the near term, a workaround would be to change the access modifier of AbstractTableModel.getRowCount() from protected to public. This would provide easy access to getRowCount in most cases.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org