On an xpage we display the activities registrered on an object. the activies are stored in a multi-value Notes field.
a value can be as followed:
2018-12-12 09:36 Jane Doe SysTest/Web/ACME ¤verb_created¤ ¤subj_document¤ in application ¤target_custDB¤
I display the field via a repeat control. In the repeat I have a computed text control with value:
var str = obj;
var regexp = /\¤(.*?)\¤/;
var translations = regexp.exec(str);
if (null != translations){
for (i = 0; i < translations.length; i++) {
if(null != regexp.exec(str)){
trans = regexp.exec(str)[0];
//verb first
if (null != trans){
str = regexp.replace(str, history[trans]);
}
}
}
}
return str;
history is here a reference to the history.properties file where all the key-value pair translations reside in.
The code works fine for the first 2 values. All additional values remain the original value e.g.¤target_custDB¤
I guess somethings goes wrong with detecting the strings so I wonder if my regexp is correct?