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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 25.01.2011, 22:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
Solutions Monkey: Refreshing one user control webpart from another user control webpart through code.
Источник: http://blogs.msdn.com/b/solutions/ar...ough-code.aspx
==============
Enterprise portal supports connecting webparts and passing context between them. In some cases, you may want to refresh the consumer webpart from the provider webpart even if the context is not changing.



For example

1) UserControl1 is a grid of header rows (ex. Rental header) and serves as provider. Besides the grid, there is an action button on the user control.
2) UserControl2 is a grid of line rows (ex. Rental lines) and is the consumer


In User control 1 when the action button is clicked, you are calling X++ method which inserts record in the rental lines table through business logic and you want to refresh the UserControl2 , even though the context has not changed.



In this case , in the button click event you can fire the currentcontextchanged by yourself, so that the consumer webpart will reload itself.

Microsoft.Dynamics.Framework.Portal.UI.IAxContext contextInterface = Microsoft.Dynamics.Framework.Portal.UI.AxContextHelper.FindIAxContext(this);



contextInterface.FireCurrentContextChanged();



For this to work make sure

(1) UserControl1 atleast has one AXDataSourceControl with the Role set to Provider Consumer or Provider

(2) WebPart1’s (hosting UserControl1 ) Role is set to Provider in SharePoint Web Part Page

(3) WebPart2’s 9 hosting UserControl2) Role is set to Consumer in SharePoint Web Part Page

(4) WebPart1 and WebPart2 are connected in SharePoint Web Part Page to pass the AXContextList




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

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Solutions Monkey: Code compare utility in MorphX on EP User controls Blog bot DAX Blogs 0 21.12.2010 04:13
Solutions Monkey: 64bit machine - VS EP add-in not deploying user control to SharePoint while saving Blog bot DAX Blogs 0 06.01.2010 08:19
Solutions Monkey: Redirecting in EP user control to download a file Blog bot DAX Blogs 0 11.09.2009 15:05
Solutions Monkey: Passing parameters from Managed code to X++ in dataset Blog bot DAX Blogs 0 15.05.2009 09:06
Вопрос про Demand Planner slava09 DAX: Функционал 4 25.09.2006 11:43
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

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