Pocket Query: Is there a way to disable automatic query execution when the page is loaded?

Lawrence C January 26, 2016
  1. Whenever we load a PQ page, the query is automatically being run. Is there any way to disable this? We would like to have empty parameters for the user to specify to do query searches. This is something that we would not like to hard code/ specify but much rather leave blank for the user to input.

2 answers

0 votes
Felix Grund (Scandio)
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.
February 10, 2016

Hi Lawrence,

You could try the following as a temporary workaround.

Enter this code at ConfluenceAdmin > Custom HTML > At end of the BODY:

<script>
(function($) {
	var QUERY_NAME = 'yourQueryName';
	var dynamicLoadClass = 'pocketquery-dynamic-load';
	var $container = $('.'+dynamicLoadClass+'[data-query="'+QUERY_NAME+'"]');
	$container.removeClass(dynamicLoadClass);
	AJS.toInit(function() {
		$container.addClass(dynamicLoadClass);
	});
}(jQuery));
</script>

In the code, replace yourQueryName with the name of your query.

Works for me with PocketQuery 2.0.3. We'll add a proper feature for this soon, somehow.

Let me know if this works!

Regards, Felix (Scandio)

 

0 votes
Felix Grund (Scandio)
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.
January 26, 2016

Hi Lawrence,

Very good point, I'm wondering why I didn't come up with this idea on my own. So thanks at the first place. I put this on the list of features for PocketQuery 2.1 which we plan to released in late February.

If this is important for you, I could provide you a workaround until now. Question: do you only have one PocketQuery or multiple in your page? Could you paste me the storage format of the page?

Regards, Felix

Lawrence C January 27, 2016

Hey Felix,

Thanks for letting me know. I would love a work around. This would possibly be for a single and/or multiple PQs on the page.

Storage format:

<p>&nbsp;</p>
<p><ac:structured-macro ac:macro-id="de1923b2-922c-483e-b68a-d9f4d674115e" ac:name="pocketquery" ac:schema-version="1"><ac:parameter ac:name="name">MOATEnable</ac:parameter><ac:parameter ac:name="dynamicload">true</ac:parameter><ac:parameter ac:name="includereloadbutton">true</ac:parameter><ac:parameter ac:name="includechangetemplate">true</ac:parameter><ac:parameter ac:name="parameters">partnerid=4&amp;ToC=4</ac:parameter><ac:parameter ac:name="allowgetparams">true</ac:parameter></ac:structured-macro></p>

thanks,

Lawrence

Lawrence C February 10, 2016

Hey @Felix Grund (Scandio), just checking up to see if you were able to get a workaround for this, thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events