on 11-27-2006 1:15 PM
Hello All,
I am using a TextEdit and I need to track the text entered in the UI separated by Carriage Return. I have mapped a context attribute to this TextEdit field.
Basically if user enters
Line 1
Line 2
in 2 separate lines by enter space, I must be able to read the text with the carriage return demarcation so that it can be saved in R/3 as separate text lines.
Any idea how to track the carriage returns in the text entered by the User in the UI? When I print the context value which holds the text, I cant see any carriage return encoding separated by special characters.
Any hints are most welcome!
Thanks,
Dhanz
Set wrapping=WDTextWrapping.HARD. This should insert line break characters.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dhanya,
You can also use following method.
StringTokenizer st=new StringTokenizer(var,"\n",false);
while(st.hasMoreTokens())
{
wdComponentAPI.getMessageManager().reportSuccess(st.nextToken());
}
StringTokenizer constructor has three parameters.Omit second parameter if u r not sure of the delimeter type.
Third parameter is required if you also want to return delimeter character.
Hope it helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
String tokens[] = null;
String splitPattern = "n";
tokens = YOUR_TEXT.split(splitPattern);
for (int i = 0; i < tokens.length; i++) {
System.out.println(tokens<i>);
}
Message was edited by:
Roberto Tagliento
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.