Question
This bug should be fixed, if TablePlugin.pm is replaced with the attached version.
Initsort argument was obtained only from first %TABLE(initsort)% on topic. Other tables with initsorts were sorted with args of first one.
Tested:
- TWiki version: 20011201
- Web server: Apache of course (1.3.19)
- Server OS: SuSe Linux 2.4.4
- Perl v5.6.0
- Web browser: IE5
- Client OS: Windows NT
--
TWikiGuest - 02 Nov 2002
Wasn't sure if this should go into
TablePluginDev or here. (Here! Plugins web is already too busy!)
I had the
TablePlugin installed on our TWiki site and was doing fine. I could have multiple tables on a single page all sorting according to different criteria and different directions. I just downloaded the newest (05-Jun) version of the Plugin and have lost the ability to specify the sorting on multiple tables within the same page.
In my Apache error log I have a lot of:
[Wed Jun 19 13:02:12 2002] view: Use of uninitialized value in string eq at ../lib/TWiki/Plugins/TablePlugin.pm line 302.
[Wed Jun 19 13:02:12 2002] view: Use of uninitialized value in string eq at ../lib/TWiki/Plugins/TablePlugin.pm line 302.
[Wed Jun 19 13:16:48 2002] view: Use of uninitialized value in subtraction (-) at ../lib/TWiki/Plugins/TablePlugin.pm line 297.
- TWiki version: 20011201
- Web server: Apache of course (1.3.24)
- Server OS: Solaris 2.8
- Web browser: Netscape 6.22
- Client OS: Solaris 2.8
--
MicahHoffman - 19 Jun 2002
Answer
Not Preceeded by TABLE
Title |
Author |
Level |
Reviewer |
Ref |
Effective Java Programming Language Guide |
Bloch, J. |
Int. |
x |
|
Core J2EE Patterns: Best Practices and Design Strategies |
Crupi, et. al |
Advanced |
x |
|
Preceeded by TABLE{ initsort="3" } :
Not Preceeded by TABLE
Title |
Author |
Level |
Reviewer |
Ref |
Effective Java Programming Language Guide |
Bloch, J. |
Int. |
y |
|
Core J2EE Patterns: Best Practices and Design Strategies |
Crupi, et. al |
Advanced |
x |
|
Preceeded by TABLE{ initsort="2" } :
Preceeded by TABLE{ initsort="1" } :
note:
Only one "column-header click" sort can be active in any topic.
Any initsort setting for the table is superseded by clicking a column header to sort.
The fix should be attached; incorporates changes in TablePlugin.pm function emitTable().
--
TWikiGuest - 01 Nov 2002
To fix the multiple-table sort problem, make this simple change to the file
TablePlugin/Core.pm
# NOTE: Modified by Raymond Lutz to allow multiple tables to be sorted on one page.
# On second pass, $sortCol is defined from the last table, and it then undefines the
# sort flag. This is simply commented out, and parameters set according to the current
# value of $initSort.
# if ( defined( $sortCol ) ) { # COMMENT OUT
# undef $initSort; # COMMENT OUT
# } elsif( defined( $initSort ) ) { # COMMENT OUT
if( defined( $initSort ) ) { # MODIFY elseif TO if
$sortCol = $initSort - 1;
$up = $initDirection;
$direction = $up ? 0 : 1;
$requestedTable = $tableCount;
}
--
RaymondLutz - 14 Dec 2006
This does set the initial sorting state for multiple tables. But after that it is no longer possible to sort on a different column; the
initsort
value is kept.
In the TestCases web (in SVN) is a page with TablePlugin tests. It is really helpful to see what effect a code change has on all table variations.
--
ArthurClemens - 14 Dec 2006