以编程方式显示Ext Lib Value Picker?

时间:2014-04-02 19:54:02

标签: xpages xpages-extlib

我正在尝试找到一种在加载XPage后自动打开扩展库值选择器的方法。我尝试将以下内容放在onClientLoad事件中:

dojo.byId('#{id:MyValuePicker}').click();

但似乎值选择器没有click()方法来打开对话框。任何想法都表示赞赏。感谢。

2 个答案:

答案 0 :(得分:0)

编辑:根据@ stwissel的评论和viewid问题更改了代码:

将下面的内容放在scriptBlock中:

<xp:scriptBlock>
    <xp:this.value><![CDATA[
    var viewID = "#{javascript:viewScope.viewID}";
    XSP.selectValue('extlib.dijit.PickerList',{
        "msep":",",
        "trim":true,
        "listWidth":"550px",
        "dlgTitle":"Select One Or More Values",
        "control":"#{id:BoundControl}",
        "url":"\/Database.nsf\/Test.xsp?$$viewid="+viewID+"&$$axtarget=#{id:MyValuePicker}"
    })
    ]]>
    </xp:this.value>
</xp:scriptBlock>

viewID在beforePageLoad事件中设置:

viewScope.viewID = com.ibm.xsp.application.UniqueViewIdManager.getUniqueViewId(facesContext.getViewRoot())

答案 1 :(得分:0)

要使用bootstrap,请使用 INSERT INTO table_name VALUES( REPLACE(SUBSTRING(SUBSTRING_INDEX(data_string, ',',1), LENGTH(SUBSTRING_INDEX(data_string, ',',0)) + 1), ',', ''), REPLACE(SUBSTRING(SUBSTRING_INDEX(data_string, ',',2), LENGTH(SUBSTRING_INDEX(data_string, ',',1)) + 1), ',', ''), REPLACE(SUBSTRING(SUBSTRING_INDEX(data_string, ',',3), LENGTH(SUBSTRING_INDEX(data_string, ',',2)) + 1), ',', ''), REPLACE(SUBSTRING(SUBSTRING_INDEX(data_string, ',',4), LENGTH(SUBSTRING_INDEX(data_string, ',',3)) + 1), ',', '') 。 或者更好的是&#39; extlib.responsive.dijit.xsp.bootstrap.PickerList&#39;