[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 913
  • Last Modified:

Character count in notes client

Hi,
  I am new to lotus notes. we are developing a mobile application in lotus notes. I want to implement character counter in  notes client. That is as and when the user types I want to show him the number of characters he has typed dynamically. How can I implement this. This is the most important requirement and I have no escape. I know it is possible in web client. But I want to do this in notes client. I have seen the similar functionality in domino designer that is as and when I type the code it shows the column and row count. Are there atleast any DLL's to do this using C API if not lotusscript or formula language.This is urgent. Experts please help.

I will tell you how I have impletented it now I have included the following code in onBlur and onFocus events:
var CharacterCount=0;
CharacterCount += RtBody.value.length;
var NumMsgs = 1;
if (CharacterCount > 160 )
{
NumMsgs =CharacterCount / 160;
NumMsgs=NumMsgs+1;
}
window.status="Charater Counter     "+CharacterCount +"(" + parseInt(NumMsgs) +")";

But this does not serve my purpose.
Any quick exact help will be very greatful

Thanks in advance.
rishi.
0
rishi_vino
Asked:
rishi_vino
1 Solution
 
madheeswarCommented:
As per I know its not going to be an easy task. And may not possible also.

Anyway I will check is thier anything possible in any method.

Wait for other experts.
0
 
rishi_vinoAuthor Commented:
Thanks for your quick response

0
 
Sjef BosmanGroupware ConsultantCommented:
It seems to me that you are going to transfer data over an SMS service. Without a proper protocol this is a dangerous thing, since how would you know that you missed some packets? But that's for you to think about. I hope you are going to use some of-the-shelf software for datacommunication.

I never managed to get onBlur and onFocus properly working in the Notes-client, but if they work that's great. Probably best is to do this with a NotesTimer, or a setTimeout in JavaScript although I don't know if the latter can be used in the Notes client.

In LotusScript (untested):

In a global declarations section:
   Dim nt As NotesTimer
   Dim counter As NotesItem
   Dim uidoc As NotesUIDocument

In the PostOpen:
   Set counter= Source.Document.getfirstitem("CharacterCount") ' put the name of the field in here
   Set uidoc= Source ' make source global
   Set nt= New NotesTimer(1) ' one second interval
   On Event Alarm From nt Call UpdateCount

Define a sub:
Sub UpdateCount(src As NotesTimer)
   Call counter.replaceitemvalue(Len(uidoc.fieldgettext("Body"))) ' hope this works...
End Sub
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now