Is there a limit of nested PocketQuery querys?

Hello,

I try to define a formular in my database with input fields and select options.

When I have a query with a template which calls another query by using $PocketQuery.renderPocketQueryMacro this works, but when this query has a template which calls another query by using $PocketQuery.renderPocketQueryMacro it does not work.

My Templates so far:

#foreach ($row in $result)
    #set($formDescriptor = $row.get('description'))
    <form name="${formDescriptor}" method="get" onsubmit="$row.get('onsubmit')" action="">
        <button type="submit" class="pq-change-button aui-button aui-style aui-button-primary">
            $row.get("buttonText")
        </button>
        <div id="${formDescriptor}_div">
            <table id="${formDescriptor}_table">
$PocketQuery.renderPocketQueryMacro("PocketQueryFormInput", {
"page": $page,
"parameters": {"formId":"1"},
"dynamicload": true
})
            </table>
        </div>
    </form>
#end
#foreach ($row in $result)
    <tr>
        <td>$row.get("description")</td>
        <td><input type="text" name="$row.get("name")"/></td>
        <td></td>
    </tr>
    $PocketQuery.renderPocketQueryMacro("DropDown", {
    "page": $page,
    "parameters": {"dropDownId":"1", "dropDownName":"pq_tarif"},
    "dynamicload": true
    })
#end
#set($dropDownName = $queryParameters.get('dropDownName'))
<select class="select" name="$dropDownName">
    #foreach ($row in $result)
        <option value="$row.get('value')" #if($row.get('selected') == 1)selected="selected"#end>$row.get("text")</option>
    #end
</select>

When I now call the query wich uses the FromTemplate it only shows me the button and the input fields but not the select options.

When I call the query wich uses the FromInputTemplate it shows the input field and the select options.

Is it because I can not nest 3 querys?

1 answer

Hi Marvin!

I think instead of nesting many queries, you should try to make use of the PocketQuery.load JavaScript method. Please check out this question here: https://answers.atlassian.com/questions/40353324

Let me know if you still need help and I will try to help you in more detail.

Best, Felix

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

998 views 23 13
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you