So I have a form with a two column picklist. The form is working except
for one little ideosyncracy which will prevent me from using it until I
hunt down the little bugger and nail it with my howitzer (sorry suddenly
channeling an old Monty Python sketch, there's nothing more dangerous
than a wounded mosquito).

So the onload loads the values for this field from a global query, then
it makes a query to find out what values the user has and selects them.
As long as the user has >= 1 value selected all is good. If the user has
0 values selected, my dstrace shows the ldap call correctly returning
nothing, but when the is called it selects the first item
in the list. I have tried to form.alert(Q[0][0].toString()) and it
throws an error, but typeof Q returns "object".

So, if the globalQuery returns nothing I would expect a two element
array of zero length arrays, but I don't think ecmascript likes zero
length arrays very much. So I am not quite sure what the right way to
handle this is (the wrong way is probably with a try/catch block). I'm
pretty sure though that this shouldn't be selecting anything in this

if (notNew(form))
IDVault.globalQuery(field.getName(), "Parts")
var Q = IDVault.globalQuery(null, "CastParts",
if ( (null != Q) && (Q[0].length > 0)) then

Any solutions or even ideas, appreciated as always

rrawson's Profile:
View this thread: