thought this was a simple task but I can’t seem to get it:I need a sessionScope variable being set to some value based on an item selected in a combobox. I thought that in the “onchange” event of the combo itself I should be able to write something like
sessionScope.myVar = this.—
where “—” is the property I’m desparately looking for…
I know how I’d do it in standard client side JS, but here we don’t have an options array to start with. Or do we?
Can someone please give me a hint where I would look up something like that?
Thanks,
Lothar
Subject: Would this work for you?
<xp:comboBox id="comboBox1">
<xp:selectItem itemLabel="Please select a value"
itemValue="">
</xp:selectItem>
<xp:selectItems>
<xp:this.value><![CDATA[#{javascript:return ["AAA","BBB","CCC","DDD","EEE"]}]]></xp:this.value>
</xp:selectItems>
<xp:eventHandler event="onchange" submit="true"
refreshMode="partial" refreshId="computedField1">
<xp:this.action><![CDATA[#{javascript:var combo1 = getComponent('comboBox1');
var value = combo1.getSubmittedValue();
if( null == value ){
value = combo1.getValue();
}
requestScope.val01 = value;}]]></xp:this.action>
</xp:eventHandler>
</xp:comboBox>
<xp:br></xp:br>
<xp:text escape="true" id="computedField1" value="#{requestScope.val01}"></xp:text>
Subject: Of course it would!
… in fact: it did help. And as always: thanks a ton!
But - again - as always: one question answered opens up two or three new ones 
1: I searched online and offline help but couldn’t find a reference to a “.getSubmittedValue” method.
2: I found multiple references to a “.getValue” method, but the ones I found always seem to expect an item’s id as an argument.
Questions to both topics above: is there some sort of reliable reference available to which components there can be and which methods apply to which? Maybe it’s there somewhere but then I’m obviously looking at the wrong places…
3: in your example you used “requestScope” whereas I tended to use “sessionScope”. Apart from the scope range itself, is there any difference, e.g. in performance, between those scope variables? I tested both and felt that “sessionScope” would be a bit more responsive than “requestScope”; but somehow it soesn’t make sense, so maybe that was just some other effect I experienced?
Sigh - I really wish there was a complete and comprehensive reference to all the objects available for the ServerSide scripting languages…
Best regards,
-Lothar
Subject: some answers to those questions…
For 1 and 2, go to this wiki article - http://www-10.lotus.com/ldd/ddwiki.nsf/dx/XPagesNoDataValidation.htm and there is a section there on the 'How “No data validation” works in the JSF Lifecycle '.
“… When you submit a page, on the server it first restores the server-side control tree (Restore View phase), then it goes through all controls and copies the values from the browser form into each control’s “submittedValue” field (Apply Request Values phase). …”
For 3, I just used requestScope for this example as I only wanted this to be set for this page only which would end after the page is submitted. You may want to sessionScope to carry values through several submits. Here’s another article on these scoped variables - http://www-10.lotus.com/ldd/ddwiki.nsf/dx/xpages-scoped-variables.htm
Subject: hmmm…
…ok, that at least somehow explains where the “getSubmittedValue” method comes from…
phew - I still wish I had some kind of reference teaching me the concepts behind that all. But I’ll try to be patient 
Thanks again,
-Lothar
Subject: XPages ComboBox
I need to do a similar thing as this… I have it working to update an edit field or computed field just like this - what I need is to do a selection in one combobox - then based on that selection I need to do another lookup for values in a 2nd comboBox. I tried setting a scope var, then in the 2nd ComboBox in the values property I tried using the setting a new var from the scoped variable then using that in a @DBColumn lookup. This seems to only work when the page is opened and not refreshed via the submit from the 1st comboboxes submit… Any ideas? Here is the code for the 2nd combobox values property…
var tempOEM = requestScope.tempOEMName;
@DbLookup(“”, “LookupAgent”, tempOEM, 2)