In my Xpages form I have two fields where the user will select values from a @DBLookup. They are categories and subcategories.
I got this working using combo boxes, but then I discovered Dojo Filtering Select! This is an awesome control and perfect for what I need to do as the user wants to use type ahead and just tab when they get the value they want.
The fields work fine EXCEPT I cannot get the 2nd field to populate. It is dependent on the value of the first field.
My code is below:
<xp:td>
<xp:label id="label3" value="Work Category" style="font-weight:bold"></xp:label>
</xp:td>
<xp:td>
<xe:djFilteringSelect id="djFilteringSelect2"
rendered="true" value="#{document1.workCategory}">
<xe:this.defaultValue><![CDATA[""]]></xe:this.defaultValue>
<xp:selectItems>
<xp:this.value><![CDATA[#{javascript:var db = new Array(@DbName()[0], 'TSCTT.nsf');
@DbColumn(db, "workCategoryView", 1)
}]]></xp:this.value>
</xp:selectItems>
<xp:eventHandler event="onChange" submit="true"
refreshMode="complete">
</xp:eventHandler>
<xp:eventHandler event="onBlur" submit="true" refreshMode="complete"></xp:eventHandler>
<xp:eventHandler event="onFocus" submit="true"
refreshMode="complete">
</xp:eventHandler></xe:djFilteringSelect></xp:td>
<xp:td>
<xp:message id="message3" for="workCategory"></xp:message>
</xp:td>
</xp:tr>
<xp:tr>
<xp:td>
<xp:label value="Work Sub Category"
id="workSubCategory_Label1" for="workSubCategory1" style="font-weight:bold">
</xp:label>
</xp:td>
<xp:td>
<xe:djFilteringSelect id="djFilteringSelect3"
rendered="true" value="#{document1.workSubCategory}">
<xe:this.defaultValue><![CDATA[""]]></xe:this.defaultValue>
<xp:selectItems>
<xp:this.value><![CDATA[#{javascript:var db:NotesDatabase = session.getCurrentDatabase();
var key:String = document1.getItemValueString("djFilteringSelect2");
@DbLookup(db,"(DBLookupWorkSubCategoryView)",key,2,"[FAILSILENT]");
}]]></xp:this.value>
</xp:selectItems>
</xe:djFilteringSelect></xp:td>
<td></td>
</xp:tr>
<xp:tr>
<xp:td>