1 Reply Latest reply on Jul 25, 2008 4:10 AM by nimo stephan

    creating richFaces-Components dynamically using Java VS Page

    nimo stephan Master

      What is the difference of creating richFaces-Components dynamically using Java and creating richFaces-Components using PageTags ?

      Is it better to build components dynamically using Java ? Is it better to use Page-Tags ? I really do not understand where the difference lies. For example, I looked at the GoogleWebToolkit and saw that all components are created dynamically using Java instead of PageTags.

      I use Facelets and consider to insert richFaces-Components via JAVA-Code instead of Page-Tags. But I do not know, how to transfer this Java-Code in my Facelet.

      Look at this example:

      Using Page-Tags:

      <rich:dataGrid value="#{bean.list}" var="list">
      <h:outputText value="#{list.rowA}"/>

      Using JAVA-Code:

      import org.richfaces.component.html.HtmlDataGrid;
      HtmlDataGrid myList = new HtmlDataGrid();

      What is better? Where lies the differences? Can I do by using Page-Tags more than by using only Java-Code?

      What do you think? Are PageTags better than JavaCode.

        • 1. Re: creating richFaces-Components dynamically using Java VS
          nimo stephan Master

          Does no one knows the difference?

          I guess it s important to know which way is better to go.

          I have found out that using creating components in JAVA results better and much clearer jsf/xhtml-pages.

          And I have more control over all components without needing always a bridge of value-Binding between jsf and backingBean.

          So I come to the conclusion,

          that creating Components dynamically from JAVA-Code is much better than the static way via JSF.