2 Replies Latest reply on Feb 16, 2010 5:34 AM by Nick Belaevski

    How can I dynamically (/programmatically) create f:verbatim

    Srikanth Chakravarthy Newbie

      Hi,

       

      I am developing an application that uses Richfaces and creates the components dynamically. I have the relevant classes to create the richfaces components and the core JSF components like Panel Grid, group , etc.

       

      I know there is no support to add a HTML fieldset through JSF other than wrapping it with a f:verbatim tag.

      If I use fieldset in an XHTML file and run the app, it works fine (a fieldset is rendered) even without using a f:verbatim tag.

       

      Now to do that dynamically, I need to create an object of f:verbatim.

      This is how I have created the component.

       

      String

      fieldsetHTMLText =

       

      "<fieldset id=\"fieldset1\" class=\"demo_fieldset\" style=\"width: 400px; position: absolute; left: 30px; top: 30px;\">";

       

      UIOutput verbatim = new UIOutput();

      verbatim.setRendererType("javax.faces.Text");

       

      verbatim

      verbatim

       

      .setId("verbatim1");

       

      verbatim.getAttributes().put("escape", true);

       

      verbatim.setValue(fieldsetHTMLText);

       

      In this case it simply outputs the text that I have set in the string fieldsetHTMLText.

       

      Considering the above please let me know what is wrong and how I can correctly display a fieldset dynamically.

       

      Regards,

      Srikanth