I have such IDL interface:
interface User
{
string toString();
//..
};
interface Group
{
typedef sequence<User> Users;
Users getUsers();
};
When I translated it to C++ I got sth like this:
// ...
Group::Users* GroupImpl::getUsers()
{
// ..return sequence of 'User'-objects
}
On client side (written in Java) I want to show my users. I do sth like this:
public void showAllUsers()
{
User[] users = interface_obj.getUsers();
if(users.length != 0)
{
DefaultListModel model = new DefaultListModel();
for(int i=0; i<users.length; i++)
model.addElement(users[i]);
this.usersList.setModel(model);
}
}
this.usersList is a JList
.
When I do this like I wrote, I see only IORs of my Users-object:
IOR :0123405948239481293812312903891208320131293812381023
IOR: 0092930912617819919191818173666288810010199181919919
and so on ...
How to make it that way, to see their toString(); representation in DefaultListModel? I dont want to do this:
model.addElement(users[i].toString());
thats not the point. When I use RMI instead of CORBA, model.addElement(users[i]);
is exactly what I need cause I see users string representation.
But I need to use CORBA and store in DefaultListModel corba-user-objects, not strings. Please, help.