Question

I am using a DataView control from the extension library in my mobile application. The category column contains the value from a categorized view too display the status of a document. ( values are 0 and 1 ) I would like to translate the values in the DataView Control depending on the language, the user has selected. So I need to build the key from this value to return the value from my language resource file.

the value property of the control contains the current vale. But how would I access this value?

I would likje to do something like this

if (this.Value.equals("0")) {
   return lbls["status.not.activated"];
} else {
   return lbls["status.activated"];
}
Was it helpful?

Solution

Without seeing any code I can only guess that you might have bound the DataView control to an ordinary DominoView datasource. And furtehr I assume that with "value" you are referring to the value property of the DataView's "viewCategoryColumn" child control.

One thing I see from your code snippet is that you spell the "Value" property with a capital "V", which might be a typo here, but if it's like that in your actual code then this must be wrong.

Apart from that I just tried this in a very simple test scenario where my datasource is a view using the Form fields as category column. Using a code like the following in my opinion should be the solution for your task as well:

<xe:this.categoryColumn>
    <xe:viewCategoryColumn
        columnName="Form"
        columnTitle="Form">
    <xe:this.value><![CDATA[#{javascript:
if(@LowerCase(viewEntry.getColumnValues()[0])=="testform"){
    return "Standard Form";
}else{
    return "Other Form";
}}]]></xe:this.value>
    </xe:viewCategoryColumn>
</xe:this.categoryColumn>

The viewEntry variable has been defined as a core property for the dataView itself as we do it with many viewPanel, repeats etc, resulting in an object of type NotesXspViewEntry:

<xe:dataView
    id="dataView1"
    columnTitles="true"
    var="viewEntry">
    ...
</xe:dataView>

Hope this helps

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top