Passing a value between Pre and Post event handler using XppPrePostArgs:
public static class MyTableEventHandler_XppPrePostArgs
{
const static str myFieldHasChangedArgName = 'myFieldHasChanged';
[PreHandlerFor(tableStr(MyTable), tableMethodStr(MyTable, update))]
public static void MyTable_Pre_update(XppPrePostArgs _args)
{
MyTable myTable = _args.getThis() as MyTable;
boolean myFieldHasChanged = myTable.MyField != myTable.orig().MyField;
<strong>_args.addArg(MyTableEventHandler_XppPrePostArgs::myFieldHasChangedArgName, myFieldHasChanged);</strong>
}
[PostHandlerFor(tableStr(MyTable), tableMethodStr(MyTable, update))]
public static void MyTable_Post_update(XppPrePostArgs _args)
{
MyTable myTable = _args.getThis() as MyTable;
<strong>boolean myFieldHasChanged = _args.getArg(MyTableEventHandler_XppPrePostArgs::myFieldHasChangedArgName);
</strong>
if (myFieldHasChanged)
{
myTable.doStuff();
}
}
}
留言列表