function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AndraskoAndrasko 

Datatable not find custom object field

Hy everyone!

 

I have an apex class (generated from WSDL) with the following code:

 

public class dfWS {

    public class user_x {
        public String firstName;
        public String id;
        public String lastName;
        public String loginName;

    }

}

 

 

I use this class in a cotroller class:

 

List<dfWS.User_x> users = new List<dfWS.User_x>();

users = ... // fill the List with data

 

 

And I want to display this list with dataTable:

 

<apex:dataTable id="userTable" value="{!users}" var="u">

 

 <apex:column >
 <apex:outputText >{!u.id}</apex:outputText>
 </apex:column>

</apex:dataTable>

 

 

 

But I get the following error:

Error: Unknown property 'dfWS.user_x.Id'

 


SteveBowerSteveBower

offhand you need a getter and the list needs to be accessible.  Try changing:

 

List<dfWS.User_x> users = new List<dfWS.User_x>();

 

to:

 

public List<dfWS.User_x> users {get; set;}

users = new List<dfWS.User_c();

 

Best, Steve.

AndraskoAndrasko

I did't write it, but I use get/set methods of course:

public void setUsers(List<dfWS.User_x> users){
   this.users = users;
}
public List<dfWS.User_x> getUsers(){ ű
    return this.users;
}


 

SteveBowerSteveBower

Sorry... just starting with the obvious...

 

Try public and getters on the individual properties of the User_x class as well.  Otherwise, I don't see anything all that goofy.

 

Best, Steve.