`
JerryWang_SAP
  • 浏览: 1029085 次
  • 性别: Icon_minigender_1
  • 来自: 成都
文章分类
社区版块
存档分类
最新评论

如何使用SAP CRM WebClient UI实现一个类似新浪微博的字数统计器

阅读更多

In the blog we talk about the social media integration into CRM Interaction center agent inbox, which allows end users to directly reply facebook posts & tweets in CRM system. In order to achieve this we implement a very simple character counter which has similar functionality as that in twitter website:

 

 

The counter described in this blog is delivered by SAP in CRM 7.0 EHP3. You can find it in UI component SMCOV, view ReplyMessageView.htm. Its function is slightly different from twitter: it does not display the left number of characters which is allowed to input, but the number of characters which are ALREADY typed by end user.

The following functionalities are supported by this simple counter:

(1) Whenever you add, delete or change your input in text area, the number of characters you have typed will be automatically updated below the text area

(2) The cut & paste event are also captured by the counter Any other advanced functionalities like url automatically highlighted as hyperlink is not supported by this simple counter.

 

 

Here below is the implementation of this counter:

(1) In your UI component view, draw the visual area of the counter which will show the text “The number of characters entered:XXX” via html p tag:

<p id="COUNTER_TXT"  style="margin-left: 8px; margin-top: 1px; margin-bottom: 4px; margin-right: 8px; color:rgb(102,102,102)"></p>

(2) in line 32, the function handleClick acts as the event handler which will be called automatically whenever the content in the text area is changed. In line 34 the final text in the visual area of the counter is populated.

For translation purpose, the text is not hard-coded but stored and got in Online Text Repository:

lv_title_prefix = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_UIU_SOC_SMC/COUNTER_TXT' ). "#EC NOTEXT. 

lv_title_prefix = lv_title_prefix && ':'.

In line 35 the current number of characters is updated in the visual area of the counter. The variable counter is a DOM variable which represents the html tag p with ID COUNTER_TXT, which is retrieved later.

 

 

The function fillTitle is designed to ensure the counter still displays the correct number of typed characters in text area when the UI is rendered for the first time ( at that time no event for the text area will be fired ). Here the biggest challenge is how to get the ID of the text area, so that we can use document.getElementByID to get its DOM node and then get the actual content which has been typed in the text area.

As this text area is not manually created via native HTML code, it is impossible to get its ID directly in the view.

 

 

However, we could investigate on the naming convention of this ID via development tool ( just click F12 on web page) of IE. Click Find->Select element by click, then click on the text area, and development tool will automatically locate the native html textarea element, and then we can observe that the naming convention for it is _socialpost_struct.content.

 

 

The current component id is available in the attribute component id of view controller, so finally we can populate the ID of text area via the following code:

 

 

(3) The left code is very easy to understand: retrieve the DOM node for input textarea ( line 47) and visual area of counter( line 48), and register the event handler for three events on text area element.

 

 

要获取更多Jerry的原创文章,请关注公众号"汪子熙":

0
1
分享到:
评论

相关推荐

    CRM7.0 WebClient UI config

    WebClient UI是SAP CRM的一个核心组件,提供了一个基于Web的交互界面,使得用户能够访问和操作CRM系统功能,无论他们身处何地。 首先,我们要理解UI Guidelines的重要性。"UI Guidelines for CRM WebClient User ...

    Creating a Dropdown in SAP CRM WebUI.docx

    在SAP CRM WebUI中创建下拉列表是一个关键任务,特别是在设计用户界面以提供更高效、用户友好的交互时。本教程将引导你通过一系列步骤来实现这一目标,特别是针对SEX(性别)属性创建一个下拉框。 首先,你需要获取...

    SAP_CRM中文自学笔记

    SAP CRM是德国SAP公司提供的一个全方位客户关系管理解决方案,广泛应用于市场营销、销售和服务等领域,支持企业通过多种交互渠道与客户进行沟通。CRM系统能够处理从客户数据的收集、管理到客户交互过程中的订单处理...

    SAP CRM WebClient UI cross component跳转的一个具体例子

    Result list是model在ICQR里面,如果点service,会navigate到service detail page,这个service detail page是做在PRD02OV上,所以这个navigation是cross component navigation: Cross component navigati

    SAPCRM基础培训教材.doc

    《SAP CRM基础培训教材详解》 ...总结来说,SAP CRM的基础培训涵盖了WebClient UI的演变及其丰富元素,以及CRM与ERP的集成策略。了解这些知识,有助于更好地理解和使用SAP CRM系统,提升企业的运营效率和服务质量。

    SAPCRM基础培训.doc

    在SAP CRM基础培训中,WebClient UI(Web客户端用户界面)是一个重要的学习焦点,它是用户与系统交互的主要界面。下面我们将深入探讨WebClient UI的相关知识点。 WebClient UI的发展历程是从GUI(图形用户界面)...

    UI Guidelines for CRM WebClient User Interface

    UI Guidelines for CRM WebClient User Interface

    SAP CRM WebClient UI ON_NEW_FOCUS的用途

    Sent: Thursday, May 9, 2013 6:30 PM Subject: ON_NEW_FOCUS的用途 ROOT ———————————— Product ID PRODshortText ———————————— Product Description Genil Model hierarchy

    C# 处理新浪微博消息(json)

    本项目聚焦于使用C#处理来自新浪微博的JSON格式消息,这是一个涉及到数据解析和网络通信的重要技能。JSON(JavaScript Object Notation)是轻量级的数据交换格式,易于人阅读和编写,同时也方便机器解析和生成。 ...

    使用WebClient实现文件下载

    这里创建了一个`WebClient`实例,然后调用`DownloadFile`方法,指定远程URL和本地保存路径。 2. **异步操作**: 为了不影响应用程序的响应性,通常我们会使用异步版本的`DownloadFile`方法,即`DownloadFileAsync...

    C#新浪微博采集分析平台

    本文将围绕"C#新浪微博采集分析平台"这一主题,深入探讨其背后的技术实现与应用价值。 首先,我们来看该平台的核心技术——C#编程语言。C#是由微软公司开发的一种面向对象的编程语言,它具有丰富的类库和强大的性能...

    C#中WebClient实现文件下载

    为了确保总是获取最新文件,可以在URL后面附加一个随机查询字符串,这样每次请求看起来都是不同的,CDN就不会使用缓存的版本: ```csharp string urlWithTimestamp = $"{url}?{DateTime.Now.Ticks}"; wc....

    C# 使用WebClient类 下载网络指定资源

    在本教程中,我们将深入探讨如何使用WebClient类来实现一个功能完善的网络资源下载器,包括实时显示下载速度和进度,并在下载完成后提供提示。 首先,让我们了解WebClient类的基本用法。WebClient是System.Net命名...

    sap 简介及关键提示

    总之,SAP CRM通过其产品建议功能,为企业提供了一个强大的工具,以实现交叉销售、升级销售和降级销售,从而提升销售业绩和客户忠诚度。通过有效利用这些工具,销售团队可以像故事中的优秀推销员一样,从单一的客户...

    WebClient 的Post实现

    以下是一个简单的使用WebClient进行POST请求的示例: ```csharp using System; using System.IO; using System.Net; using System.Text; public class PostExample { public static void Main() { var client =...

    WebClientDemo_webclient_

    【WebClientDemo_webclient_】项目是一个C#编程示例,展示了如何使用`WebClient`类来实现文件的下载功能。在.NET Framework中,`WebClient`是System.Net命名空间下的一个类,它提供了一种简便的方法来上传和下载数据...

    silverlight 使用webclient 实现上传和下载数据流

    在开发Silverlight应用程序时,网络通信是一个重要的组成部分。为了实现数据的上传和下载,可以使用.NET ...对于初学者而言,了解如何使用WebClient类进行数据上传和下载是学习Silverlight开发的一个重要方面。

    WebClient下载文件展示进度条

    下面是一个完整的示例,展示了如何在WinForms应用程序中创建一个简单的进度条,并使用WebClient下载文件: ```csharp public partial class MainForm : Form { private WebClient webClient; private long ...

    基于WebClient的Ftp异步文件上传

    类库版可能提供更高级别的抽象,封装了FTP服务器连接、文件分包和合并等细节,而组件版可能是一个可复用的UI控件,允许开发者在用户界面上直接拖放文件进行上传。 总的来说,`WebClient`的异步FTP文件上传功能为...

    C#使用WebClient获取网页源文件例子

    压缩包中的`WebClientDemo`可能是一个C#项目的示例,其中包含了完整的源代码,包括如何使用`WebClient`下载并处理网页源文件的代码。通过查看和运行这个示例,你可以更深入地理解`WebClient`的工作原理,并学会如何...

Global site tag (gtag.js) - Google Analytics