Rich Text Editor example

This example describes how to create an application that displays inputted text in the Rich Text Editor.

Before beginning this example, create a Faces JSP in a Dynamic Web Project. Be sure you are viewing the project in the Web perspective.

  1. Expand the Faces Components drawer in the palette

  2. Drag

    Rich Text Area from the palette onto the JSP file to create the Rich Text Editor.

  3. Click the Rich Text Editor on the JSP file to select it.

  4. In the Attributes view, type sessionScope.text in the

    Bind to field.

  5. Drag

    Input from the palette onto the JSP file.

  6. Select the Input control on the JSP file to select it.

  7. In the Attributes view, type sessionScope.text in the

    Bind to field.

  8. Drag

    Button - Command from the palette onto the JSP file.

  9. Save and run the JSP on a test server.

After the JSP is launched, type text in the Input component. The entered text displays in the Input component. If you clear the text in the Rich Text Editor and type in the Input control, the entered text displays in the Rich Text Editor on submit.

 

Related reference

Rich Text Area