Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Line count in text field

Forum

Search UsersRules
Line count in text field
#1
Active user
Points:: 0
Joined:: Mar 20, 2012

Hello.

I have multiline text field on form. I want to show to the user how many lines he entered into this field. Is it possible?

I tried to place simple text field with multiline option on, and also tried to place textdocument, but the problem is that the content of the field is updated only when the text control leaves focus.

Profile
#2
Just came
Points:: 0
Joined:: Oct 8, 2013

May be this script helps you:

Code
&AtClient
Procedure OnOpen(Cancel)
   AttachIdleHandler("UpdateInformation", 0.2);
EndProcedure

&AtClient
Procedure UpdateInformation()
   TextInField = Items.TextField.EditText
   // and blah blah blah......
EndProcedure

Profile
#3
Active user
Points:: 0
Joined:: Mar 20, 2012

Hello. Thank you for this script, but it doens't work well. When I try to put lines count on the form from the idle handler like

Code
LineCount = StrLineCount(TextInField); 


text entered in the field is dropping off. The best i managed to do is like this:
Code
 
LineCount = StrLineCount(TextInField);
TextField = TextInField;

but it also moves cursor to the beginning of the field, and if i still entering the text, i get something messed

Profile
#4
Just came
Points:: 0
Joined:: Oct 8, 2013

Try to change property "EditTextUpdate" of TextField. Or use DataProcessor in path.

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.