Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

How to reset the CQ.ext.QueryBuilder and CQ.Ext.Form ?


Level 2


I am using the CQ's Dam search for fulltext search.

I am creating a form and setting the queryBuilder to the form. On load of the page, i am setting the predicates and filters and submitting the querybuilder, which is giving the results as expected.

Now I have changed my criteria for search, for which i need to change the existing paths set to the query builder. 

I am trying to do so, but it is not resetting the paths and appending the new paths to existing ones, which results to wrong results. 

can anyone help me in resetting the paths?

Here is my initial form and QB:

<form id="querybuilder-<%= time %>-form">
<script type="text/javascript">
    FullTextSearchFeature.defaultUrl = '<%=defaultUrl%>';
    CQ.Ext.onLoad(function() {
        /***** i18n start ****/
        CQ.I18n.setLocale('<%=language %>');     
        /*** i18n end ***/
        var form = new CQ.Ext.form.BasicForm("querybuilder-<%= time %>-form", {
            "method": "POST",
            "url": "<%= properties.get("url", "/bin/querybuilder.json")%>"
        var qb = new{
            "form": form,
            "renderFieldsTo": "querybuilder-<%= time %>-form"

    <cq:include script="body.jsp"/>


Here I am resetting the form/querybuilder:

var form = new CQ.Ext.form.BasicForm(, {
            "method": "POST",
            "url": FullTextSearchFeature.defaultUrl
        form = form.reset(); 
        var currentQueryBuilder = new{
            "form": form,

Thanks in advance.

0 Replies