tags:

views:

21

answers:

2

Hi!

I have a label inside a repeater (rptInfos), and I have an arraycollection (Texts) that has the translations. The "Texts" content is changing when I change the language, and normally I use {Texts.getItemAt(219}} for example when I need a translated text. But in the repeater I have a translateable column, so I want to use it like this:

<s:Label text="{Texts.getItemAt(rptInfos.currentItem.DictID as int)}" />

but it says "Syntax error: expected a definition keyword (such as function) after attribute , not target" I wanted to translate it in the labels creationComplete event, but than I can forget about binding, so only when reloaded can I have the content to update.

A: 

This is just a wild guess: try

<s:Label text="{Texts.getItemAt(Number(rptInfos.currentItem.DictID))}" />
Amarghosh
Now I get 2 errors:
SteMa
Description Resource Path Location TypeSyntax error: expecting identifier before rightparen. [Generated code (use -keep to save): Path: _CC_Components_RequestsWatcherSetupUtil.as, Line: 0, Column: 0] technoWebShop Unknown Flex ProblemDescription Resource Path Location TypeSyntax error: expecting rightparen before target. [Generated code (use -keep to save): Path: _CC_Components_RequestsWatcherSetupUtil.as, Line: 0, Column: 0] technoWebShop Unknown Flex Problem
SteMa
@SteMa How about just `<s:Label text="{Texts.getItemAt(rptInfos.currentItem.DictID)}" />`
Amarghosh
A: 

A not so nice, but working solution :S

                            <s:Label text="{rptInfos.currentItem.DictID==254?Texts.getItemAt(254):
                                 rptInfos.currentItem.DictID==255?Texts.getItemAt(255):
                                 rptInfos.currentItem.DictID==256?Texts.getItemAt(256):
                                 rptInfos.currentItem.DictID==257?Texts.getItemAt(257):
                                 rptInfos.currentItem.DictID==258?Texts.getItemAt(258):
                                 rptInfos.currentItem.DictID==259?Texts.getItemAt(259):''}" />
SteMa