Checkbox control in a grid is not triggering fieldupdated event

落花浮王杯 提交于 2019-12-22 19:02:12

问题


I have a selected checkbox on a custom grid is not triggering the Fieldupdated event.

    protected void MyTable_Selected_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e, PXFieldUpdated del)
{
    del?.Invoke(cache, e);
    var row = (MyTable)e.Row;
    if(row.Selected == true )
    {
        //
    }
}

The following is the code in aspx page

 <px:PXCheckBox ID="edSelected" runat="server" AlreadyLocalized="False" CommitChanges="True" DataField="Selected" Text="Selected">
                    </px:PXCheckBox>

DAC definition for the field

#region Selected
        public abstract class selected : IBqlField { }

        /// <summary>
        /// Used for selection on screens.
        /// </summary>
        [PXDBBool]
        //[PXDefault(false)]
        [PXUIField(DisplayName = "Selected")]
        public virtual bool? Selected { get; set; }
        #endregion

When i click in the grid there is a red mark appears and the value is not committed on server side.


回答1:


I had the same problem and I figured out the property "BatchUpdate" was set to "true" on the Grid, which prevents the changes to be commited to the server.

Once I set it to false it works fine :



来源:https://stackoverflow.com/questions/52609314/checkbox-control-in-a-grid-is-not-triggering-fieldupdated-event

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!