版权声明:本文为博主汪子熙原创文章,未经博主允许不得转载。 https://cloud.tencent.com/developer/article/1438599
<%@page language="abap" %>
<%@extension name="thtmlb" prefix="thtmlb" %>
<%@extension name="chtmlb" prefix="chtmlb" %>
<%@extension name="bsp" prefix="bsp" %>
<%
DATA: lv_id TYPE string VALUE '_socialpost_struct.content' .
DATA: lv_title TYPE string.
" will be replaced by OTR
lv_title = 'the count you have input:'.
lv_id = controller->component_id && lv_id.
%>
<chtmlb:config mode = "RUNTIME"
xml = "<%= controller->configuration_descr->get_config_data( ) %>" />
<br>
<p id="char" style="margin-left:8px"></span>
<script>
var content;
var counter;
function handleClick()
{
var sCount = "<%= lv_title %>" + content.value.length;
counter.innerHTML = sCount;
}
function fillTitle()
{
counter.innerHTML = "<%= lv_title %>";
}
window.onload = function(){
content = document.getElementById("<%= lv_id %>");
counter = document.getElementById("char");
if( content != null )
{
content.onkeyup = handleClick;
content.onkeydown = handleClick;
}
else
{
alert("content not found!");
}
fillTitle();
}
</script>