[xwiki-users] Livetable Filters
Hi all! I'm using a Livetable to show information categorized, using TopFilter as:#set($options = { "topFilters":'<input type="hidden" size="${columnsProperties.size}" name="area" value="${area2}" />', "className":"XWiki.AggregatorURLClass", "translationPrefix" : "", "tagCloud" : true, "rowCount": 10 }) The value field "area2" is a String to filter the area field. If I write a string in this value, the filter works. But, if i'm using a variable, the table is empty Case 1: value="Something" --> The filter works. Case 2: $var = "Something" ... value=${var} --> Nothing Someone knows why? Thanks in advance! -- View this message in context: http://xwiki.475771.n2.nabble.com/Livetable-Filters-tp7314873p7314873.html Sent from the XWiki- Users mailing list archive at Nabble.com.
acaserop wrote
Hi all!
I'm using a Livetable to show information categorized, using TopFilter as:#set($options = { "topFilters":'<input type="hidden" size="${columnsProperties.size}" name="area" value="${area2}" />', "className":"XWiki.AggregatorURLClass", "translationPrefix" : "", "tagCloud" : true, "rowCount": 10 })
The value field "area2" is a String to filter the area field. If I write a string in this value, the filter works. But, if i'm using a variable, the table is empty
I am using with success - value="$value" (without symbols {}) -- View this message in context: http://xwiki.475771.n2.nabble.com/Livetable-Filters-tp7314873p7318989.html Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi! ________________________________________ From: users-bounces@xwiki.org [users-bounces@xwiki.org] On Behalf Of Eugen Colesnicov [ecolesnicov@gmail.com] Sent: 26 February 2012 11:17 To: users@xwiki.org Subject: Re: [xwiki-users] Livetable Filters acaserop wrote
Hi all!
I'm using a Livetable to show information categorized, using TopFilter as:#set($options = { "topFilters":'<input type="hidden" size="${columnsProperties.size}" name="area" value="${area2}" />', "className":"XWiki.AggregatorURLClass", "translationPrefix" : "", "tagCloud" : true, "rowCount": 10 })
The value field "area2" is a String to filter the area field. If I write a string in this value, the filter works. But, if i'm using a variable, the table is empty
I am using with success - value="$value" (without symbols {})
Please, acaserop, could you post the very simple line assigning a value to $area2? What it would be funny if to see Velocity Formal Reference Notation working here **size="${columnsProperties.size}"** and not here **value="${area2}"**. Thanks! Ricardo -- View this message in context: http://xwiki.475771.n2.nabble.com/Livetable-Filters-tp7314873p7318989.html Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users -- Ricardo Rodríguez Research Management and Promotion Technician Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es Nota: A información contida nesta mensaxe e os seus posibles documentos adxuntos é privada e confidencial e está dirixida únicamente ó seu destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe, por favor elimínea. A distribución ou copia desta mensaxe non está autorizada. Nota: La información contenida en este mensaje y sus posibles documentos adjuntos es privada y confidencial y está dirigida únicamente a su destinatario/a. Si usted no es el/la destinatario/a original de este mensaje, por favor elimínelo. La distribución o copia de este mensaje no está autorizada. See more languages: http://www.sergas.es/aviso_confidencialidad.htm
Hi!! Yes, I don't understand why the filter is working well with some things... I tried both ways: This case the livetable is not filtering: #set($area2="someString") .... ($options = { "topFilters":'<input type="hidden" size="${columnsProperties.size}"> name="area" value=*"${area2}"* />', "className":"XWiki.AggregatorURLClass", "translationPrefix" : "", "tagCloud" : true, "rowCount": 10 }) ... and ($options = { "topFilters":'<input type="hidden" size="${columnsProperties.size}"> name="area" value=*"$area2"* />', "className":"XWiki.AggregatorURLClass", "translationPrefix" : "", "tagCloud" : true, "rowCount": 10 }) But if I put the same "someString" directly over the filter, then the LiveTable works perfectly Any idea?? I'm getting crazy :) -- View this message in context: http://xwiki.475771.n2.nabble.com/Livetable-Filters-tp7314873p7321220.html Sent from the XWiki- Users mailing list archive at Nabble.com.
I did it, this is my way, if someone has the same problem :) First, defined a var with the string #set($filter = "<input type='hidden' size='${columnsProperties.size}' name='area' value='$area2'/>") And later, I put this variable in the filter #set($options = { "topFilters":"$filter", And this works :) -- View this message in context: http://xwiki.475771.n2.nabble.com/Livetable-Filters-tp7314873p7321578.html Sent from the XWiki- Users mailing list archive at Nabble.com.
Great! I would really know why this solution does work! It is not the first time I'm facing this kind of issues: variables been parsed in some cases, and not parsed in others... ! Thanks! -- Ricardo Rodríguez Research Management and Promotion Technician Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es ________________________________________ From: users-bounces@xwiki.org [users-bounces@xwiki.org] On Behalf Of acaserop [acaserop@indra.es] Sent: 27 February 2012 13:38 To: users@xwiki.org Subject: Re: [xwiki-users] Livetable Filters I did it, this is my way, if someone has the same problem :) First, defined a var with the string #set($filter = "<input type='hidden' size='${columnsProperties.size}' name='area' value='$area2'/>") And later, I put this variable in the filter #set($options = { "topFilters":"$filter", And this works :) -- View this message in context: http://xwiki.475771.n2.nabble.com/Livetable-Filters-tp7314873p7321578.html Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users Nota: A información contida nesta mensaxe e os seus posibles documentos adxuntos é privada e confidencial e está dirixida únicamente ó seu destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe, por favor elimínea. A distribución ou copia desta mensaxe non está autorizada. Nota: La información contenida en este mensaje y sus posibles documentos adjuntos es privada y confidencial y está dirigida únicamente a su destinatario/a. Si usted no es el/la destinatario/a original de este mensaje, por favor elimínelo. La distribución o copia de este mensaje no está autorizada. See more languages: http://www.sergas.es/aviso_confidencialidad.htm
On Mon, Feb 27, 2012 at 11:04 AM, acaserop <acaserop@indra.es> wrote:
Hi!!
Yes, I don't understand why the filter is working well with some things...
I tried both ways:
This case the livetable is not filtering:
#set($area2="someString")
....
($options = { "topFilters":'<input type="hidden" size="${columnsProperties.size}"> name="area" value=*"${area2}"* />', "className":"XWiki.AggregatorURLClass", "translationPrefix" : "", "tagCloud" : true, "rowCount": 10 }) ...
and
($options = { "topFilters":'<input type="hidden" size="${columnsProperties.size}"> name="area" value=*"$area2"* />', "className":"XWiki.AggregatorURLClass", "translationPrefix" : "", "tagCloud" : true, "rowCount": 10 })
But if I put the same "someString" directly over the filter, then the LiveTable works perfectly
Any idea?? I'm getting crazy :)
See http://velocity.apache.org/engine/devel/user-guide.html#stringliterals . Basically you have this: #set($map = {"key", 'value'}) The string wrapped in double quotes is parsed/evaluated while the string wrapped in single quotes is not. Hope this helps, Marius
-- View this message in context: http://xwiki.475771.n2.nabble.com/Livetable-Filters-tp7314873p7321220.html Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
On Tue, Feb 28, 2012 at 9:08 AM, Marius Dumitru Florea <mariusdumitru.florea@xwiki.com> wrote:
On Mon, Feb 27, 2012 at 11:04 AM, acaserop <acaserop@indra.es> wrote:
Hi!!
Yes, I don't understand why the filter is working well with some things...
I tried both ways:
This case the livetable is not filtering:
#set($area2="someString")
....
($options = { "topFilters":'<input type="hidden" size="${columnsProperties.size}"> name="area" value=*"${area2}"* />', "className":"XWiki.AggregatorURLClass", "translationPrefix" : "", "tagCloud" : true, "rowCount": 10 }) ...
and
($options = { "topFilters":'<input type="hidden" size="${columnsProperties.size}"> name="area" value=*"$area2"* />', "className":"XWiki.AggregatorURLClass", "translationPrefix" : "", "tagCloud" : true, "rowCount": 10 })
But if I put the same "someString" directly over the filter, then the LiveTable works perfectly
Any idea?? I'm getting crazy :)
See http://velocity.apache.org/engine/devel/user-guide.html#stringliterals . Basically you have this:
#set($map = {"key", 'value'}) #set($map = {"key": 'value'})
The string wrapped in double quotes is parsed/evaluated while the string wrapped in single quotes is not.
Hope this helps, Marius
-- View this message in context: http://xwiki.475771.n2.nabble.com/Livetable-Filters-tp7314873p7321220.html Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
participants (4)
-
acaserop -
Eugen Colesnicov -
Marius Dumitru Florea -
Ricardo.Julio.Rodriguez.Fernandez@sergas.es