Data Access User Manual > Rogue Wave Views Data Access Common Framework > Data Sources and Gadgets > Data Sources > Connecting Data-Source-Aware Gadgets
 
Connecting Data-Source-Aware Gadgets
A data-source-aware gadget is a gadget that can be connected to a data source. The following code sample shows how an IliEntryField gadget is created.
// Create an entry-field and put it in the panel.
IliEntryField* ef = new IliEntryField(display,
IlvRect(25, 50, 55, 22));
panel->addObject(ef);
 
// Connect the entry field to the data source.
ef->f_setDataSourceName(“EMP”);
ef->f_setDataSourceColumnName(“Id”);
The newly created entry field is connected to the “Id” column of the “EMP” data source.
Similarly, the next example shows how to create another entry field gadget and connect it to the “Name” column.
// Create an entry-field and put it in the panel.
ef = new IliEntryField(display, IlvRect(25, 80, 155, 22));
panel->addObject(ef);
 
// Connect the entry-field to the data source.
ef->f_setDataSourceName(“EMP”);
ef->f_setDataSourceColumnName(“Name”);

Version 6.1
Copyright © 2016, Rogue Wave Software, Inc. All Rights Reserved.