19.11.2019, 12:42 | #1 |
Участник
|
AX 2009. SysListPageHelper::handleInitPreSuper
На некоторых формах в Init() прописаны такие штуки, для чего они?
(Например, форма InventTable) X++: SysListPageHelper::handleInitPreSuper(element);
super();
SysListPageHelper::handleInitPostSuper(element); |
|
19.11.2019, 16:00 | #2 |
Участник
|
Цитата:
X++: /// <summary> /// Performs all necessary actions for preparing to open a task page from a list page that should be /// taken during the <c>init</c> method before calling the <c>super</c> method. /// </summary> /// <param name="taskPageFormRun"> /// The <c>FormRun</c> instance that is being opened. /// </param> /// <remarks> /// Call this method during the <c>Init</c> method of the form before the <c>super</c> method. This /// method may clear the table record that is held in the <c>args.record</c> property. /// </remarks> public static void handleInitPreSuper(FormRun taskPageFormRun) { ; if (taskPageFormRun == null) { throw error(strfmt("@SYS115249", #taskPageFormRun)); // "The argument 'taskPageFormRun' cannot be null." } if (taskPageFormRun.args() == null) { throw error(strfmt("@SYS115334", #taskPageFormRun, #Value_Args)); // "The FormRun parameter '%1' cannot have a null args() value." } } X++: /// <summary> /// Performs all necessary actions for preparing to open a task page from a list page that should be /// taken in the <c>init</c> method after you call the <c>super</c> method. /// </summary> /// <param name="taskPageFormRun"> /// The <c>FormRun</c> instance that is being opened. /// </param> /// <remarks> /// If the form has been opened by using the <c>FormOpenMode::ForEdit</c> parameter, the query, /// including the user-defined filter, from the list page that opened this form will be copied and used /// for this form. The selected record from that list page will be selected on this form. Any order-by /// settings and the sort index will be cleared on the form and replaced with a new order-by based on /// the <c>RecId</c> value. /// </remarks> public static void handleInitPostSuper(FormRun taskPageFormRun) { if (taskPageFormRun == null) { throw error(strfmt("@SYS115249", #taskPageFormRun)); // "The argument 'taskPageFormRun' cannot be null." } }
__________________
// no comments |
|
19.11.2019, 17:42 | #3 |
Участник
|
для выноса программной логики формы в отдельный класс.
грубо говоря, проще допилить такой класс, чем наворачивать спагетти непосредственно в форме. ну, это в идеале.
__________________
Felix nihil admirari |
|
|
|