chuckie474
asked on
Display formatted output in JSF
I have a web application that uses jsf. My form allows a user to enter paragraphs into an h:inputTextarea component, and they can enter carriage returns and it saves the formatting correctly into the database. After saving and closing the form, they can open that form back up in read mode to see what they had written. I am using h:outputText to display their paragraphs, but outputText doesn't display the carriage returns.
When the user opens the form in edit mode, the carriage returns correctly display in the h:inputTextarea. But what can I use in JSF to preserve the format of their data while in read mode?
When the user opens the form in edit mode, the carriage returns correctly display in the h:inputTextarea. But what can I use in JSF to preserve the format of their data while in read mode?
<h:inputTextarea style="width:700px;height:100px;" value="#{paragraph.bodyText}" rendered="#{bean.mode='Edit'}"/>
<h:outputText value="#{paragraph.bodyText}" rendered="#{bean.mode='Read'}"/>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.