This document could be used for beginners for Webclient UI development who wants to know how to implement value help.
Example:
When clicking F4 on BusinessPartner ID,
a new window pops up as value help, you can click search button to get a list of business partners and choose one of them:
Once you mark the first search result, both ID and name would be automatically written back to your host page.
Step1: Implement GET_P method for field “BusinessPartner ID”:
CASE iv_property.
WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
rv_value = cl_bsp_dlc_view_descriptor=>field_type_input.
ENDCASE.
Implement GET_V method:
create object rv_valuehelp_descriptor type cl_bsp_wd_valuehelp_navdescr
exporting
iv_outbound_plug = 'OP_PARTNER_SEARCH'.
Step2: Create a new outbound plug OP_PARTNER_SEARCH: ( the name must equal to the value passed to exporting parameter in GET_V method )
define a private attribute mv_popup with TYPE REF TO if_bsp_wd_popup in your view controller. Implement the following code:
DATA: lv_node TYPE REF TO cl_bsp_wd_context_node.
DATA: lv_title TYPE string.
lv_title = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_UIU_PROD_CUST/SEARCH_CUSTOMER' ).
mv_popup = comp_controller->window_manager->create_popup(
iv_interface_view_name = 'SearchHelpWindow'
iv_usage_name = 'BPSearch'
iv_title = lv_title ).
mv_popup->set_display_mode( if_bsp_wd_popup=>c_display_mode_surrounded ).
mv_popup->set_on_close_event( iv_view = me iv_event_name = 'CLOSEPOPUP' ).
mv_popup->open( 'CLEAR_ALL' ).
Step3: in step2 we try to open the popup window defined in component usage BPSearch, so we have to define that usage in runtime repository:
in code it is defined when value help window is closed, event CLOSEPOPUP will be triggered. So we create this event handler and implement it: In the event handler, we get the selected BP information from context node PARTNER of component BP_HEAD_SEARCH and set the content into our own field “BusinessPartner ID” and “Employee Name”:
method EH_ONCLOSEPOPUP.
DATA: lv_target_node TYPE REF TO cl_bsp_wd_context_node.
DATA: lr_node TYPE REF TO cl_bsp_wd_context_node,
lr_entity TYPE REF TO if_bol_bo_property_access,
lr_entity_bp TYPE REF TO if_bol_bo_property_access,
lv_fullname TYPE BU_DESCRIP,
lv_bp_id TYPE bu_partner.
lr_entity ?= me->typed_context->bpinfo->collection_wrapper->get_current( ).
ASSERT lr_entity IS NOT INITIAL.
lr_node = mv_popup->get_context_node( 'PARTNER' ).
CHECK lr_node IS BOUND.
lr_entity_bp = lr_node->collection_wrapper->get_current( ).
CHECK lr_entity IS BOUND AND lr_entity_bp IS BOUND.
lv_bp_id = lr_entity_bp->get_property_as_string( 'BP_NUMBER' ).
CHECK lv_bp_id IS NOT INITIAL.
lr_entity->set_property( iv_attr_name = 'BP_ID' iv_value = lv_bp_id ).
CALL FUNCTION 'CRM_BUPA_DESCRIPTION_READ'
EXPORTING
iv_partner = lv_bp_id
IMPORTING
ev_description_name = lv_fullname
EXCEPTIONS
no_partner_specified = 1
no_valid_record_found = 2
OTHERS = 3.
lr_entity->set_property( iv_attr_name = 'BP_NAME' iv_value = lv_fullname ).
Note: when you create the outbound plug OP_PARTNER_SEARCH in step2, the method is created with Protected by default. You should change the visibility manually to Public:
or else you will meet with CX_BSP_WD_INCORRECT_IMPLEMENT exception, since in the runtime the framework would expect to call it as public method as below:
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
相关推荐
CRM7.0 WebClient UI config
Sent: Thursday, April 18, 2013 3:59 PM Subject: 为什么design time时候看到的是ICQR,点了service之后看到02QR的代码被call到 这是cross component navigation在起作用。 Result list是model在ICQR里面,如果点...
Sent: Thursday, May 9, 2013 6:30 PM Subject: ON_NEW_FOCUS的用途 ROOT ———————————— Product ID PRODshortText ———————————— Product Description Genil Model hierarchy
UI Guidelines for CRM WebClient User Interface
C# WebClient 上传文件 WebClient上传文件至服务器
WebClient jar包
C# WebClient实现文件下载 示例源码
webui学习者
WebClient上传下载源码 我们先在IIS网站中建立一个文件夹,此处为"Mp3",并设置此文件夹相关读写权限。 例1:使用WebClient中的UploadFile方法上传文件。代码如下。使用此方法需要将上传的文件夹权限设置为 IIS来宾...
c#中的WebClient的用法,模拟请求
本篇文章主要介绍了C#中WebClient实现文件下载,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
支持 Session 和 Cookie 的 WebClient
WebClient下载文件展示进度条
另一个好处是HttpWebRequest类不会阻塞UI线程。例如,当您从响应很慢的API服务器下载大文件时,您的应用程序的UI不会停止响应。HttpWebRequest通常和WebResponse一起使用,一个发送请求,一个获取数据。...
基于webClient 的ftp操作,该案例是基于http模式,如果是ftp,直接将http改成ftp即可
webClient 服务器端与客户端配置
使用WebClient的UploadFileAsync、UploadFile、DownloadFile、DownloadFileAsync方法,异步调用服务器上传下载数据。
C# sliverlight 中 WebClient与WebRequest以及HttpWebRequest 的关系
WebClient的例子,在Eclipse中直接可以运行
C# WEBClient 文件上传下载