I can't figure out where this is going wrong, I have almost the exact same code working on another page. I have the valuePicker getting its values from a viewScope.vsFieldNames and I know that it is populated before I click the value picker, but when the picker dialog displays I get the error
TypeError: resp is null
the field reqOnSave is a multiline edit box and it is null but I don't think that should make any difference. I have used a scope variable as the valueList in several other pages without trouble. I'm sure I'm missing something simple.
Edited Oct 17 My page looks like this:
When I click on Select Fields I get the display below. I know that viewScope.vsFieldNames is properly populated at this point because I examine it using the debug Tool Bar.
I really don't like the xe:valuePicker because it calls a dialog and I would prefer something like a multi-select combobox, but there is not a standard core or Extension Library control that does this (at least that I can find).
Here is my complete code:
<div class="row">
<div class="col-sm-2">
<xp:label value="Application" id="label1"
for="ApplicationCombo">
</xp:label>
</div>
<div class="col-sm-4">
<xp:comboBox id="ApplicationCombo"
value="#{formDoc.Application}">
<xp:selectItems>
<xp:this.value><![CDATA[#{javascript:var rtn:Array = database.getView("vwWFSApplicationsEnabled").getColumnValues(0);
rtn.unshift("");}]]></xp:this.value>
</xp:selectItems>
<xp:eventHandler event="onchange" submit="true"
refreshMode="partial" refreshId="panelBody">
<xp:this.action>
<![CDATA[#{javascript:try{formDoc.replaceItemValue("FormName","");
}catch(e){
}}]]>
</xp:this.action>
</xp:eventHandler>
</xp:comboBox>
</div>
</div>
<xp:panel id="panelBody">
<xp:text escape="true" id="computedField1">
<xp:this.value><![CDATA[#{javascript:try{
var app:string = formDoc.getValue("Application");
var debug:Boolean = true;
if (debug) WFSUtils.sysOut("Application = " + app);
var form:String = formDoc.getValue("FormName");
if (debug) WFSUtils.sysOut("Form = " + form);
if (!(app == null || app == "")){
if ((!(form.substring(0,3) == "---")) && (!(form == null || form == ""))) {
if (debug) WFSUtils.sysOut("Form Name = " + form);
var thisForm:NotesForm = appProps[app].appDB.getForm(form);
if (debug) WFSUtils.sysOut("Got Form Name = " + thisForm.getName());
var rtn:Array = thisForm.getFields();
if (debug) WFSUtils.sysOut("Rtn = " + rtn.toString());
viewScope.vsFieldNames = rtn;
return null
}
}
viewScope.vsFieldNames = null;
return null
}catch(e){
WFSUtils.sysOut("Error in Get Fields " + e.toString());
viewScope.vsFieldNames = null;
return null;
}}]]></xp:this.value>
</xp:text>
<div class="row">
<div class="col-sm-2">
<xp:label value="Form Name :" id="label2"
for="FormCombo">
</xp:label>
</div>
<div class="col-sm-4">
<xp:comboBox id="comboBox1"
value="#{formDoc.FormName}">
<xp:selectItems>
<xp:this.value>
<![CDATA[#{javascript:var app:string = formDoc.getValue("Application");
if (!(app == null || app == "")){
var rtn = appProps[app].appDB.getView("vwWFSForms").getColumnValues(0);
rtn = sort_unique(rtn);
rtn.unshift("--- Select A Form ---");
return rtn
}else{
return null
}}]]>
</xp:this.value>
</xp:selectItems>
<xp:eventHandler event="onchange" submit="true"
refreshMode="partial" refreshId="panelBody">
</xp:eventHandler>
</xp:comboBox>
</div>
</div><!-- row Form -->
<div class="row">
<div class="col-sm-2">
<xp:label value="Required Fields On Save :" id="label3"
for="djComboReqOnSave">
</xp:label>
</div>
<div class="col-sm-4">
<xe:valuePicker id="pickerFields"
dialogTitle="Select One or More Fields" for="reqOnSave"
pickerText="Select Field/s :">
<xe:this.dataProvider>
<xe:simpleValuePicker caseInsensitive="false">
<xe:this.valueList><![CDATA[${javascript:viewScope.vsFieldNames;
}]]></xe:this.valueList>
</xe:simpleValuePicker>
</xe:this.dataProvider>
</xe:valuePicker>
</div>
<div class="col-sm-2">
<xp:inputTextarea id="reqOnSave"
value="#{formDoc.ReqOnSave}" multipleSeparator=",">
</xp:inputTextarea>
</div>
</div><!-- row reqOnSave -->
<div class="row">
</div>
</xp:panel>

