oracle adf - How make form visible after clicking search button in adf Query? -
hello developing web applicaiton using oracle adf , jdeveloper11.1.2.4. have page fllowing query , form. searching , fine when page loaded first time empty. not looking good. idea form should invisible , should visible after user hits search button in search from(af:query).
please me. how can achieve this.
thanks in advance.
the following .jsf code
<?xml version='1.0' encoding='utf-8'?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"> <af:document title="search/modfiy kpi" id="d1"> <af:messages id="m1"/> <af:form id="f1"> <af:pagetemplate viewid="/adminpagetemplate.jsf" id="pt1"> <f:facet name="center"> <af:panelstretchlayout id="psl1"> <f:facet name="bottom"/> <f:facet name="center"> <af:panelsplitter id="ps1" orientation="vertical" dimensionsfrom="children" splitterposition="191"> <f:facet name="first"> <af:panelgrouplayout layout="vertical" id="pgl1"> <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"/> </af:panelgrouplayout> </f:facet> <f:facet name="second"> <af:panelgrouplayout id="pgl5" layout="vertical" halign="center"> <af:panelgrouplayout id="pgl3" layout="horizontal" halign="center"> <af:panelgrouplayout layout="horizontal" id="pgl2"> <f:facet name="separator"> <af:spacer width="10" height="1" id="s1"/> </f:facet> <af:commandbutton actionlistener="#{bindings.first.execute}" text="first" disabled="#{!bindings.first.enabled}" partialsubmit="true" id="cb1"/> <af:commandbutton actionlistener="#{bindings.previous.execute}" text="previous" disabled="#{!bindings.previous.enabled}" partialsubmit="true" id="cb2"/> <af:commandbutton actionlistener="#{bindings.next.execute}" text="next" disabled="#{!bindings.next.enabled}" partialsubmit="true" id="cb3"/> <af:commandbutton actionlistener="#{bindings.last.execute}" text="last" disabled="#{!bindings.last.enabled}" partialsubmit="true" id="cb4"/> </af:panelgrouplayout> <af:spacer width="10" height="10" id="s3"/> <af:panelgrouplayout id="pgl4" layout="horizontal"> <af:commandbutton text="delete" id="cb5" actionlistener="#{updateordeletebean.delete}"/> <af:spacer width="10" height="10" id="s2"/> <af:commandbutton text="update" id="cb6" actionlistener="#{updateordeletebean.update}"/> </af:panelgrouplayout> </af:panelgrouplayout> <af:panelformlayout id="pfl1" visible="#{pageflowscope.showform}"> <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"> <f:validator binding="#{bindings.id.validator}"/> <af:convertnumber groupingused="false" pattern="#{bindings.id.format}"/> </af:inputtext> <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"> <f:validator binding="#{bindings.kpiname.validator}"/> </af:inputtext> <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"> <f:validator binding="#{bindings.kpisql.validator}"/> </af:inputtext> <af:selectonechoice value="#{bindings.category.inputvalue}" label="#{bindings.category.label}" required="#{bindings.category.hints.mandatory}" shortdesc="#{bindings.category.hints.tooltip}" id="soc1"> <f:selectitems value="#{bindings.category.items}" id="si1"/> </af:selectonechoice> <af:selectonechoice value="#{bindings.module.inputvalue}" label="#{bindings.module.label}" required="#{bindings.module.hints.mandatory}" shortdesc="#{bindings.module.hints.tooltip}" id="soc2"> <f:selectitems value="#{bindings.module.items}" id="si2"/> </af:selectonechoice> <af:selectonechoice value="#{bindings.submodule.inputvalue}" label="#{bindings.submodule.label}" required="#{bindings.submodule.hints.mandatory}" shortdesc="#{bindings.submodule.hints.tooltip}" id="soc3"> <f:selectitems value="#{bindings.submodule.items}" id="si3"/> </af:selectonechoice> <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"> <f:validator binding="#{bindings.threshold.validator}"/> <af:convertnumber groupingused="false" pattern="#{bindings.threshold.format}"/> </af:inputtext> <af:selectonechoice value="#{bindings.operator1.inputvalue}" label="#{bindings.operator1.label}" required="#{bindings.operator1.hints.mandatory}" shortdesc="#{bindings.operator1.hints.tooltip}" id="soc4"> <f:selectitems value="#{bindings.operator1.items}" id="si4"/> </af:selectonechoice> <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"> <f:validator binding="#{bindings.helptext.validator}"/> </af:inputtext> <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"> <f:validator binding="#{bindings.perfreason.validator}"/> </af:inputtext> <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"> <f:validator binding="#{bindings.xaxisdescription.validator}"/> </af:inputtext> <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"> <f:validator binding="#{bindings.yaxisdesciption.validator}"/> </af:inputtext> <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"> <f:validator binding="#{bindings.dschemaname.validator}"/> </af:inputtext> <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"> <f:validator binding="#{bindings.dtablename.validator}"/> </af:inputtext> <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"> <f:validator binding="#{bindings.dfieldname.validator}"/> </af:inputtext> <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"> <f:validator binding="#{bindings.toemail.validator}"/> </af:inputtext> <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"> <f:validator binding="#{bindings.ccemail.validator}"/> </af:inputtext> <af:selectonechoice value="#{bindings.automoniterenabled.inputvalue}" label="#{bindings.automoniterenabled.label}" required="#{bindings.automoniterenabled.hints.mandatory}" shortdesc="#{bindings.automoniterenabled.hints.tooltip}" id="soc5"> <f:selectitems value="#{bindings.automoniterenabled.items}" id="si5"/> </af:selectonechoice> <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"> <f:validator binding="#{bindings.auditinfo.validator}"/> </af:inputtext> <f:facet name="footer"/> </af:panelformlayout> </af:panelgrouplayout> </f:facet> </af:panelsplitter> </f:facet> <f:facet name="start"/> <f:facet name="end"/> <f:facet name="top"/> </af:panelstretchlayout> </f:facet> </af:pagetemplate> </af:form> </af:document> </f:view>
the follwoing si java class 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"); }
you can flap "visible" property true on panelformlayout when user presses "search" button:
<af:panelformlayout visible="#{pageflowscope.showform}">
for need override "querylistener" method of af:query:
<af:query querylistener="#{yourbean.customsearch}"/>
in yourbean.java, have:
public void customsearch(queryevent queryevent) { adffacescontext.getcurrentinstance().getpageflowscope().put("showform", true); //call original querylistener- 1 changed in page: invokeel("#{bindings.departmentsviewcriteriaquery.processquery}", new class[] { queryevent.class }, new object[] { queryevent }); }
more details, here: http://www.awasthiashish.com/2013/12/overriding-default-query-listener-field.html
Comments
Post a Comment