adf0994 wrote:To me it looks you're getteng the last one since you return <tt>usrw</tt> rather than <tt>co</tt>.
my problem is am only geting first selected users and the rest is not been passed,i can select 3 users but only the first user i select is been passed
adf0994 wrote:Yes, because you don't want to return the intermediate variable <tt>usrw</tt> holding a single user name. You want to return the collection of all user names stored in <tt>co</tt>.
i put it inside my for loopbut is not able to be recognise when i do the
String usrw = (String)r.getAttribute("name");
I even decalre global but still not able to recive all pass valuesDon't try random solutions! Understand the problem!
adf0994 wrote:This is the wrong way. Createing a String from the list just to satisfy the methods interface is not a good idea.
am trying to use this but with no luck, i what to take arraylist define method and pass it to string define mathod,but first what to convert it to string
String asString = ArrayList.toString(orgDetails.getusername());
but am geting Error(606,16): incompatible types,i what to pass the value as string as the reciving method is define as string,how can i return the collection of all user names stored in co.howSimply change the methods signature to return your collection type
And yes, after this change your entire code will not be compilabe yet. You have to change all places calling <tt>getusername()</tt> to handle the output as a <tt>List</tt>.
public String getusername() // should be changed to public List<String> getusernames()
adf0994 wrote:Looks like you have a design flaw.
You have to change all places calling getusername() to handle the output as a List.
but my method is define as string i cannot just change it to list as is been used in diffirent class for diffirent purpose