Jean-Vincent just gave me a workaround :
$traduc.getProperty("langue").getValue()

It returns the Id in the static list instead of the associated value but 
it works.

Thomas


Le 18/05/09 18:15, Thomas Eveilleau a écrit :
> We debugged it with Thomas M.
> $traduc.langue returns "Francais".
> But we checkd the length and saw that the value was 52 instead of 8 
> (with a $traduc.langue.length())
>
> So we made a :
> #foreach($char in $traduc.langue.toCharArray())
> $char
> #end
>
> And saw that the result was something like : {{html 
> wiki="false"}}Francais{{/html}}
>
> I'm still in need of a solution.
>
> Thomas
>
>
> Le 18/05/09 18:08, Vincent Massol a écrit :
>> Hi Thomas,
>>
>> On May 18, 2009, at 5:53 PM, Thomas Eveilleau wrote:
>>
>>    
>>> Hello guys,
>>>
>>> I'm developing my first application in syntax 2 for a customer.
>>> I started on a 1.8.2 XE and just moved on a 1.8 Snapshot (the latest
>>> build - 05/16).
>>>
>>> Here is my problem :
>>> I have a little #if in a #foreach that works on my 1.8.2 but not on my
>>> 1.8 Snapshot and I totally don't know why.
>>>
>>> #set($tradliste = $doc.getObjects("RimayCode.Traduction"))
>>> #foreach($traduc in $tradliste)
>>> #if($!traduc.langue == "Francais")
>>> $!traduc.langue : $!traduc.traduction<br />
>>> #end
>>> #end
>>>
>>> On my 1.8.2 the "foreach" returns all the objects with the good
>>> values,
>>> and the "if" is a filter to display the items with a "Francais"
>>> value in
>>> the "langue" field.
>>> On my 1.8 Snapshot the "foreach" returns all the objects with the good
>>> values, but the "if" doesn't work : not any result.
>>>
>>> There is probably a pb, something new to do to create a test like this
>>> but I can't see what...
>>>
>>> "langue" is a static list with 4 options (1=Francais|2=Tibetain|3=...)
>>>
>>> Any idea ?
>>>      
>>
>> This is strange. We haven't changed the velocity version or our
>> velocity code. Are you sure you didn't change anything else? Like
>> "Francais" to "Français" for ex, or a white space added before the F
>> or after the "s"?
>>
>> Can you print the value of $traduc.langue before the if to see what
>> gets printed?
>>
>> Thanks
>> -Vincent
>> _______________________________________________
>> devs mailing list
>> [email protected]
>> http://lists.xwiki.org/mailman/listinfo/devs
>>    
>

_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to