Child pages
  • Using ConfiForms PlainView to render a custom html table

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This helps you to render a very custom outputs, as for each record rendering you have a shared Velocity Context. Below is an example that renders a custom html table for you

Consider a small form with just 2 fields

...

  • field1 of type text
  • field2 of type dropdown

...

ConfiForms Form Definition
formNamef
fsashINLINE


field1Text fieldtext

field2Dropdownfalse[1=OPTION 1|2=OPTION 2|]select

Standard TableView output

ConfiForms TableView
formNamef


PlainView output 

ConfiForms PlainView
formNamef
renderAsTable
evaluatetrue
#if(!${headerRendered})
<tr><th>Field 1</th><th>Field 2</th></tr>
#set($headerRendered = true)
#end

<tr><td>[entry.field1.escapeXml]</td><td>[entry.field2]</td></tr>


Here is how the PlainView is configured

Image Added

We selected to render it as a table

Image Added

Set the macro to support Velocity templating

Image Added

And placed Velocity template inside it's body. Basically rendering header only once, when "headerRendered" is not set/present

Code Block
#if(!${headerRendered})
<tr><th>Field 1</th><th>Field 2</th></tr>
#set($headerRendered = true)
#end

<tr><td>[entry.field1.escapeXml]</td><td>[entry.field2]</td></tr>

...