I’m using a requestScope variable to pass the value of one combobox to another. The variable can be used in an Editbox control, but returns null inside the Values tab of a Combobox.
I’m using Designer 8.5 (Revision 20081211.1925) and I get the same problem using IE 7 or Firefox 2.0
Any ideas on why this doesn’t work?
This is the complete source:
<?xml version="1.0" encoding="UTF-8"?><xp:view xmlns:xp=“http://www.ibm.com/xsp/core”>
<xp:comboBox id=“Topic1”>
<xp:selectItem itemLabel="1"></xp:selectItem>
<xp:selectItem itemLabel="2"></xp:selectItem>
<xp:selectItem itemLabel="3"></xp:selectItem>
<xp:eventHandler event="onchange" submit="true"
refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:var topic = getComponent("Topic1").getValue();
requestScope.put(“topic1”, topic);
}]]></xp:this.action>
</xp:eventHandler>
</xp:comboBox>
<xp:br></xp:br>
<xp:comboBox id="Topic2">
<xp:selectItems>
<xp:this.value><![CDATA[${javascript:var topic = requestScope.get("topic1");
if (topic == null || topic == “”){
return "topic has no value";
} else {
return topic;
};
}]]></xp:this.value>
</xp:selectItems>
</xp:comboBox>
<xp:br></xp:br>
<xp:inputText id="inputText1"><xp:this.value><![CDATA[#{javascript:var topic = requestScope.get("topic1");
if (topic == null || topic == “”){
return "topic has no value";
} else {
return topic;
}}]]></xp:this.value></xp:inputText></xp:view>