Confiforms ListView HTML : duplicate table headers for each entry as a HTML table

medcynyc August 5, 2020

Hi!

I am using the following Vertuna tutorial  to create and custom a HTML table using the Confiforms ListView macro but even but trying to replicate precisely the example in the tutorial, I am not able create a cohesive HTML table... headers are created for every single entry, so essentially, 100 tables would be created if I have 100 entries.... 

 

@Alex Medved _ConfiForms_ could I please have your precious advise ? I just want to be able to create a plain html table that I could customize extensively.

 

This is the tutorial that I am referring to:https://wiki.vertuna.com/display/CONFIFORMS/Hacking+ConfiForms+ListView+macro+to+show+the+forms+data+in+Confluence+the+way+you+want

 

Could you please kindly assist ? this is a major roadblock for my project.

I tried with PlainView and ListView...no luck at all...

 

Thanks a million,

Cyril

 

 

1 answer

0 votes
Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2020

Anything you put inside the ListView or PlainView is rendered for each entry matching your filter.

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2020

And just to mention that the tutorial you are referring to works for Confluence up to version 5.9

Current versions of Confluence does not allow you to output "parts" of the table html tags as is shown there... Confluence tries to "fix" that for you and attempts to wrap into tables itself.

medcynyc August 6, 2020

Thanks for the quick response but it doesn't answer my question at...Your explanation was naturally observed....

As mentioned, I used the Vertuna tutorials which clearly shows that the table header should be positioned outside the plainview or list view macro, so that's naturally what I tried too...in this scenario the header is simply not attached to the core body...

Anyway, I figured it out, so this is not an issue anymore.

However, would you be able to tell me if formulas such as sum or count are supported in plainview or listview at all ?Such as sum:([entry.field] or Count: ?

 

Thanks,

 

Cyril

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2020

No, they are not supported (not via ConfiForms Field macros at least). Only in TableViewMerger or using the ValueView macro (which can be used inside the ListView)

medcynyc August 6, 2020

Thank you for your quick answer, much appreciated.

Are there any ways at all to create my own html table using confiforms data ?? or to overwrite confluence formatting through script?

Alternatively, could I run a script to automatically display a dynamic csv file on a confluence page ?

It looks like my hack was finally overwritten by confluence overnight...

Thanks in advance for sharing your insights..as usual, very valuable.

medcynyc August 9, 2020

Nothing ? 

 

At the very least, I would like to be able to query the rest API within an html macro to get the JSON data ?

 

I tried to run the below script, but no luck at all ...Could you please advise ?

 

<script type="text/javascript">

AJS.$.ajax({

url: 'http://localhost:8090/ajax/confiforms/rest/filter.action?pageId=1671243&f=formname&q=entry:field'

type: "GET",

dataType: "json",

success: function(data) { AJS.log(data); }

});

</script>

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 17, 2020

What is "q=entry:field" Leave the "q" parameter empty. 

Rest API for ConfiForms is documented here

Another option to render a custom table is to use PlainView and use Velocity templating

See this page for the demo https://wiki.vertuna.com/x/AwOXAw

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events