Fix the bug of populating attribute values

When the device is selected, the attribute values related to this device
should be populated accordingly.