0

I am using two fields associated with xe:simplevaluePicker on an XPage and would like the @DbLookup formula for the second field to incorporate the value of the first field as a key. How can I best do this? At the moment, the xe:simpleValuePicker gives an "Type:Error: resp is null"

My code at the moment is:

<xp:inputText id="Function" value="#{document1.Function}"     styleClass="EditBoxWidth"     required="true">

<xp:eventHandler event="onchange" submit="false" refreshMode="partial"    refreshId="valuePickerMT"></xp:eventHandler>
</xp:inputText>

<xe:valuePicker id="valuePicker" for="Function" dialogTitle="SELECT">
<xe:this.dataProvider>
<xe:dominoViewValuePicker databaseName="#{javascript:@Subset(@DbName(),-1)}"    labelColumn="FunctionName">
<xe:this.viewName><![CDATA[#{javascript:var viewname = "$L-Function-WEB"; viewname}]]>     </xe:this.viewName>
</xe:dominoViewValuePicker>
</xe:this.dataProvider>
</xe:valuePicker>           

<xp:inputText id="MainTasks" value="#{document1.MainTasks}"
required="true" styleClass="EditBoxWidth">
</xp:inputText>

<xe:valuePicker id="valuePickerMT" for="MainTasks" dialogTitle="SELECT">

<xe:this.dataProvider>
<xe:simpleValuePicker>

<xe:this.valueList><![CDATA[#{javascript:var viewname = "$L-Function-WEB";
var key = getComponent("Function").getValue();
var results = @DbLookup(@DbName(),viewname,key,3);
results}]]></xe:this.valueList>
</xe:simpleValuePicker>
</xe:this.dataProvider>
xe:valuePicker>
</xp:span>
  • Can you please post some code on what you have tried? – Naveen Oct 15 '13 at 10:11
  • You mentioned error "resp is null". There is no "resp" in your code. Can you please provide the code where "resp" is used. Or, do you have another error message meanwhile? – Knut Herrmann Oct 17 '13 at 08:31
  • I don't actually have any "resp" variable in my code. It's the error which appears when I open the dialog box whose values I have just tried to update using partial refresh. –  Oct 18 '13 at 08:14

1 Answers1

3

document1.getItemValueString("MyFieldName") will get the value, if document1 is the name of the relevant datasource. Of course, if you're wanting to refresh the (server-side generated) values based upon a value from the first field that the user has entered in the (client-side) browser, you'll need to trigger a partial refresh after the first field is updated.

Paul Stephen Withers
  • 15,699
  • 1
  • 15
  • 33