Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DetailViewer doesn't show detail field?

    Hi,

    I'm trying to get DetailViewer to show the detail field from a datasource. Here is the code.

    Code:
        DataSourceTextField firstName = new DataSourceTextField("firstName", "First Name");    
        
        DataSourceTextField lastName = new DataSourceTextField("lastName", "Last Name");
        lastName.setDetail(true);    
        
        DataSource ds = new DataSource();
        ds.setClientOnly(true);
        ds.setFields(firstName, lastName);
        
        DetailViewer viewer = new DetailViewer();
        viewer.setDataSource(ds);
        viewer.setUseAllDataSourceFields(true);
        
        ListGridRecord data = new ListGridRecord();
        data.setAttribute("firstName", "John");
        data.setAttribute("lastName", "Smith");
    
        viewer.setData(data);
        viewer.draw();
    I set lastName to be a detail field, but it doesn't show on DetailViewer.

    Please help.
Working...
X