Announcement

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

    SelectItem - showing Name instead of ID

    Hello all,

    I am using a ListGrid in which I have a field who's EditorType is set as a SelectItem

    Code:
            ListGridField lgf= new ListGridField("DBField", "headerName");
    					
    	SelectItem si= new SelectItem();  
            si.setOptionDataSource(DataSource.get("DSName"));
            lgf.setEditorType(dayClassSelectItem);
    
            si.setValueField("field_id");
    	si.setDisplayField("field_name");
    Everything works well, when I'm editing the fields, but when I'm only viewing them it shows the id, instead of the name.

    Can anyone help me with a solution showing the name and changing the value of id in DB?

    Thank you in advance,
    Driftdone
    Last edited by Driftdone; 28 Jun 2011, 23:06.

    #2
    See ListGridField.optionDataSource for an explanation of approaches for both large and small datasets.

    Comment

    Working...
    X