Page 1 of 1

documentation missing?

PostPosted: Sat Dec 27, 2003 9:11 pm
by RobertMeyer
I'm trying to use the method "getSelectedElements" with
a field whose display type is "check".

the method appears to return an array, and after checking
a few of the checkboxes, I can see that the resulting array
contains the items that were checked. so far, so good.

however, how can I tell how MANY items are in this array?
(or, how many of the checkboxes were checked).

I believe I've searched all available documentation, but
can't find this function described anywhere.

thanks in advance.
rm.

PostPosted: Sun Dec 28, 2003 11:10 am
by maarten
var check = elements.myValueList.getSelectedElements()
var lengthOfArray = check.length


Here are some good references to java scripting with clear examples.

http://devedge.netscape.com/library/manuals/2000/javascript/1.5/guide/
http://devedge.netscape.com/library/manuals/2000/javascript/1.5/reference/

PostPosted: Sun Dec 28, 2003 6:46 pm
by RobertMeyer
thanks Maarten;

I just discovered that this is a java function, not
a servoy function. I hadn't realized that at first.

thanks for getting back to me.

rm.

PostPosted: Sun Dec 28, 2003 7:25 pm
by maarten
Since arrays are used quite often, I'll ask dev team if they can put in an extra tree for array functions
(inside the JS Lib of the method editor)

thanks.