我在我的笔记数据库审计4场。他们是多值,他们每得到一个新的条目时上的东西变化形式。我有显示柱状的方式这些领域的审计形式。几乎像一个视图。这里是code代表列。
I have 4 audit fields in my notes database. They are multivalued and they each get a new entry when something on the form changes. I have an audit form which displays these fields in a columnar way. Almost like a view. Here is the code for the columns.
<xp:tr> <xp:td style="background-color:rgb(255,255,255)"> <xp:text escape="true" id="dspAuditWhen"></xp:text></xp:td> <xp:td style="background-color:rgb(255,255,255)"> <xp:text escape="true" id="dspAuditWho"></xp:text></xp:td> <xp:td style="background-color:rgb(255,255,255)"> <xp:text escape="true" id="dspAuditWhat"></xp:text></xp:td> <xp:td style="background-color:rgb(255,255,255)"> <xp:text escape="true" id="dspAuditValue"></xp:text></xp:td> </xp:tr>我填充与客户一边倒onClientLoad事件这些字段。
I populate these fields with a client sided "onClientLoad" event.
var auditWhen = XSP.getElementById("#{id:AuditWhen}").value.split(";"); XSP.getElementById("#{id:dspAuditWhen}").innerHTML = auditWhen.join("\n"); var auditWho = XSP.getElementById("#{id:AuditWho}").value.split(";"); for ( i = 0; i < auditWho.length ; i++) {auditWho[i] = auditWho[i].substr(0,20); } var a=auditWho.join("\n"); XSP.getElementById("#{id:dspAuditWho}").innerHTML = auditWho.join("\n"); var auditWhat = XSP.getElementById("#{id:AuditWhat}").value.split(";"); var b=auditWhat.join("\n"); XSP.getElementById("#{id:dspAuditWhat}").innerHTML = auditWhat.join("\n");请注意两件事情。我没有code中,只是还没有为dspAuditValue。我也正在控制auditWho的长度。另外请注意,我有调试目的的变量a和B。
Note a couple of things. I do not have the code in just yet for dspAuditValue. Also I'm controlling the length of auditWho. Also note that I have a variable "a",and "b" for debugging purposes.
反正这code工程为dspAuditWhen和dspAuditWho列完美的罚款。对于dspAuditWhat,他们似乎用空格,换行不只是分开。
Anyway this code works perfectly fine for the dspAuditWhen and dspAuditWho columns. For dspAuditWhat, they appear to be just separated by spaces, not newlines.
我比较auditWhat与auditWho。 auditWhat成功拆分成一个数组就像auditWho
I compared "auditWhat" with "auditWho". "auditWhat" successfully split into an array just like "auditWho"
我比较B与A。这也是一个大的字符串,用\\ n分隔每个元素。
I compared "b" with "a". It too is a large string with each element separated by a \n.
我已经验证auditWhat是在Notes客户机的多值列表字段。 (如果不是,那么我的Notes客户端的审核表不会工作。)
I have verified that auditWhat is a multivalued list field in the notes client. (If it weren't, then my Notes client Audit form wouldn't be working.)
我看绝对没有错code。这是因为如果在Web浏览器中说:你得到2列的数据,你想要的方式,这就是它!
I see absolutely nothing wrong with this code. It's as if the web browser is saying "you get 2 columns with the data the way you want it and THAT'S IT!!!
在IE和放大器相同的行为;火狐
Same behaviour in both IE & Firefox
推荐答案\\ n不是一个HTML标签 - 这将是就像在你的HTML源代码回车
\n isn't an HTML tag - it would be just like a carriage return in your HTML source.
尝试以&lt加盟; BR /&GT;而是一个新的行如:
Try joining with <br/> instead for a new line eg :
XSP.getElementById("#{id:dspAuditWhat}").innerHTML = auditWhat.join("<br/>");不知道为什么在particluar一列shopuld需要特殊对待,虽然
Not sure why one column in particluar shopuld need special treatment though
更多推荐
有没有更好的方式一栏,显示多值数据?
发布评论