How can I use a single query panel with two view criteria?

Hi all,
I have a requirement to allow users to change the "display mode" on a search results tree table for an advanced search page. What this will do is change the structure of how the data is laid out. In one case the tree table is 3 levels deep, in the other case it's only 2 with different data being at the root node.
What I've done so far:
1) I exposed the data relationship for these two ways of viewing the data in the application module's data model.
2)  I created a view criteria in the two view objects that are at the root of the relationships, where (for simplicity sake) I'm only comparing a single field.
This is in one view object:
<ViewCriteria
    Name="PartsVOCriteria"
    ViewObjectName="gov.nasa.jpl.ocio.qars.model.views.PartsVO"
    Conjunction="AND">
    <Properties>... </Properties>
    <ViewCriteriaRow
      Name="vcrow23"
      UpperColumns="1">
      <ViewCriteriaItem
        Name="PartDiscrepantItemsWithIRVO"
        ViewAttribute="PartDiscrepantItemsWithIRVO"
        Operator="EXISTS"
        Conjunction="AND"
        IsNestedCriteria="true"
        Required="Optional">
        <ViewCriteria
          Name="PartDiscrepantItemsWithIRVONestedCriteria"
          ViewObjectName="gov.nasa.jpl.ocio.qars.model.views.PartDiscrepantItemsWithIRVO"
          Conjunction="AND">
          <ViewCriteriaRow
            Name="vcrow26"
            UpperColumns="1">
            <ViewCriteriaItem
              Name="InspectionRecordNumber"
              ViewAttribute="InspectionRecordNumber"
              Operator="="
              Conjunction="AND"
              Value=""
              Required="Optional"/>
          </ViewCriteriaRow>
        </ViewCriteria>
      </ViewCriteriaItem>
    </ViewCriteriaRow>
  </ViewCriteria>
and this is in the other view object:
<ViewCriteria
      Name="IRSearchCriteria"
      ViewObjectName="gov.nasa.jpl.ocio.qars.model.views.InspectionRecordVO"
      Conjunction="AND">
      <Properties>... </Properties>
      <ViewCriteriaRow
         Name="vcrow7"
         UpperColumns="1">
         <ViewCriteriaItem
            Name="InspectionRecordNumber"
            ViewAttribute="InspectionRecordNumber"
            Operator="="
            Conjunction="AND"
            Required="Optional"/>
      </ViewCriteriaRow>
   </ViewCriteria>
3) I had a query panel and tree table auto-generated by dragging the data control for ONE of the view object data relationship that's exposed in the app module. Then I created a second query panel and tree table the same way but using the data control for the other. I'm hiding one of the query panels permanently and toggling the visibility of the tree tables based on the display mode the user chooses. Both tables have separate bindings and iterators.
This is a portion of the page definition:
<executables>
    <variableIterator id="variables"/>
    <searchRegion Criteria="IRSearchCriteria"
                  Customizer="oracle.jbo.uicli.binding.JUSearchBindingCustomizer"
                  Binds="InspectionRecordVOIterator"
                  id="IRSearchCriteriaQuery"/>
    <iterator Binds="InspectionRecordVO" RangeSize="25"
              DataControl="QARS_AppModuleDataControl"
              id="InspectionRecordVOIterator" ChangeEventPolicy="ppr"/>
    <iterator Binds="Root.QARS_AppModule.PartsVO1"
              DataControl="QarsMasterAppModuleDataControl" RangeSize="25"
              id="PartsVO1Iterator"/>
    <searchRegion Criteria="PartsVOCriteria"
                  Customizer="oracle.jbo.uicli.binding.JUSearchBindingCustomizer"
                  Binds="PartsVO1Iterator" id="PartsVOCriteriaQuery"/>
  </executables>
4) I've created a custom queryListener to delegate the query event.
This is in my advanced search jsp page:
<af:query id="qryId1" headerText="Search" disclosed="true"
                  value="#{bindings.IRSearchCriteriaQuery.queryDescriptor}"
                  model="#{bindings.IRSearchCriteriaQuery.queryModel}"
                  queryListener="#{pageFlowScope.SearchBean.doSearch}"
                  queryOperationListener="#{bindings.IRSearchCriteriaQuery.processQueryOperation}"
                  resultComponentId="::resId2" maxColumns="1"
                  displayMode="compact" type="stretch"/>
