Reputation: 245
In an Xpage, on the CSJS onChange event, I am taking the value of a control (which is a Dojo Filtering Select) and setting the value of another Dojo Filtering Select control to the same value. Both controls use a @dbcolumn to create their lists of options.
var e = XSP.getElementById("#{id:DJFS1}").value;
XSP.getElementById("#{id:DJFS2}").value = e;
It works fine and changes the value of the 2nd control, except that it gives me "The entered value is not valid" error as it pops in there. If I use the arrow to select the value or use type ahead on that 2nd control, it works fine. Any way I can get it to understand that the value I am writing to it is one of it's options and not give me the error?
Upvotes: 1
Views: 243
Reputation: 21709
Use dijit.byId()
to get to the Dojo Filtering Select - and then use .set("value", value)
to set the value.
Here's an example (assuming that 0 is an alias for one of the possible values):
dijit.byId("#{id:DJFS1}").set("value", 0)
Upvotes: 2