From version 5.1
edited by Vincent Massol
on 2013/02/09
To version 6.1
edited by Clemens Robbenhaar
on 2018/10/23
Change comment: Update explanation now that title is filterable by default with some notes

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.VincentMassol
1 +XWiki.ClemensRobbenhaar
FAQCode.FAQClass[0]
answer
... ... @@ -1,13 +1,15 @@
1 1  = Use case =
2 2  
3 -When a livetable is created with doc.title as a column, by default that column does not show as filterable. When filtering is forced on the column by adding "filterable:true", the filtering field appears but typing in it has no effect. The property doc.name can be used and filtered as expected. The reason for this behavior is explained below.
3 +Before XWiki 10.9 when a livetable is created with ##doc.title## as a column, by default that column did not show as filterable. Since XWiki 10.9 the filtering field appears but typing in it might show results where the page title has a little footnote symbol and a note is displayed at the table footer that "filtering and sorting by title will not work as expected for these pages". On the other hand the property ##doc.location## can be used and filtered as expected. The reason for this behavior is explained below.
4 4  
5 +
5 5  = Explanation =
6 6  
7 -There are two different things that usually act as "//title//", ##doc.title## and ##doc.displayTitle##. The first one is an actual metadata field of the document, persisted to the database, while the latter is a dynamic field computed from different sources, including the ##doc.title## field, headers in the content, the document name, and, more recently, other fields selected by the sheet used to display the objects in the document (a new feature of the new sheet mechanism). Plus, it could even be more dynamic, as in text generated by some Velocity code, in the most basic form a translation.
8 +There are two different things that usually act as "//title//", ##doc.title## and ##doc.displayTitle##. The first one is an actual metadata field of the document, persisted to the database, while the latter is a dynamic field computed from different sources, including the ##doc.title## field, headers in the content, the document name, and other fields selected by the sheet used to display the objects in the document. Plus, it could even be more dynamic, as in text generated by some Velocity code, in the most basic form a translation.
8 8  
9 -Livetable filters work directly on the database, meaning that they translate into //sql// conditions (##"and doc.title like '%text introduced by the user%'"##). The //doc.title// Livetable column is special, since it's not exactly the ##doc.title## metadata, but a combination of ##doc.title## and ##doc.displayTitle##, so even though the computed display title is displayed, filtering and sorting works on the plain title. Given the very dynamic and unpredictable aspect of the display title, it's impossible to write a correct sql filter that would match the display title in all cases.
10 +Livetable filters work directly on the database, meaning that they translate into //sql// conditions (##"and doc.title like '%text introduced by the user%'"##). The //doc.title// Livetable column is special, since it's not exactly the ##doc.title## metadata, but a combination of ##doc.title## and ##doc.displayTitle##, so even though the computed display title is displayed, filtering and sorting works on the internal title (the one stored as metadata). Given the very dynamic and unpredictable aspect of the display title, it's impossible to write a correct sql filter that would match the display title in all cases.
10 10  
11 -For this reason, by default the title isn't filterable, since it won't meet the user's expectations: it doesn't filter on the **displayed** title, but on the internal title. What's more, it can't be configured so that it filters on the right information all the time. For certain instances it would be possible to actually make the field filterable, but only when the documents displayed by the Livetable really use the document title as the only source of the displayed title.
12 +For this reason filtering by title won't meet the user's expectations: it doesn't filter on the **displayed** title, but on the internal title. In these cases where both titles are not the same, the note mentioned above is displayed to inform users that their expectations will not be met for these pages.
13 +What's more, it can't be configured so that it filters on the right information all the time. For certain instances it would be possible to actually make the field filterable, but only when the documents displayed by the Livetable really use the document title as the only source of the displayed title.
12 12  
13 -For example, if you edit some of the displayed documents in wiki or wysiwyg mode and enter something in the document title field (the one above the content), you will be able to filter it in the livetable.
15 +For example, if you edit some of the displayed documents in wiki or wysiwyg mode and enter something in the document title field (the one above the content), //and// the content does not something dynamic like a macro, you will be able to filter it in the livetable as expected.

Get Connected