XPages从组合框中选择值 [英] XPages get Value selected from combo box

查看:154
本文介绍了XPages从组合框中选择值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将组合框中选定的值显示到标签中。

I want to display the selected value from the comboBox into a label.

<xp:label id="label4">

    <xp:this.value><![CDATA[#{javascript:var componenta = Contr.getItemValueString("txt_tipcontractcv");

if (componenta == "")
{ return "void";}

if (componenta !="")
{ return "My value is "+componenta}}]]></xp:this.value>
</xp:label>

标签位于面板上,我对相应面板进行了部分刷新。
我的组合框绑定到一个数据元素。

The label is on a panel, and I did a partial refresh to the respective panel. My comboBox is binded to a data element.

label4总是 void 。为什么?
谢谢您,

label4 is always void. Why? Thank you,

弗洛林

推荐答案

代码变成:

var componenta = getComponent("combo").getValue();

if ((componenta == null) || (null == componenta))
{ return "void";}

else if ((componenta != null) || (null != componenta))
{ return "My value is "+componenta}  

现在它返回:我的值是
看起来componenta是一个空字符串。为什么?

and now it returns : My value is It seems that componenta is an empty string. Why?

这篇关于XPages从组合框中选择值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