当从选择器中选择一个值时,我很难加载我的字段。第一个屏幕(组类别)具有一个组选择器,该组选择器在文本字段和网格中显示描述,用户可以在其中输入类别和目录描述。这很完美。
// Group DAC
[Serializable]
public class INMerchandiseGroup : IBqlTable
{
#region GroupCD
[PXDBString(10, IsKey = true, BqlField = typeof(INMerchandiseGroup.groupCD))]
[PXUIField(DisplayName = "Group Code", Visibility=PXUIVisibility.SelectorVisible)]
[PXSelector(typeof(Search<INMerchandiseGroup.groupCD>),
typeof(INMerchandiseGroup.groupCD),
typeof(INMerchandiseGroup.description))]
public virtual string GroupCD { get; set; }
public abstract class groupCD : PX.Data.BQL.BqlString.Field<groupCD> { }
#endregion
#region Description
[PXDBString(256, IsUnicode = true, BqlField = typeof(INMerchandiseGroup.description))]
[PXUIField(DisplayName = "Description")]
public virtual string Description { get; set; }
public abstract class description : PX.Data.BQL.BqlString.Field<description> { }
#endregion
}
// Group Graph
public class BPGroupCategoryMaint : PXGraph<BPGroupCategoryMaint, INMerchandiseGroup>
{
// Setup for GroupCd in grid
#region Category GroupCD
[PXMergeAttributes(Method = MergeMethod.Append)]
[PXDBDefault(typeof(INMerchandiseGroup.groupCD))]
protected virtual void INMerchandiseCategory_GroupCD_CacheAttached(PXCache cache)
{
}
#endregion
public PXSelect<INMerchandiseGroup> CurrentGroup;
public PXSave<INMerchandiseGroup> Save;
public PXCancel<INMerchandiseGroup> Cancel;
public PXSelect<INMerchandiseCategory,
Where<INMerchandiseCategory.groupCD, Equal<Current<INMerchandiseGroup.groupCD>>>>
GroupCategories;
}
我在“类别-部门”屏幕中具有相同的设置。用户从选择器中选择类别,“类别描述和组CD”应填充文本框,但类别描述和groupcd仅在第一次填充。在那之后,缓存中的值为空。我在做什么错?
// Category DAC (this is used in the grid of Group screen, and as a record header in Category screen.
[Serializable]
public class INMerchandiseCategory : IBqlTable
{
#region CategoryCD
[PXDBString(10, IsKey = true, BqlField = typeof(INMerchandiseCategory.categoryCD, InputMask = ">CCCCCCCCCC")]
[PXUIField(DisplayName = "Category Code")]
public virtual string CategoryCD { get; set; }
public abstract class categoryCD : PX.Data.BQL.BqlString.Field<categoryCD> { }
#endregion
#region Description
[PXDBString(256, IsUnicode = true, BqlField = typeof(INMerchandiseCategory.categoryDescription))]
[PXUIField(DisplayName = "Category Description")]
public virtual string CategoryDescription { get; set; }
public abstract class categoryDescription : PX.Data.BQL.BqlString.Field<categoryDescription> { }
#endregion
#region GroupCD
[PXDBString(10, IsKey = true, BqlField = typeof(INMerchandiseCategory.groupCD) )]
[PXUIField(DisplayName = "Group Code")]
public virtual string GroupCD { get; set; }
public abstract class groupCD : PX.Data.BQL.BqlString.Field<groupCD> { }
#endregion
}
// Category Graph
public class BPCategoryDeptMaint : PXGraph<BPCategoryDeptMaint>
{
[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXUIField(DisplayName = "Category Code", Visibility=PXUIVisibility.SelectorVisible)]
[PXSelector(typeof(Search2<INMerchandiseCategory.categoryCD,
InnerJoin<INMerchandiseGroup, On<INMerchandiseCategory.groupCD, Equal<INMerchandiseGroup.groupCD>>>>),
typeof(INMerchandiseCategory.categoryCD),
typeof(INMerchandiseCategory.categoryDescription),
typeof(INMerchandiseCategory.groupCD),
typeof(INMerchandiseGroup.description))]
protected virtual void INMerchandiseCategory_CategoryCD_CacheAttached(PXCache cache)
{
}
#region Dept GroupCD
[PXMergeAttributes(Method = MergeMethod.Append)]
[PXDefault(typeof(INMerchandiseCategory.groupCD), PersistingCheck = PXPersistingCheck.Nothing)]
protected virtual void INMerchandiseDept_GroupCD_CacheAttached(PXCache cache)
{
}
#endregion
#region Dept CategoryCD
[PXMergeAttributes(Method = MergeMethod.Append)]
[PXDefault(typeof(INMerchandiseCategory.categoryCD), PersistingCheck = PXPersistingCheck.Nothing)]
protected virtual void INMerchandiseDept_CategoryCD_CacheAttached(PXCache cache)
{
}
#endregion
public PXSelect<INMerchandiseCategory> CurrentCategory;
public PXSave<INMerchandiseCategory> Save;
public PXCancel<INMerchandiseCategory> Cancel;
public PXSelect<INMerchandiseDept,
Where<INMerchandiseDept.groupCD, Equal<Current<INMerchandiseCategory.groupCD>>,
And<INMerchandiseDept.categoryCD, Equal<Current<INMerchandiseCategory.categoryCD>>>>>
CategoryDepts;
}
}
请确保ASPX中的字段具有属性commit = true。如果标记为提交,则在控件更改时,UI会将更新发送到服务器。