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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 22.09.2009, 11:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
Solutions Monkey: AxPopup Controls in EP
Источник: http://blogs.msdn.com/solutions/arch...ols-in-ep.aspx
==============
AxPopup Controls

AxPopup controls are used to open a page in a popup browser window and upon closing a popup page, pass data from the popup page back to the parent page and trigger an OnPopupClosed server event on the parent. This functionality is encapsulated in two controls - AxPopupParentControl to be used in the parent page and AxPopupChildControl to be used on the popup page. They both derive from AxPopupBaseControl. These controls are AJAX-compatible, so they can be created conditionally as part of a partial update.

Data can be passed from the popup page back to the parent page using AxPopupField objects. They are exposed via the Fields property of the AxPopupBaseControl, from which both AxPopupParentControl and AxPopupChildControl are derived.

AxPopupParentControl and AxPopupChildControl have fields with the same names. When the popup page closes, the value of each field of the AxPopupChildControl is assigned (via client-side script) to the correspondent field in the AxPopupParentControl.

AxPopupField can optionally be associated with another control, such as TextBox or any other control, by assigning its TargetId property to the ID property of the target control. This is useful, for instance, when the popup page has a TextBox control. In order to pass the user input to the parent page upon closing the popup, and to do it entirely on the client hence avoiding the round trip, a field needs to be associated with the TextBox control.

In AX 2009 this approach is used in number of places and one such control is the Business Relations list.

The AxPopupField control is placed in the user control displaying the list. In the code behind, the toolbar action calls the popup using the GetOpenPopUpEventReference method. Both the parent control and the childcontrol uses the field with the same name hiddenCustomerAccountNo to pass the values back& forth. The childcontrol gets the value from the text box using the TargetControlID.



smmBusRelListGrid.ascx

List containing the ParentControl from the popup

</SPAN>





smmBusRelListGrid.ascx.cs

Code behind opening up the popup using GetOpenPopUpEventReference

protected void AddCustomerAccountNoScript(SetMenuItemPropertiesEventArgs e, string custAccount)

{

AxUrlMenuItem menuItem = new AxUrlMenuItem(CUSTOMER_ACCOUNT_DIALOG);

DataSetViewRow row = this.GetCurrentDataSetViewRow();

if (row != null)

{

AxTableContext context = AxTableContext.Create

(row.GetTableDataKey(row.DataSetView.Metadata.RootDataSource, null));



menuItem.MenuItemContext = context;



//Adding the CustAccount QueryString variable

if (custAccount != string.Empty)

{

menuItem.ExtraParams.Add("CustAccount", custAccount);

}

menuItem.RemoveNavigation = true;



//Calling the javascript function to set the properties of opening the customer account

//on clicking the menu items.

e.MenuItem.ClientOnClickScript = this.PopupConvertCustomer.GetOpenPopupEventReference(menuItem);

}

}

CustomerAccountDialog.ascx

The popup form transferring the value entered in the target to the parent control by using the same control name.

























































CustomerAccountDialog.ascx.cs

Pop up closed after validing the data entered in the popup , giving control back to the parent page.

//Used to validate the CustAccount no etered.

protected void OkButton_Click(object sender, EventArgs e)

{

try

{

if (this.txtCustAccount.Text.Equals(string.Empty))

{

//Displaying error message: Account number is not specified

DisplayInfolog(InfoType.Error, "@SYS24085");

return;

}



//Validating the Customer Account no. entered

if (!ApplicationProxy.SmmOpportunityStatusUpdate.checkCustomerAccount(this.AxSession.AxaptaAdapter, this.txtCustAccount.Text))

{

return;

}



//Calling the script for closing the dialogbox

this.popupChild.ClosePopup(true, true);

}

catch (Exception ex)

{

AxExceptionCategory exceptionCategory;

// This returns true if the exception can be handled here

if (!AxControlExceptionHandler.TryHandleException(this, ex, out exceptionCategory))

{

// The exception was fatal - in this case we re-throw.

throw;

}

}

}





==============
Источник: http://blogs.msdn.com/solutions/arch...ols-in-ep.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Solutions Monkey: Integrating EP Web Parts to non-EP SharePoint sites Blog bot DAX Blogs 0 04.04.2009 03:19
Solutions Monkey: Deploying Ax 2009 SP1 EP Blog bot DAX Blogs 0 05.02.2009 07:08
Solutions Monkey: EP SSL ( https) Setup Blog bot DAX Blogs 0 23.10.2008 12:05
Solutions Monkey: EP Deployment - Internals Blog bot DAX Blogs 0 21.10.2008 20:05
Solutions Monkey: Using Microsoft Dynamics Ax 2009 Workflow controls in EP Blog bot DAX Blogs 0 30.07.2008 10:05
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 19:41.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.