Diagnosis:

You want to read, edit and save texts in an TextEdit area and save it so a Standard Text object…

Solution:

tCode: SO10

The first step is to create an SO10 standard text that we would like to read, edit and save

Go to SO10 and create this text object:

/wp-content/uploads/2015/08/1_773699.png

Let us add some bogus text so we can see the text later in the tests…

Don’t forget to save.

/wp-content/uploads/2015/08/2_773700.png

tCode: SE80

Create a new Web Dynpro

/wp-content/uploads/2015/08/3_773701.png

Click Yes 🙂

/wp-content/uploads/2015/08/4_773714.png

Click Ok

Look Teddy.. a nice starting point…

/wp-content/uploads/2015/08/5_773715.png

We need to create a context element to bind the text to.

In this case we will use a simple string… This is the simplest example:

You’ll probably know how to bind dictionary fields etc but for this example, we’ll use simple components only.

/wp-content/uploads/2015/08/6_773735.png

This screen is shown:

/wp-content/uploads/2015/08/7_773736.png

Click OK and TADA… We’ve just created the first node.

Now, create an attribute:

Right click on NODE1

/wp-content/uploads/2015/08/8_773737.png

Give an attribute name and choose for type STRING…

/wp-content/uploads/2015/08/9_773738.png

TADA (again…)

/wp-content/uploads/2015/08/10_773739.png

Now that we’ve created the context, let us use it in the view.

Double-click on the view MAIN and go to the Context tab.

/wp-content/uploads/2015/08/11_773740.png

Drag and drop NODE1 from right to left…

/wp-content/uploads/2015/08/12_773750.png

Result:

/wp-content/uploads/2015/08/13_773751.png

Open the Layout tab

We’ll change the Layout of the ROOTUIELEMENTCONTAINER to GridLayout:

=> Just for design purposes…

/wp-content/uploads/2015/08/14_773752.png

We will create a Load button, a TextEdit area and a Save button.

It is possible to create containers etc first… You can do this if you really like to do some extra work…

Create the load button:

/wp-content/uploads/2015/08/15_773770.png

And a TextEdit area:

/wp-content/uploads/2015/08/16_773771.png

And a Save button:

/wp-content/uploads/2015/08/17_773772.png

This will then look like this (It’s rather ugly…):

/wp-content/uploads/2015/08/18_773768.png

Change the label of the button Load like this:

/wp-content/uploads/2015/08/19_773776.png

The rows and columns of the TextEdit area like this:

/wp-content/uploads/2015/08/20_773775.png

And button Save like this:

/wp-content/uploads/2015/08/21_773774.png

That looks a little more decent…

/wp-content/uploads/2015/08/22_773773.png

The clever boys and girls amongst you noticed that the buttons are not yet active.

Let us take care of that…

Select the Load button and ‘bind’ the onAction event…

/wp-content/uploads/2015/08/23_773786.png

Fill the popup like this:

/wp-content/uploads/2015/08/24_773787.png

Result:

/wp-content/uploads/2015/08/25_773788.png

Do the same for the Save button:

/wp-content/uploads/2015/08/26_773789.png

See the result:

/wp-content/uploads/2015/08/27_773791.png

The buttons are ACTIVE

/wp-content/uploads/2015/08/28_773790.png

Part 2: Bind SO10 Text To TextEdit area and back…Part 2

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply