0

I get values from Db using jdbc and store them in a String Array object. I have a combobox in an xpage and computed its values using ssjs.

The java class has a function,

String[] array = new String[20];
    public String[] getName(){
return array;
}

The ssjs code is,

    var v = new com.vijay.Test1();
var ar = new Array();

for(i=0;i<@count(ar);i++)
ar[i]= "["+v.getName[i]+"]";

return ar;

But when previewed, the combobox has no values.

1 Answer 1

1

You need to return a Vector and not an Array.

Sign up to request clarification or add additional context in comments.

4 Comments

Tried this. Didn't work. var v = new com.vijay.Test1(); var vec:java.util.Vector=new java.util.Vector(); for(i=0;i<3;i++) v.addElement(v.name[i]); return v;
you have to add to vec and return vec (and not v) :-)
Oh sorry for that. And Thanks.
How to do the same with a Bean pal? I have getters and setters for some String array objects. How to get those?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.