I have incorporated "Change Params Template" as part of my Custom Template hence i have only checked "Enable dynamic parameters" in Macro Definition on the page. I don't want PQ to execute query on page load as it is a complex one and takes time. How can i "Disable Auto Load" from the Custom Template i have made?
Hi Pranjal,
I created a new beta release for PocketQuery 2.1.1. You can find it here. With this version, the only requirement for "disable autoload" will be "dynamic load". So you should be able to use it properly with your own form. Besides that, the issue that fields in the form won't appear if you didn't enter anything should be fixed as well.
Please let check it out and provide me some feedback as always . Thanks for your support!
Regards, Felix (Scandio)
Felix,
Here are the observations:
It seems that template associated with a query is getting loaded/executed only when result is being displayed.
Have a look at the Snapshot below:
image2016-6-28 17:2:14.png
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Felix,
I guess the template always loads at the time of results. Since i have my default values defined as junk (in prod instance), the query returns empty result on page load along with a message and my form along with this. This gives an impression that form is loading on the page load but actually that's not the case.
This scenario changes when you check "disable auto load" and uncheck "Show change params template", you actually don't see anything.
Also, if you are just executing standalone query like "select * from emp;" and "disable auto load", you'll see a blank page which is obvious and users will not even get to know that there is a macro there. Ideally for queries without parameters, there should be some way to execute queries with Auto Load disabled.
OR, "Disable auto load" should be kept for queries only with parameters not with others.
I may not have explained the case in proper order but hope you get the gist.
The only reason i defined my custom form was:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see what you are saying with "disable autoload". Maybe you can try it with simple CSS and JS and use the default change params template:
<style> .pq-dynamic-parameter-form label { font-weight: bold; } </style> $PocketQuery.template("default") <script> jQuery('.pq-change-button').text('My Button'); jQuery('.pq-dynamic-parameter-form input').val(''); </script>
However, there will be a delay until this is really done...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Another workaround would be to use two queries. One is only for the form and is kind of a dummy query like "SELECT 1". In the template with the form, you can use JS to render another query that actually produces the result. I put up an example for someone else one day that you can find here:
Maybe this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pranjal,
Thanks for remembering! How about checking DynamicLoad AND ChangeParams and simply hiding the ChangeParams form with CSS in the template?
<style> .pq-dynamic-parameter-form { display: none; } </style>
Regards, Felix
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Felix, it did not work, let me tel you why.
I also have a custom form with the same class i.e. class="aui pq-dynamic-parameter-form". So i changed this class name, enabled "Change Params Template", "Dynamic Load" and Disabled "Auto Load". I added the script you gave me in my custom template. The moment i did this, my form got masked by the default form that comes when you enable "Change Params Template".
Ideally, the default should be hidden and the one i made should be visible.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
my form got masked by the default form that comes when you enable "Change Params Template"
Sorry, I'm a little lost. You hide the default form .pq-dynamic-parameter-form with CSS. You give your form a different class. I would think the default form would now be hidden and your form would be visible?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Even if i change the class name of my custom form, my custom form is getting hidden and the default one starts appearing.
One more observation, when "Disable AutoLoad" is set to true and no value in the Default Value field, the text fields are not appearing on the page and only Change button is appearing.
We can have a quick GoTo meeting session if you are available for 5 mins. I can send you an invite. What do you say?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pranja, I will reproduce this on my local system during the next days. I'll let you know.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the feedback, Pranjal. DynamicLoad and ChangeParams are currently required unfortunately. It's on the roadmap to enhance this feature. I think you could find a workaround with ChangeParams unchecked (I can help you with that if you want). But DynamicLoad is definitely required currently.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That would be great Felix. Currently i have given some special characters in the Default value of parameters for which i know there are no related records in the DB. When the page loads, it loads with the form but with a message as "Query was executed successfully, the result set was empty". This confuses users as they don't know what this message is and what query it is talking about, i need to explain them (As many are from non technical background).
BTW, i did try the method of pasting the JQuery code (Custom HTML at the end of the page) mentioned on other ticket but it did not work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.