STOP: I found it:

Should be item.getProperty('label').

Cheers,

Iain


--- In [email protected], "digital_eyezed" 
<[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> I am having some issues with a labelFunction for a tree component.
> 
> The dataProvider for my tree is a result of a RemoteObject call, 
> which returns an Embedded Array of VO objects.
> 
> The tree displays without any issues.
> 
> Within the VO there is a label attribute which is automatically 
> chosen as the field for the label, however my app is multilingual 
> and I have to format that label for different languages, so I want 
> to build a labelFunction to check the value of the label then 
return 
> the correct String from the current language model. No probs I 
hear 
> you say.
> 
> Ok, on the tree I have this: labelFunction="checkLanguage"
> 
> The function looks like this:
> 
> public function checkLanguage(item):String{
>               if(item.label == "1"){
>                       return language.1;
>               }else if(item.label == "2"){
>                       return language.2;
>               }else if(item.label == "3"){
>                       return language.3;
>               }else if(item.label == "4"){
>                       return language.4;
>               }else if(item.label == "5"){
>                       return language.5;
>               }else if(item.label == "6"){
>                       return language.6;
>               }else if(item.label == "7"){
>                       return language.7;
>               }else{
>                       return item.label;
>               }
>         }
>  Now this returns nothing, I have also checked to see what 
> item.label is and it is undefined, so where am I going wrong?
> 
> Thanks in advance.
> 
> Iain
>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to