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

Hi all

I have a requirement to allow users to change the "display mode" on a table of tree search results for an advanced search page. What this will do, is change the structure of how the data are arranged. In one case, the picture of the tree is 3 levels deep, otherwise, it's only 2 with different data at the level of the root node.


What I've done so far:


1) I exposed the relationship of data for these two ways to view the data in the data model of the module of the application.

(2) I created a view of criteria in two view objects that are originally relationships, where (for simplicity) I'm comparing only one field.

It is in the object from a point of view:

<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 it is in the other display 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 table and automatically generated tree by doing drag control data for ONE of the relationship of view object data that is exposed in the app module. Then, I created a second query Panel table and tree in the same way but using the data control to the other. I am one of the query cache permanently panels and toggling the visibility of the tree based on the user tables selects display mode. Both have separate links and iterators.

It is a part of the definition of the page:

<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 have created a queryListener custom to delegate the query event.

It's in my jsp to advanced search 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"/>

It's in my grain of support:

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 number inspection (the only field of research so far) is provided in the query Panel, then it behaves properly. Namely, table tree shows all the search results. However, when a record number of inspection is supplied the table from the tree that was created with the query running Board (don't forget there are two query panels, one of them hides) shows a single result (this is correct), while the other table tree (the one with the control panel hidden query that is not used) shows all the results (this is NOT correct).

What I'm trying to accomplish is still doable? If so, what Miss me?

I use JDeveloper 11.1.1.7

Thank you

Bill

I ended up keeping a single query visible panel permanently and the other hidden permanently. When you perform a search using the table that has the hidden query Panel, I have the descriptor of the request for the Panel to request hidden using the descriptor of the request of the Commission in visible motion of the seeds 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 basis advanced/Panel visible query button, I put the same mode for the control panel hidden query programmatically:

   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);
      }
   }

Tags: Java

