title: How make form visible after clicking search button in adf Query?
body: <p>Hello I am developing a web applicaiton using Oracle ADF and jdeveloper11.1.2.4. Actually I have a page with the fllowing query and a form. Searching and everything is fine but when the page is loaded for the first time from is empty. It is not looking good. So my Idea is this form should be initially invisible  and it should be visible only after user hits search button in Search from(af:query).</p>
  
  <p><img src="https://i.stack.imgur.com/vb9oA.png" alt="enter image description here"></p>
  
  <p>Please help me. How I can achieve this.</p>
  
  <p>Thanks in advance.</p>
  
  <p>The following is my .jsf code </p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"&gt;
      &lt;af:document title="Search/Modfiy KPI" id="d1"&gt;
          &lt;af:messages id="m1"/&gt;
          &lt;af:form id="f1"&gt;
              &lt;af:pageTemplate viewId="/adminPageTemplate.jsf" id="pt1"&gt;
                  &lt;f:facet name="Center"&gt;
                      &lt;af:panelStretchLayout id="psl1"&gt;
                          &lt;f:facet name="bottom"/&gt;
                          &lt;f:facet name="center"&gt;
                              &lt;af:panelSplitter id="ps1" orientation="vertical" dimensionsFrom="children"
                                                splitterPosition="191"&gt;
                                  &lt;f:facet name="first"&gt;
                                      &lt;af:panelGroupLayout layout="vertical" id="pgl1"&gt;
  
                                              &lt;af:query id="qryId1" headerText="Search KPI" disclosed="true"
                                                        value="#{bindings.KpiSearchCriteriaQuery.queryDescriptor}"
                                                        model="#{bindings.KpiSearchCriteriaQuery.queryModel}"
                                                        queryOperationListener="#{bindings.KpiSearchCriteriaQuery.processQueryOperation}"
                                                        fieldWidth="110"
                                                        queryListener="#{pageFlowScope.updateORDeleteBean.customSearch}"
                                                        partialTriggers="::pfl1"/&gt;
  
                                      &lt;/af:panelGroupLayout&gt;
                                  &lt;/f:facet&gt;
                                  &lt;f:facet name="second"&gt;
                                      &lt;af:panelGroupLayout id="pgl5" layout="vertical" halign="center"&gt;
                                          &lt;af:panelGroupLayout id="pgl3" layout="horizontal" halign="center"&gt;
                                              &lt;af:panelGroupLayout layout="horizontal" id="pgl2"&gt;
                                                  &lt;f:facet name="separator"&gt;
                                                      &lt;af:spacer width="10" height="1" id="s1"/&gt;
                                                  &lt;/f:facet&gt;
                                                  &lt;af:commandButton actionListener="#{bindings.First.execute}"
                                                                    text="First" disabled="#{!bindings.First.enabled}"
                                                                    partialSubmit="true" id="cb1"/&gt;
                                                  &lt;af:commandButton actionListener="#{bindings.Previous.execute}"
                                                                    text="Previous"
                                                                    disabled="#{!bindings.Previous.enabled}"
                                                                    partialSubmit="true" id="cb2"/&gt;
                                                  &lt;af:commandButton actionListener="#{bindings.Next.execute}" text="Next"
                                                                    disabled="#{!bindings.Next.enabled}"
                                                                    partialSubmit="true" id="cb3"/&gt;
                                                  &lt;af:commandButton actionListener="#{bindings.Last.execute}" text="Last"
                                                                    disabled="#{!bindings.Last.enabled}"
                                                                    partialSubmit="true" id="cb4"/&gt;
                                              &lt;/af:panelGroupLayout&gt;
                                              &lt;af:spacer width="10" height="10" id="s3"/&gt;
                                              &lt;af:panelGroupLayout id="pgl4" layout="horizontal"&gt;
                                                  &lt;af:commandButton text="Delete" id="cb5"
                                                                    actionListener="#{updateORDeleteBean.delete}"/&gt;
                                                  &lt;af:spacer width="10" height="10" id="s2"/&gt;
                                                  &lt;af:commandButton text="Update" id="cb6"
                                                                    actionListener="#{updateORDeleteBean.update}"/&gt;
                                              &lt;/af:panelGroupLayout&gt;
                                          &lt;/af:panelGroupLayout&gt;
                                          &lt;af:panelFormLayout id="pfl1" visible="#{pageFlowScope.showForm}"&gt;
                                              &lt;af:inputText value="#{bindings.Id.inputValue}"
                                                            label="#{bindings.Id.hints.label}"
                                                            required="#{bindings.Id.hints.mandatory}"
                                                            columns="#{bindings.Id.hints.displayWidth}"
                                                            maximumLength="#{bindings.Id.hints.precision}"
                                                            shortDesc="#{bindings.Id.hints.tooltip}" id="it1"
                                                            readOnly="true"&gt;
                                                  &lt;f:validator binding="#{bindings.Id.validator}"/&gt;
                                                  &lt;af:convertNumber groupingUsed="false" pattern="#{bindings.Id.format}"/&gt;
                                              &lt;/af:inputText&gt;
                                              &lt;af:inputText value="#{bindings.KpiName.inputValue}"
                                                            label="#{bindings.KpiName.hints.label}"
                                                            required="#{bindings.KpiName.hints.mandatory}" columns="110"
                                                            maximumLength="#{bindings.KpiName.hints.precision}"
                                                            shortDesc="#{bindings.KpiName.hints.tooltip}" id="it2"&gt;
                                                  &lt;f:validator binding="#{bindings.KpiName.validator}"/&gt;
                                              &lt;/af:inputText&gt;
                                              &lt;af:inputText value="#{bindings.KpiSql.inputValue}"
                                                            label="#{bindings.KpiSql.hints.label}"
                                                            required="#{bindings.KpiSql.hints.mandatory}" columns="110"
                                                            maximumLength="#{bindings.KpiSql.hints.precision}"
                                                            shortDesc="#{bindings.KpiSql.hints.tooltip}" id="it3"
                                                            rows="3"&gt;
                                                  &lt;f:validator binding="#{bindings.KpiSql.validator}"/&gt;
                                              &lt;/af:inputText&gt;
                                              &lt;af:selectOneChoice value="#{bindings.Category.inputValue}"
                                                                  label="#{bindings.Category.label}"
                                                                  required="#{bindings.Category.hints.mandatory}"
                                                                  shortDesc="#{bindings.Category.hints.tooltip}"
                                                                  id="soc1"&gt;
                                                  &lt;f:selectItems value="#{bindings.Category.items}" id="si1"/&gt;
                                              &lt;/af:selectOneChoice&gt;
                                              &lt;af:selectOneChoice value="#{bindings.Module.inputValue}"
                                                                  label="#{bindings.Module.label}"
                                                                  required="#{bindings.Module.hints.mandatory}"
                                                                  shortDesc="#{bindings.Module.hints.tooltip}" id="soc2"&gt;
                                                  &lt;f:selectItems value="#{bindings.Module.items}" id="si2"/&gt;
                                              &lt;/af:selectOneChoice&gt;
                                              &lt;af:selectOneChoice value="#{bindings.Submodule.inputValue}"
                                                                  label="#{bindings.Submodule.label}"
                                                                  required="#{bindings.Submodule.hints.mandatory}"
                                                                  shortDesc="#{bindings.Submodule.hints.tooltip}"
                                                                  id="soc3"&gt;
                                                  &lt;f:selectItems value="#{bindings.Submodule.items}" id="si3"/&gt;
                                              &lt;/af:selectOneChoice&gt;
                                              &lt;af:inputText value="#{bindings.Threshold.inputValue}"
                                                            label="#{bindings.Threshold.hints.label}"
                                                            required="#{bindings.Threshold.hints.mandatory}" columns="15"
                                                            maximumLength="#{bindings.Threshold.hints.precision}"
                                                            shortDesc="#{bindings.Threshold.hints.tooltip}" id="it4"&gt;
                                                  &lt;f:validator binding="#{bindings.Threshold.validator}"/&gt;
                                                  &lt;af:convertNumber groupingUsed="false"
                                                                    pattern="#{bindings.Threshold.format}"/&gt;
                                              &lt;/af:inputText&gt;
                                              &lt;af:selectOneChoice value="#{bindings.Operator1.inputValue}"
                                                                  label="#{bindings.Operator1.label}"
                                                                  required="#{bindings.Operator1.hints.mandatory}"
                                                                  shortDesc="#{bindings.Operator1.hints.tooltip}"
                                                                  id="soc4"&gt;
                                                  &lt;f:selectItems value="#{bindings.Operator1.items}" id="si4"/&gt;
                                              &lt;/af:selectOneChoice&gt;
                                              &lt;af:inputText value="#{bindings.Helptext.inputValue}"
                                                            label="#{bindings.Helptext.hints.label}"
                                                            required="#{bindings.Helptext.hints.mandatory}" columns="110"
                                                            maximumLength="#{bindings.Helptext.hints.precision}"
                                                            shortDesc="#{bindings.Helptext.hints.tooltip}" id="it5"&gt;
                                                  &lt;f:validator binding="#{bindings.Helptext.validator}"/&gt;
                                              &lt;/af:inputText&gt;
                                              &lt;af:inputText value="#{bindings.PerfReason.inputValue}"
                                                            label="#{bindings.PerfReason.hints.label}"
                                                            required="#{bindings.PerfReason.hints.mandatory}"
                                                            columns="110"
                                                            maximumLength="#{bindings.PerfReason.hints.precision}"
                                                            shortDesc="#{bindings.PerfReason.hints.tooltip}" id="it6"&gt;
                                                  &lt;f:validator binding="#{bindings.PerfReason.validator}"/&gt;
                                              &lt;/af:inputText&gt;
                                              &lt;af:inputText value="#{bindings.XaxisDescription.inputValue}"
                                                            label="#{bindings.XaxisDescription.hints.label}"
                                                            required="#{bindings.XaxisDescription.hints.mandatory}"
                                                            columns="110"
                                                            maximumLength="#{bindings.XaxisDescription.hints.precision}"
                                                            shortDesc="#{bindings.XaxisDescription.hints.tooltip}"
                                                            id="it7"&gt;
                                                  &lt;f:validator binding="#{bindings.XaxisDescription.validator}"/&gt;
                                              &lt;/af:inputText&gt;
                                              &lt;af:inputText value="#{bindings.YaxisDesciption.inputValue}"
                                                            label="#{bindings.YaxisDesciption.hints.label}"
                                                            required="#{bindings.YaxisDesciption.hints.mandatory}"
                                                            columns="110"
                                                            maximumLength="#{bindings.YaxisDesciption.hints.precision}"
                                                            shortDesc="#{bindings.YaxisDesciption.hints.tooltip}"
                                                            id="it8"&gt;
                                                  &lt;f:validator binding="#{bindings.YaxisDesciption.validator}"/&gt;
                                              &lt;/af:inputText&gt;
                                              &lt;af:inputText value="#{bindings.Dschemaname.inputValue}"
                                                            label="#{bindings.Dschemaname.hints.label}"
                                                            required="#{bindings.Dschemaname.hints.mandatory}"
                                                            columns="50"
                                                            maximumLength="#{bindings.Dschemaname.hints.precision}"
                                                            shortDesc="#{bindings.Dschemaname.hints.tooltip}" id="it9"&gt;
                                                  &lt;f:validator binding="#{bindings.Dschemaname.validator}"/&gt;
                                              &lt;/af:inputText&gt;
                                              &lt;af:inputText value="#{bindings.Dtablename.inputValue}"
                                                            label="#{bindings.Dtablename.hints.label}"
                                                            required="#{bindings.Dtablename.hints.mandatory}"
                                                            maximumLength="#{bindings.Dtablename.hints.precision}"
                                                            shortDesc="#{bindings.Dtablename.hints.tooltip}" id="it10"
                                                            columns="50"&gt;
                                                  &lt;f:validator binding="#{bindings.Dtablename.validator}"/&gt;
                                              &lt;/af:inputText&gt;
                                              &lt;af:inputText value="#{bindings.Dfieldname.inputValue}"
                                                            label="#{bindings.Dfieldname.hints.label}"
                                                            required="#{bindings.Dfieldname.hints.mandatory}" columns="50"
                                                            maximumLength="#{bindings.Dfieldname.hints.precision}"
                                                            shortDesc="#{bindings.Dfieldname.hints.tooltip}" id="it11"&gt;
                                                  &lt;f:validator binding="#{bindings.Dfieldname.validator}"/&gt;
                                              &lt;/af:inputText&gt;
                                              &lt;af:inputText value="#{bindings.Toemail.inputValue}"
                                                            label="#{bindings.Toemail.hints.label}"
                                                            required="#{bindings.Toemail.hints.mandatory}" columns="50"
                                                            maximumLength="#{bindings.Toemail.hints.precision}"
                                                            shortDesc="#{bindings.Toemail.hints.tooltip}" id="it12"&gt;
                                                  &lt;f:validator binding="#{bindings.Toemail.validator}"/&gt;
                                              &lt;/af:inputText&gt;
                                              &lt;af:inputText value="#{bindings.CcEmail.inputValue}"
                                                            label="#{bindings.CcEmail.hints.label}"
                                                            required="#{bindings.CcEmail.hints.mandatory}" columns="50"
                                                            maximumLength="#{bindings.CcEmail.hints.precision}"
                                                            shortDesc="#{bindings.CcEmail.hints.tooltip}" id="it13"&gt;
                                                  &lt;f:validator binding="#{bindings.CcEmail.validator}"/&gt;
                                              &lt;/af:inputText&gt;
                                              &lt;af:selectOneChoice value="#{bindings.AutomoniterEnabled.inputValue}"
                                                                  label="#{bindings.AutomoniterEnabled.label}"
                                                                  required="#{bindings.AutomoniterEnabled.hints.mandatory}"
                                                                  shortDesc="#{bindings.AutomoniterEnabled.hints.tooltip}"
                                                                  id="soc5"&gt;
                                                  &lt;f:selectItems value="#{bindings.AutomoniterEnabled.items}" id="si5"/&gt;
                                              &lt;/af:selectOneChoice&gt;
                                              &lt;af:inputText value="#{bindings.AuditInfo.inputValue}"
                                                            label="#{bindings.AuditInfo.hints.label}"
                                                            required="#{bindings.AuditInfo.hints.mandatory}"
                                                            columns="#{bindings.AuditInfo.hints.displayWidth}"
                                                            maximumLength="#{bindings.AuditInfo.hints.precision}"
                                                            shortDesc="#{bindings.AuditInfo.hints.tooltip}" id="it14"
                                                            readOnly="true"&gt;
                                                  &lt;f:validator binding="#{bindings.AuditInfo.validator}"/&gt;
                                              &lt;/af:inputText&gt;
                                              &lt;f:facet name="footer"/&gt;
                                          &lt;/af:panelFormLayout&gt;
                                      &lt;/af:panelGroupLayout&gt;
                                  &lt;/f:facet&gt;
                              &lt;/af:panelSplitter&gt;
                          &lt;/f:facet&gt;
                          &lt;f:facet name="start"/&gt;
                          &lt;f:facet name="end"/&gt;
                          &lt;f:facet name="top"/&gt;
                      &lt;/af:panelStretchLayout&gt;
                  &lt;/f:facet&gt;
              &lt;/af:pageTemplate&gt;
          &lt;/af:form&gt;
      &lt;/af:document&gt;
  &lt;/f:view&gt;
  </code></pre>
  
  <p>The follwoing si my Java class code</p>
  
  <pre><code>public void customSearch(QueryEvent queryEvent) {
      // Add event code here...
      System.out.println("in custom srch");
      AdfFacesContext.getCurrentInstance().getPageFlowScope().put("showForm", true);
  
      invokeEL("#{bindings.KpiSearchCriteriaQuery.processQuery}", new Class[] { QueryEvent.class },
               new Object[] { queryEvent });
      System.out.println("end custom srch");
  }
  </code></pre>