This discussion is archived
2 Replies Latest reply: Apr 19, 2013 10:06 AM by user757151 RSS

Programmatically collapse queryPanel in an af.query

user757151 Newbie
Currently Being Moderated
I've a requirement where a page must:

1. have an af:query with a search results table. (It must be an af:query because it must expose the names search criteria of the underlying View Object.
2. the query panel must be disclosed by default.
3. After the user executes the search by pressing the search button, the query panel must be collapsed so that the search results table is visible in the available real estate.

The use case is due to there being only a limited amount of real estate.

so i tried binding the af:query to a backing bean and then using setDisclose(). However, setDisclose() is having no effect on the UI. Is there something else/different i need to do.

here is the backing bean code:
    private RichQuery af;

    public void setAf(RichQuery af) {
        this.af = af;
    }

    public RichQuery getAf() {
        return af;
    }

    private RichQuery af;

    public void setAf(RichQuery af) {
        this.af = af;
    }

    public void myQueryOperationListener(QueryEvent queryEvent)
    throws Exception{
        ... //code that executes the search

        //this is where i attempt to collapse the search panel
        RichQuery richQuery = this.getAf();
        richQuery.setDisclosed(false);
        /* print to debug. isDisclosed() is returning false as expected, for what it is worth. */
        System.out.println("Disclosed set to " + richQuery.isDisclosed());
    }
here is the definition of the af:query - the queryListener attribute is bound to the above myQueryOperationListener() function :
 <af:query id="qryId1" headerText="Search"
         value="#{bindings.MessagesJoinedVCAllMessageTextQuery.queryDescriptor}"
        model="#{bindings.MessagesJoinedVCAllMessageTextQuery.queryModel}"
        queryListener="#{backingBeanScope.testQuery.myQueryOperationListener}"
        queryOperationListener="#{bindings.MessagesJoinedVCAllMessageTextQuery.processQueryOperation}"
       resultComponentId="::resId1"
      saveQueryMode="readOnly" disclosed="true"
     binding="#{backingBeanScope.testQuery.af}"
    criterionFeatures="matchCaseDisplayed"/>
thanks for your help.

Edited by: user757151 on Apr 19, 2013 9:16 AM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points