Similar Questions

  • How can I use a vector image to stretch with the background in Muse master pages?

    How can I use a vector image to stretch with the background in Muse master pages?

    Click on the 'Fill' text not the drop-down arrow.

  • How can I use my photo albums as screensaver with Apple TV 4th gen

    How can I use a photo album that I created as a screensaver on the generation of Apple TV 4 because it is not an option in this sense?

    What follows is the Apple TV 4 user guide...

    Screensavers

    Apple TV displays a screen saver when it remains inactive for a predefined number of minutes.

    Air screensaver shows beautiful videos of slow motion of the places of the world, upload to an online server, making the screen saver more engaging and dynamic. For the antenna, you can control how many times Apple TV check and download new videos.

    Change the frequency of aerial screensaver download. In settings, go to general > screen saver and select Download New Videos, and then select an option.

    Return by using Apple TV. When the screen saver is active, press the contact surface to get to some app have been previously using.

    Choose a different screen saver. In settings, go to general > screen saver and select the Type. Then select the screen saver you want to use.

    Select the photos to display. Many of the screen saver options display a slide show of photos - it can include photos provided by Apple, or your own collection stored in iCloud. To choose which photos are used, in the settings, go to general > screen saver and select the Type. Then choose one of the types of screensaver-photographers.

    If you choose my Photos, the Photos app opens. Follow the instructions to put photos as screensaver.

    Set the screensaver time-out. In settings, go to general > screen saver and select the setting starts after, and then specify a number of minutes. This indicates to the Apple TV to start the screen saver automatically if the unit has been idle for the specified time.

    Activate the screen saver immediately. Press the Home button to go to the home screen (if it isn't already), and then press the button twice.

  • How can I use images of a single source in the text?

    I use RoboHelp HTML 11, and I want to use images from one of the icons in the text source, so that I can update the source image, if necessary, and all instances of the image are updated automatically. The look is as follows:

    inline.gif

    I tried extracts, but they force a paragraph return in the text that I don't want.

    I tried to insert the code source of an image in a variable, but when I inserted the variable in the text, I got an error message in the text.

    Is it possible to use variables to do this or another method?

    Thank you.

    According to me, inserting an image and selecting where the image is stored would be single-sourcing. Then when you update this image, it is updated throughout.

    Insert > Image

    (I use HR 10.)

  • How can I use a template in a site with different tags &lt; lang &gt;?

    My site contains pages in six different languages.  For example, the page in French is

    " < html xmlns =" http://www.w3.org/1999/xhtml "XML: lang ="fr"lang ="fr"> ".

    My model, however, reads:

    < ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""
    " < html xmlns =" http://www.w3.org/1999/xhtml ">

    ERGO, whenever I update my site because I changed the template, my foreign language pages lose their language statements.

    You can't have an editable for this.  When I tried, I got error messages.

    Anyone know a good work-around?

    At this point, I have to manually change these foreign language pages, whenever I do an update of the whole of the site.

    Thank you.

    I just tested this very quickly, but it seems to work.

    Dreamweaver templates allow you to create editable attributes. You can't do it for thetag through the interface of Dreamweaver, but it seems to work without problem if you hand-code in the template.

    In the main template, change thetag to look like this:

    
    

    Just before the closing tag, add this:

    
    

    Save the model.

    All the child pages will be updated automatically for XML: lang = "fr" lang = "fr".

    In the pages that use a different language, go to edit > properties of the model and change the value of lang to en, or whatever the language he uses.

    Another approach is to keep your pages of language in different folders, and then use search and replace in the entire file to change the values in thetag.

  • How can I do it in a single query

    version 10g

    -Did the order if i_code! = 28 records found then bring on the other
    -If i_code! = 28 records that are not for the order, then get the records with i_code = 28 and use them
    with T as (select '123' order_no ,'77676' P_no, '28' i_code from dual union all
    select '123' order_no, '77670' P_no, '28' i_code from dual union all
    select '123' order_no ,'77671' P_no, '29' i_code from dual union all
    select '123' order_no ,'77672' P_no, '30' i_code from dual union all
    select '124' order_no ,'77673' P_no, '28' i_code from dual union all
    select '124' order_no ,'77674' P_no, '28' i_code from dual union all
    select '124' order_no ,'77675' P_no, '28' i_code from dual union all
    select '124' order_no ,'77676' P_no, '28' i_code from dual )
    select * from t;
    
    
    o/p required 
    -------------------
    ORDER_NO     P_NO     I_CODE
    
    123     77671     29
    123     77672     30
    124     77673     28
    124     77674     28
    124     77675     28
    124     77676     28
    Thank you

    devarade wrote:
    It did not work

    Excerpt from the message of your code is running and the version of Oracle:

    SQL> select * from v$version
      2  /
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    
    SQL> with t as (select '123' order_no ,'77676' p_no, '28' i_code from dual union all
      2  select '123' order_no, '77670' P_no, '28' i_code from dual union all
      3  select '123' order_no ,'77671' P_no, '29' i_code from dual union all
      4  select '123' order_no ,'77672' P_no, '30' i_code from dual union all
      5  select '124' order_no ,'77673' P_no, '28' i_code from dual union all
      6  select '124' order_no ,'77674' P_no, '28' i_code from dual union all
      7  select '124' order_no ,'77675' P_no, '28' i_code from dual union all
      8  select '124' order_no ,'77676' P_no, '28' i_code from dual )
      9  select  order_no,
     10          p_no,
     11          i_code
     12    from  (
     13           select  t.*,
     14                   max(case when i_code != 28 then 1 else 0 end) over(partition by order_no) nothing_but_28
     15             from  t
     16          )
     17    where i_code != 28
     18       or nothing_but_28 = 0
     19  /
    
    ORD P_NO  I_
    --- ----- --
    123 77671 29
    123 77672 30
    124 77673 28
    124 77674 28
    124 77675 28
    124 77676 28
    
    6 rows selected.
    
    SQL> 
    

    SY.

  • How can I use my iPad as a monitor with my DSLR NIKON camera

    I have wa

    https://iTunes.Apple.com/us/app/wireless-mobile-utility/id554157010?Mt=8

    It's for the iPhone, but it should work.

  • How can I use the same graph of façade in several events in a structure of the event?

    I want to display my sensorDAQ signals in a graph.but I have more than one event in the case where the structure to acquire the signal and display it in the first round of graph.the is to acquire signals from threshold and its shown in the graphic as a feedback.after the first event is executed, I'll call the second event, where the other signals are acuired and compared with signals from threshold of event 1 my question is how can I use the same control on front panel in more than two events in the structure of the event? Please answer me I am stuck.

    Hello

    I have attached here an example of doing the same thing using local variables and shift registers. Take a peek inside. Shift register is always a better option than local variables.

    Kind regards

    Amine31

    (Bravo to give good answers, mark it as a solution if your problem is resolved)

  • How can I use lightroom or photoshop on my laptop, when I open it, it says only, I use on two computers and I have already two I have Mac at home.

    How can I use lightroom or photoshop on my laptop, when I open it, it says only, I use on two computers and I have already two I have Mac at home.

    Hi moving,

    You can use Lightroom or Photoshop on two computers using a single license.

    If you want to use on the third computer, you should disable any previous machines and turn it then back on the 3rd machine.

    You can also consider getting another license or subscription to your other computer.

    ~ UL

  • I currently use LR on my Mac, but I bought a new Mac.How can I use LR on my new Mac?

    I currently use LR on my Mac, but I bought a new Mac.How can I use LR on my new Mac?

    Hi njtaknc,

    You are allowed to install Lightroom on 2 computers using a serial number.

    However, it is recommended to use a single computer at a time.

    Please use the link below to download Lightroom.

    Download Photoshop Lightroom

    Please mention which version of Lightroom do you use?

    I hope this helps.

    ~ UL

  • Why are menus grayed out in trial version? How can I use the effects then?

    Why are menus grayed out in trial version? How can I use the effects then?

    Every piece of software has a learning curve and its own terminology.  After Effects is a tool professional complex, used by lovers of the House to feature filmmakers.

    There are a lot of video friendly user very editing software that will do the tasks you mentioned easily.  I would suggest Adobe Premiere Elements.

    For the record, you cannot apply an effect what in After Effects until you have selected a target layer in the timeline panel.  This feature is true for any video editing or compositing software I can think,

  • How can I use Windows on the Mac desktop?

    How can I use Windows on MAC desktop products?  OS X El Capitan

    You can install it in BootCamp or virtual VMWare, Parallels or VirtualBox machine

  • How can I make double click to single click to open files?

    How can I make double click to single click to open files?

    See:

  • How can I use my watch to snap the shutter on my iPhone?

    How can I use my watch to snap the shutter on my iPhone?

    Click here > https://help.apple.com/watch/

    Then click on: Remote Camera on the left.

    You'll see instructions.

  • How can I use firefox to open the public sybercafe.

    How can I use firefox in open public sybercafe.and what precautions should be taken.

    Hi, you can use the Firefox private - browsing Mode navigate the web without saving the information on the sites you visit

    The incognito on Firefox for Android

Maybe you are looking for

  • Limit memory for Safari?

    Is there a way to limit the use of the memory of Safari? This morning I found my system is not responding because a process of Safari had used all available memory and disk space (for the swap). The screen is locked, mouse movements began to record a

  • HP xw6400 Workstation doesn't Boot Up

    My husband has a HP XW6400 workstation won't boot to the top.  Two beeps four times during a red light on the front flashes four times, or it will be as it tries to start, stop, and then resume, then stop.  Once he has me completely in the Windows 7

  • disable the code

    my Compaq laptop - I walk my deactivation code forgotten password is 59095916 please help me

  • HP Officejet 6500 e709n: default alignment and black ink does not print

    Adapting the failure message. Black ink does not print. I chose clean print head - more than once.

  • Priority of the global screen

    Hi, when I'm working in applications, I face a problem that I can't solve. Where can I find comprehensive screen priority. This is because I want my screen is display (when the application is light) on top of any customer get any message or call for