关于 html:在 Lotus Notes Xpage 中解析值 | 珊瑚贝

Parsing value in Lotus Notes Xpage


我有一个表格,可以在 Lotus notes 的 xpage 中提取值。我有 nowrap 设置,所以它不会换行。目前,当我将其设置为 nowrap 时,该值会扩展我的列的宽度。但是,我不需要看到拉动的整个价值。我只需要看看那里是否有一个值。所以我需要列大小保持不变。我尝试在 xpage 中使用各种宽度值。但是,该值仍会扩展该列。所以要么我需要解析值以使其更小,要么找出在哪里添加宽度值,这样它就不会随着变量的增加而增加。

提前致谢。

1
2
3
4
5
6
<td>

<xp:text escape=“false” style=“white-space:nowrap” id=“computedFieldStatementNotesDisplay” value=“#{auditDoc.StatementNotesDisplay}”>
</xp:text>

</td>

  • 这是一个 CSS 问题。这个答案可能会对您有所帮助:stackoverflow.com/a/4457905/785061。


我要感谢大家的回复。我接受了提供的信息并应用了它。我必须将宽度添加到文本中,并将设置放在 .css 中。这是有效的。

我将此添加到 .css

1
2
3
4
5
6
.ellipsis span {
overflow:hidden;
white-space:nowrap;
text-overflow:ellipsis;
display:inline-block;
}

然后在xpage里面我调用了省略号,然后在文本区域设置宽度。

1
2
3
4
<td class=“ellipsis”>
<xp:text escape=“false” id=“computedFieldStatementNotesDisplay” value=“#auditDoc.StatementNotesDisplay}” style=“width:100px”>
</xp:text>
</td>

我能想到的两个快速解决方案:

  • 使用css溢出语句overflow: hidden、overflow: auto或overflow: scroll并将其应用于包含<td>或标签;您也可以考虑将表格列的宽度设置为某个值

  • 使用 SSJS 限制列中显示的字符数量。

  • JS 代码可能是这样的:

    1
    2
    3
    4
    5
    6
    var limit=20;  //test for max allowable chars
    var val=auditDoc.getItemValueString(“StatementNotesDisplay”);  
    if(val.length>limit){
      val=val.left(limit);  
    }  
    return val;

    CSS 解决方案可能是首选

    更新:
    刚刚看到 Per\\ 的评论链接到一个非常完整的 css 解决方案


    来源:https://www.codenong.com/23746132/

    微信公众号
    手机浏览(小程序)

    Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

    Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

    Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_9101.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
    0
    分享到:
    没有账号? 忘记密码?