我遇到了使用正確數據填充數據表的問題。如何僅顯示錶格的子集
我有我使用在表單中的數據表。它被稱爲userConfigProfiles。它有一個2 FK列groupId(這個連接到UserGroupInfo)和corpProfileId(這個連接到我創建的表)。 userConfigProfiles中的數據從另一個表單填充,並且當前正確填充。
的問題是,我需要的SalesTable形式顯示在userConfigProfiles基於斷什麼羣組當前用戶的行的子集上向下創建下降。
我試圖通過添加要做到這一點下面的代碼表中,在SalesTable形式userConfigProfiles:
public void init()
{
userConfigProfiles.data(userConfigProfiles::find());
super();
}
然後,我添加此查找方法的表本身:
static public userConfigProfiles find()
{
userConfigProfiles userProfile;
UserGroupList userGroupList;
str 8 u = curUserId();
select *
from userProfile
order by userProfile.bdcProfileId
join userGroupList
where userProfile.groupId == userGroupList.groupId
&& userGroupList.userId == u;
return userProfile;
}
然而,即使我的find方法被調用並且它返回正確的數據,它也不會影響到我的表單上的下拉列表中的數據。
我的下拉列表是userConfigProfiles的DataSource和corpProfileId的數據字段一個StringEdit場。
我敢肯定有幾種方法可以解決我的問題,我是開放給任何人,即使這意味着要刪除所有我的代碼,做下拉框中完全不同。
謝謝你的幫助!我能夠使用你給我的東西,並找出如何解決我的問題! – 2012-02-20 15:14:45