2 Replies Latest reply on Sep 5, 2012 5:29 AM by Adheep M

    How to render HTML CODES in Richfaces Datatable column?

    Adheep M Newbie

      Hi,

       

      I'm trying to display data containing HTML codes like <p>, <br>, <font> etc in Datatable column, but they are not getting rendered as a HTML code instead it is getting displayed as text with "<p><font color="#DFDFDF">Test Data<font></p>"


      Below is the coding for the Datatable:

       

                        <a4j:outputPanel id="NotesDataTableContainer">
                                  <rich:dataTable id="NotesDataTable"
                                      value="#{NotesManagedBean.notesList}" var="notesList">
                                      <rich:column>
                                          <f:facet name="header">
                                              <h:outputText value="Title" styleClass="header" />
                                          </f:facet>
                                          <h:outputText value="#{notesList.notesDescription}"
                                              styleClass="content" />
                                      </rich:column>
                                      <rich:column>
                                          <f:facet name="header">
                                              <h:outputText value="Description" styleClass="header" />
                                          </f:facet>
                                          <h:outputText value="#{notesList.notes}" styleClass="content" />
                                      </rich:column>
                                      <rich:column>
                                          <f:facet name="header">
                                              <h:outputText value="Added By" styleClass="header" />
                                          </f:facet>
                                          <h:outputText value="#{notesList.createdBy}"
                                              styleClass="content" />
                                      </rich:column>
                                      <rich:column>
                                          <f:facet name="header">
                                              <h:outputText value="Added Date" styleClass="header" />
                                          </f:facet>
                                          <h:outputText value="#{notesList.createdDate}"
                                              styleClass="content" style="width:70px;" />
                                      </rich:column>
                                  </rich:dataTable>
                              </a4j:outputPanel>
      

       

      Below is the screenshot:

      adheep_datatable_error.PNG