Показать сообщение отдельно
Старый 19.11.2019, 16:00   #2  
dech is offline
dech
Участник
Аватар для dech
Самостоятельные клиенты AX
 
642 / 347 (13) ++++++
Регистрация: 25.06.2009
Адрес: Омск
Записей в блоге: 3
Цитата:
Сообщение от SuperStar88 Посмотреть сообщение
На некоторых формах в Init() прописаны такие штуки, для чего они?
(Например, форма InventTable)
X++:
    SysListPageHelper::handleInitPreSuper(element);

    super();

    SysListPageHelper::handleInitPostSuper(element);
Как насчет заглянуть внутрь и посмотреть как оно работает? Там и с документацией тоже все норм вроде.
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