0
votes

I'm trying to find a way to open the Extension Library Value Picker automatically after load of my XPage. I tried putting the following in the onClientLoad event:

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

But it appears that the value picker does not have a click() method to open the dialog. Any ideas are appreciated. Thanks.

2
Afaik it is a dijit. Try dijit.byId - stwissel
@stwissel - I've tried dojo.byId and dijit.byId and neither seems to return the client side ID. I'm not sure if it would even help as I don't think the Value Picker control has a click() or open() method: goo.gl/KZWdC9 - Ryan Buening

2 Answers

0
votes

EDIT: Changed code based on @stwissel's comment and viewid issue:

Put the folloiwng in a 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>

The viewID is set in the beforePageLoad event:

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

to get this working with bootstrap, use extlib.dijit.BootstrapPickerList3. Or much better is 'extlib.responsive.dijit.xsp.bootstrap.PickerList'