This is in my backing bean:
public void doSearch(QueryEvent queryEvent) {
      String bindingName = flag
         ? "#{bindings.IRSearchCriteriaQuery.processQuery}"
         : "#{bindings.PartsVOCriteriaQuery.processQuery}";
      invokeMethodExpression(bindingName, queryEvent);
   private void invokeMethodExpression(String expr, QueryEvent queryEvent) {
      FacesContext fctx = FacesContext.getCurrentInstance();
      ELContext elContext = fctx.getELContext();
      ExpressionFactory eFactory = fctx.getApplication().getExpressionFactory();
      MethodExpression mexpr =
         eFactory.createMethodExpression(elContext, expr, Object.class, new Class[] { QueryEvent.class });
      mexpr.invoke(elContext, new Object[] { queryEvent });
When no inspection record number (the only search field so far)  is supplied in the query panel, then it behaves correctly. Namely, the tree tables shows all search results. However, when an inspection record number is supplied the tree table that was created with the query panel in use (remember there are two query panels, one of them is hidden) shows a single result (this is correct) while the other tree table (the one with the hidden query panel that isn't in use) shows all results (this is NOT correct).
Is what I'm trying to accomplish even doable? If so, what am I missing?
I'm using JDeveloper 11.1.1.7
Thanks,
Bill

I ended up keeping one query panel permanently visible and the other permanently hidden. When performing a search using the table that has the hidden query panel, I seed the query descriptor for the hidden query panel using the visible query panel's query descriptor and then delegate the request:
   public void doSearch(QueryEvent queryEvent) {
      String bindingName = null;
      if(isIrTableRendered()) {
         bindingName = "#{bindings.IRSearchCriteriaQuery.processQuery}";
      } else {
         seedPartsQueryDescriptor();
         bindingName = "#{bindings.PartsVOCriteriaQuery.processQuery}";
         queryEvent = new QueryEvent(partsQuery, partsQuery.getValue());
      invokeMethodExpression(bindingName, queryEvent);
   private void seedPartsQueryDescriptor() {
      ConjunctionCriterion criterion = irQuery.getValue().getConjunctionCriterion(); 
      for(Criterion criteria : criterion.getCriterionList()) {
         AttributeCriterion attributeCriteria = (AttributeCriterion)criteria;
         List values = attributeCriteria.getValues();
         String qualifiedName = attributeCriteria.getAttribute().getName();
         int indexOfDot = qualifiedName.lastIndexOf(".");
         String name = indexOfDot < 0
            ? qualifiedName
            : qualifiedName.substring(indexOfDot + 1);
         ConjunctionCriterion partsCriterion =
            partsQuery.getValue().getConjunctionCriterion();
         for (Criterion partsCriteria : partsCriterion.getCriterionList()) {
            AttributeCriterion partsAttributeCriteria =
               (AttributeCriterion) partsCriteria;
            String partsQualifiedName =
               partsAttributeCriteria.getAttribute().getName();
            if (partsQualifiedName.endsWith(name)) {
               partsAttributeCriteria.setOperator(attributeCriteria.getOperator());
               List partsValues = partsAttributeCriteria.getValues();
               partsValues.clear();
               for (int i = 0, count = values.size(); i < count; i++) {
                  partsValues.set(i, values.get(i));
   private void invokeMethodExpression(String expr, QueryEvent queryEvent) {
      FacesContext facesContext = FacesContext.getCurrentInstance();
      ELContext elContext = facesContext.getELContext();
      ExpressionFactory expressionFactory =
         facesContext.getApplication().getExpressionFactory();
      MethodExpression methodExpression =
         expressionFactory.createMethodExpression(elContext, expr, Object.class, new Class[] { QueryEvent.class });
      methodExpression.invoke(elContext, new Object[] { queryEvent });
Then when the advanced/basic button is pressed for the visible query panel, I programmatically set the same mode for the hidden query panel:
   public void handleQueryModeChange(QueryOperationEvent queryOperationEvent) {
      if(queryOperationEvent.getOperation() == QueryOperationEvent.Operation.MODE_CHANGE) {
         QueryMode queryMode = (QueryMode) irQuery.getValue().getUIHints().get(QueryDescriptor.UIHINT_MODE);
         QueryDescriptor queryDescriptor = partsQuery.getValue();
         queryDescriptor.changeMode(queryMode);
         AdfFacesContext.getCurrentInstance().addPartialTarget(partsQuery);

Similar Messages

  • How can I use the NI PXI-6508 with Lab View 7? what are the first steps to get started??How can I use the channels with lab view 7????

    I have a 8 slot PXI system with 2 NI PXI 6508 and 1 DMM 4070 in it. I want to get started with programming the digital I/O cards (6508)! How can I use this cards with LabView 7?what is the best way to get started, or where can I get examples showing how to use the several channels?
    Thanks!
    Philipp

    Philipp,
    The best way to get started is to decide if you want to use traditional NI-DAQ or NI-DAQmx. Recently we released NI-DAQ 7.1 which provides NI-DAQmx support for the PXI-6508. In my opinion, NI-DAQmx is more efficient and much easier to use.
    To get started with examples, simply launch LabVIEW and go to Help>>Find Examples. Then expand Hardware Input and Output>>DAQmx and select the appropriate digital group for your application. This should help get you started.
    Please repost if you need addition assistance. Good luck with your application!

  • HT1660 how can I use one single library for all users on the same laptop?

    how can I use one single library for all users on the same laptop?

    You are most of the way there. Each user having access to hard drive is the key. If users are limited in file privileges this is harder.
    Any files you add to your library and any files she adds to her library are available to the other. Just not automatically. Each user must add the files to their own library using the add file or add folder option from menu bar.
    What I have done is set library location to a location outside of My Documents\My Music. On my network storage I have a folder names s:\itunes. Both accounts iTunes are set to use this location for the library.

  • How can i use the same front panel graph in more than one events in an event structure?

    i want to display the signals from my sensorDAQ in a graph.but i have more than one event in the event structure to acquire the signal and display it in the graph.the first event is to acquire the threshold signals and its displayed in the graph as a feedback.after the first event is executed, i will call the second event,where the further signals are acuired and compared with the threshold signals from the event 1.my question is how can i use the same front panel control in more than two events in the event structure?please answer me i'm stuck.
    Solved!
    Go to Solution.

    Hi,
    I have attached here an example of doing the same using shift registers and local variables. Take a look. Shift register is always a better option than local variables.
    Regards,
    Nitzz
    (Give kudos to good answers, Mark it as a solution if your problem is Solved) 
    Attachments:
    Graph and shift registers.vi ‏12 KB
    graph and local variables.vi ‏12 KB

  • How can I use TopLink for querys that have two and more tables?

    I use TopLink today, and I can use one table to query, but how can I use TopLink for querys that have two and more tables?
    Thank you for see and answer this question.

    You can write a custom SQL query and map it to an object as needed. You can also use the Toplink query language "anyOf" or "get" commands to map two tables as long as you map them as one to one (get command) or one to many (anyOf command) in the toplink mapping workbench.
    Zev.
    check out oracle.toplink.expressions.Expression in the 10.1.3 API

  • How can I use the old Apple TV with new iTunes?  It tells me to input a code in iTunes but iTunes no longer has a spot to input this code to allow sync.  I can access the iTunes Store fine, just none of my Library

    How can I use the old Apple TV with new iTunes?  It tells me to input a code in iTunes but iTunes no longer has a spot to input this code to allow sync.  I can access the iTunes Store fine, just none of my Library

    read this
    https://discussions.apple.com/message/20429789#20429789

  • How can you use iMessage between 3 iPads with 3 different users but only one Apple ID?

    how can you use iMessage between 3 iPads with 3 different users but only one Apple ID?

    No you do not need separate Apple ID's in order to use 3 devices with one Apple ID. I use 4 devices to Message and FaceTime and all use the same Apple ID. You do need to add additional email addresses for the other devices.
    Look at this very informative video for the instructions.
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l

  • How can I get a single jar file with NetBeans?

    How can I get a single jar file with NetBeans?
    When I create the project I get these files:
    dist/lib/libreria1.jar
    dist/lib/libreria2.jar
    dist/software.jar
    The libraries that have been imported to create the project are in separate folders:
    libreria1/libreria1.jar
    libreria2/libreria2.jar
    libreria1, libreria2, dist folders are all located inside the project folder.
    I added the following code to the build.xml:
    <target name="-post-jar">
    <jar jarfile="dist/software.jar">
    <zipfileset src="${dist.jar}" excludes="META-INF/*" />
    <zipfileset src="dist/lib/libreria1.jar" excludes="META-INF/*" />
    <zipfileset src="dist/lib/libreria2.jar" excludes="META-INF/*" />
    <manifest>
    <attribute name="Main-Class" value="pacco.classeprincipale"/>
    </manifest>
    </jar>
    </target>
    Of course there is also the project folder:
    src/pacco/classeprincipale.form
    src/pacco/classeprincipale.java
    Can you tell me what is wrong? The error message I get is as follows:
    C:...\build.xml:75: Problem creating jar: archive is not a ZIP archive BUILD FAILED (total time: 2 seconds)

    This is not a NetBeans forum, it is a JDeveloper forum. You might want to try http://forums.netbeans.org/. I also saw your other question - try looking in the New to Java forum: New To Java

  • How can I use a Verizon iPhone 5 with US Cellular?

    How can I use a Verizon iPhone 5 with US Cellular?

    You can't. Doing so is not supported.

  • I purchased a iphone i USA. How can i use this iphone in india with vodafone.

    I Purchased a iPhone 5s in USA. How can I use this phone in India with Vodafone.
    <Edited By Host>

    First, the iPhone would need to be unlocked. That would depend on where you bought it. Next, the North American phone would not work with all of the networks outside of the US. Also, the warranty for the device is only good in the US, so if you have a problem with the phone, you would need to bring it back to the US to an Apple Store. Where did you purchase the phone?

  • HT1515 How can I use Airport Express (1st generation) with OS X Mavricks?

    How can I use Airport Express (1st Generation) with OS X Mavericks?

    1st Generation AirPort Express will work fine with Mavericks.
    Are you sure that you have a 1st Gen Express?
    Check the model number on the side of the Express. 1st Gen is A1264.
    If you see A1084 or A1088, these are much older versions of the Express that were sold long before Apple began to use the Generation naming with "n" wireless devices in 2007.
    Mavericks will not support the A1084 or A1088. Use another Mac running Leopard, Snow Leopard, or a PC if you need to administer the older Express.

  • How can I use my photoshop elements 10 with windows 8 upgrade

    How can I use my photoshop elements 10 with my windows 8 uograde

    All versions of PSE except versions 1, 3, 5 & 6 will work with Windows 8.
    Microsoft Windows 8 compatibility.

  • Can i use a single ended encoder with a 7344 controller?

    Can i use a single ended encoder with a 7344 controller?

    The encoder inputs of the 7344 are ground referenced. So the answer is yes, you can use a single ended encoder with a 7344 controller. Signal connection should be straight forward.
    If you are using a UMI-7764 for signal connections please refer to the "Encoder Terminal Block" section (page 15) of the UMI User Guide. There are drawings for the signal connections for single ended and differential encoders.
    For the case that you don't have the user guide of the UMI-7764 please download it from this link:
    http://digital.ni.com/manuals.nsf/websearch/AC6FAA69218C9624862567BD0061DDAC?OpenDocument&node=132100_US
    Best regards,
    Jochen Klier
    Applications Engineering Group Leader
    National Instruments Germany GmbH

  • Can i use my ipod 4th generation with two computers?

    can i use my ipod 4th generation with two computers?

    iTunes- How to move the library to an EHD
    Recovering your iTunes library from your iPod or iOS device
    iTunes- Back up your iTunes library by copying to an external hard drive

  • How can I use my old imac24" 2008, with my. New iMac 21,5" as a monitor? What camble do I need ? new iMac

    How can I use my old mac 24" as a second monitor? What cable do I need?

    https://discussions.apple.com/docs/DOC-6351 may offer some techniques.

Maybe you are looking for

  • Font subsetting issue with srw.run_report

    I have PDF subsetting as "Courier" = "MSGOTHIC.TTC" I have a report emp.rdf. This emp report just displays the data from emp table. I have a report dept.rdf. This dept report just displays the data from dept table. In the after report trigger of the

  • Error while releasing the TR

    hi All, We are facing an issue while releasing the Transport Request. The error is "No valid TM target found". Request your valuable inputs on this. thanks in advance With Regards, Lata

  • Reader 9.2 does not choose the right postscript level

    Hi, I use an old HP4500 Color Laser Jet (it still prints very well and I have a lot of toner :-)). every time I want to print a pdf on it, it does not work, for the adobe reader sets the postscript level to 3 although the printer has only 2. I've fou

  • Cropping and preserving quality after

    I need to crop some pixels out of a 1920x1080 video. 1. How do you crop in CS6? 2. Will the cropped video rescale/stretech to fit a 1920x1080 frame, technically resulting in some quality loss? Thanks.

  • DVD player software problem

    Hi I have an imac G5 and I am having problems with my DVD player software - previously it had been working OK. When I try and play a DVD it starts slowly with no sound and then stops after about 10 seconds. I have tried trashing the DVD player prefer