on a rather simple Xpage I have a combo box control which is bound to a sessionScope variable called “comboVal”. It has 3 select item values called “a” “b” and “c”. There is no event like onchange bound to the combo.
If now I change the value from “a” to “b” and then refersh the page the combo still shows a value “b”. If however I reload the page by re-entering the page’s url or by simply selecting the browser’s url field and hitting the combo’s value is reset to the initial value “a”.
I set up a few test controls to show the actual value of my sessionScope variable, and it looks as if it always would be empty.
Then I wrote some code into the Xpage’s beforeRenderResponse event:
var val = sessionScope.comboVal;
sessionScope.pageEvent = val + “_” + “coming from beforeRenderResponse event”;
finally I put a label on the page whose value is computed to show the contents of sessionScope.pageEvent:
if (sessionScope.pageEvent == null) {
“still empty”;
} else {
sessionScope.pageEvent;
}
The label then shows the value
==> 0_coming from beforeRenderResponse event
no matter whether I simply refresh or reload the page.
Even stranger is the fact that I used this technique in other apps and never had trouble with it. The only difference i can see is that in the other occasions the combo had an onchange event bound to it that directly would reload the page
Question: why am I losing the combo value?