iteratively modify object htmlcanvas

59 views Asked by At

I am generating a html report in Java using renderSnake. I am quite new using renderSnake so I still have doubts about some of the basics. My report contains a list of Object which may vary in size.

I want everyone of these objects to generate the same html code but I do not know how to iteratively modify or add content to HtmlCanvas.

I am imagine something like this:

 HtmlCanvas html = new HtmlCanvas();
 html
    .head()
           some code here
    ._head()
    .body()
           some code here
    ._body
 ._html();

  for(oject e : inList){
       generatedCode=generate some html code
       html.add(generatedCode)
  }

Does anyone know how to accomplish this?

1

There are 1 answers

0
antonio_Developer On BEST ANSWER

I got a solution by myself.

It is just necesary to reopen the htmlcanvas and it will concatenate them instead of overwritting it.

html
    .html()
         .body()
            ... some code here
         ._body()
     ._html();

some code
for(object e:inlist){
html
    .html()
         .body()
            ... some more code here
         ._body()
     ._html();
}