cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert the string of a TextEdit into node elements

Former Member
0 Kudos

Hi,

I have an Input TextEdit UI element in a view, and I want to send it's string as a "long text" table to an ABAP RFC function.

So I wonder If anyone could give me the Java code to convert the text of the box into node elements (card : 0..n). The split must be by word and each lines must have 72 char or less.

Node "It_Long_Text"

- tdformat (will always be '"* ")

- tdline

Thanks!

Edited by: Emanuel Champagne on Dec 19, 2007 6:14 PM

Edited by: Emanuel Champagne on Dec 19, 2007 6:24 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

If it is ok, please set to answered.

Stefan

Former Member
0 Kudos

...

Former Member
0 Kudos

Hi, this should work, you have to check in the backend for crlf.

public java.lang.String readText( com.sap.tc.webdynpro.progmodel.api.IWDNode node, int length )

{

//@@begin readText()

String sTemp;

String sText = "";

IWDNodeElement elementLine;

int size = node.size();

for (int i = 0; i < size; i++)

{

elementLine = node.getElementAt(i);

if (elementLine==null)

{

sText = "";

}

else

{

sTemp =elementLine.getAttributeValue("Tdline").toString();// elementLine.getAttributeAsText("Tdline");//elementLine.getAttributeValue("Tdline").toString();

// while (sTemp.length() < length && i < size - 1)

// {

// sTemp = sTemp.concat(" ");

// }

sText = sText.concat(sTemp);

}

}

return sText.trim();

//@@end

}

Stefan

Former Member
0 Kudos

In fact, it's exactly the contrary that I want to do!

String --> Node Elements

Edited by: Emanuel Champagne on Dec 19, 2007 6:14 PM