AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 26.11.2012, 18:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
Malaysia: Building a tree lookup
Источник: http://axmas.blogspot.com/2012/11/bu...ee-lookup.html
==============


1. In the AOT, create a new form named BudgetModelLookup. Set its design properties
as follows:

Property Value
Frame Border
WindowType Popup

2. Add a new Tree control to the design, with the following properties:

Property Value
Name ModelTree

3. Add the following line to the form's class declaration:
BudgetModelTree budgetModelTree;


4. Override the form's init() method with the following code:
public void init()
{
FormStringControl callingControl;
callingControl = SysTableLookup::getCallerStringControl (this.args());
super();
budgetModelTree = BudgetModelTree::construct(ModelTree, callingControl.text());
budgetModelTree.buildTree();
}

5. Override the mouseDblClick() and mouseUp() methods of the ModelTree control
with the following code, respectively:
public int mouseDblClick(int _x, int _y, int _button, boolean _ctrl, boolean _shift)
{
int ret;
FormTreeItem formTreeItem;
BudgetModel budgetModel;
ret = super(_x, _y, _button, _ctrl, _shift);
formTreeItem = this.getItem(this.getSelection());
select firstOnly SubModelId from budgetModel
where budgetModel.RecId == formTreeItem.data();
element.closeSelect(budgetModel.SubModelId);
return ret;
}
public int mouseUp(int _x, int _y, int _button, boolean _ctrl, boolean _shift)
{
int ret;
ret = super(_x, _y, _button, _ctrl, _shift);
return 1;

6. The form should look similar to the following screenshot:



7. In the AOT, open the BudgetModel table, and change its lookupBudgetModel()
method with the following code:

public static void lookupBudgetModel(FormStringControl _ctrl, boolean _showStopped = false)
{
Args args;
Object formRun;
args = new Args();
args.name(formStr(BudgetModelLookup));
args.caller(_ctrl);
formRun = classfactory.formRunClass(args);
formRun.init();
_ctrl.performFormLookup(formRun);
}


8. To see the results, open Budgeting | Common | Budget register entries. Start
creating a new entry by clicking on the Budget register entry button in the action
pane, and expand the Budget model lookup:








Источник: http://axmas.blogspot.com/2012/11/bu...ee-lookup.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Malaysia: Using a form for building a lookup Blog bot DAX Blogs 0 26.11.2012 11:11
Malaysia: Building a selected/available list Blog bot DAX Blogs 0 14.11.2012 14:11
Malaysia: Using a tree control Blog bot DAX Blogs 0 08.11.2012 11:11
Malaysia: Building a dynamic form Blog bot DAX Blogs 0 07.11.2012 17:11
Malaysia: Lookup Blog bot DAX Blogs 0 30.10.2012 15:11
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 05:45.