I made resource bundle for translation. Everything was going well, except I cannot translate category in a view. Any ideas? (resource bundle is named "prevodi")
<xp:viewColumn id="translateThisSomehow" columnName="fl_company">
<xp:viewColumnHeader id="viewColumnHeader1" value="Company">
</xp:viewColumnHeader></xp:viewColumn>
<xp:viewColumn id="viewColumn2">
<xp:this.value><![CDATA[#{javascript:prevodi[rowVar.getColumnValues()[1]];}]]>
</xp:this.value>
<xp:viewColumnHeader id="viewColumnHeader2" value="Employee">
</xp:viewColumnHeader>
</xp:viewColumn>
viewColumn2 works fine <- it isnt categorized
first viewColumn doesnt work <- categorized
Just a theory: I think the problem is about the lifecycle. View panel reads records to show categories but it seems like resource bundle is not ready yet. Instead of using computed value here, you might use converters;
<xp:viewColumn
id="translateThisSomehow"
columnName="fl_company">
<xp:this.converter>
<xp:customConverter getAsObject="#{javascript:return value}">
<xp:this.getAsString><![CDATA[#{javascript:return prevodi[rowVar.getColumnValues()[1]];}]]></xp:this.getAsString>
</xp:customConverter>
</xp:this.converter>
<xp:viewColumnHeader
id="viewColumnHeader1"
value="Company">
</xp:viewColumnHeader>
</xp:viewColumn>