3 Replies Latest reply on Mar 27, 2007 4:16 AM by Alexander Thömmes

    Create Dynamic RichFaces DataTable in JavaClass

    Alexander Thömmes Newbie

      Hallo, i want to create a Dynamic DataTable in a JavaClass.
      My problem now is that whan i run the Application tomcat prints this Exception.
      I think it has to do with the Fecets. There is no Class like HtmlColumn() for the Facets Tag to use it in a Java Class. But i think i need this Class or another way to display this Tag in my Java Class.

      Exception:
      2007-03-26 15:47:01,394 ERROR [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/PortalNeu].[Faces Servlet]] - <Servlet.service() for servlet Faces Servlet threw exception>
      org.ajax4jsf.framework.resource.ResourceNotFoundException: Resource not registered : org.richfaces.renderkit.html.GradientA
      at org.ajax4jsf.framework.resource.ResourceBuilderImpl.getResource(ResourceBuilderImpl.java:376)
      at org.ajax4jsf.framework.resource.ResourceBuilderImpl.getResourceForKey(ResourceBuilderImpl.java:333)
      at org.ajax4jsf.framework.resource.InternetResourceService.serviceResource(InternetResourceService.java:128)
      at org.ajax4jsf.framework.resource.InternetResourceService.serviceResource(InternetResourceService.java:118)
      at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:207)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      at java.lang.Thread.run(Unknown Source)


      Code:

      public void initDtoAuswertung(){
       HtmlColumnGroup columnGroup = new HtmlColumnGroup();
       HtmlColumn topHeader;
       HtmlOutputText outputText;
      
       for(int i = 0; i < mGridManager.getDtoControllingAuswertung().getColumnSpanHeader().length; i++)
       {
       outputText = new HtmlOutputText();
       outputText.setValue(mGridManager.getDtoControllingAuswertung().getColumnSpanHeader()[0]);
       topHeader = new HtmlColumn();
       topHeader.setColspan(Integer.parseInt(mGridManager.getDtoControllingAuswertung().getColumnSpanHeader()[1]));
      
       topHeader.getChildren().add(outputText);
      
       columnGroup.getChildren().add(topHeader);
       }
      
       for(int i = 0; i < mGridManager.getDtoControllingAuswertung().getMDatenmenge().getMLAnzahlSpalten(); i++)
       {
       topHeader = new HtmlColumn();
       outputText = new HtmlOutputText();
      
       if(i == 0)
       topHeader.setBreakBefore(true);
      
       outputText.setValue(mGridManager.getDtoControllingAuswertung().getHeader());
      
       if(i >= 2)
       outputText.setStyle("vertical-align: bottom; layout-flow:vertical-ideographic; writing-mode:tb-rl");
      
       topHeader.getChildren().add(outputText);
      
       columnGroup.getChildren().add(topHeader);
       }
      
       mDataTable.getFacets().put("header", columnGroup);
       }