Query-by-Example Filter

Current release jdeveloper adf
How can I clear the search criteria from the fillters, declaratively?
chuck

The ability to clear all fillter criteria at one time, ex: a command button. Instead of clearing each column filter, one at time.
chuck

Similar Messages

  • Clearing VO dynamic Query-By-Example ViewCriteria

    Looking for some help with JDev 11.1.1.4.0, ADF BC + ADF Faces RC please.
    At it's simplest we're looking how to clear the query-by-example (QBE) filters on a VO without using the table UI component and not accidentally clearing other view criteria on the VO. To explain our use case first let me define the characteristics of our app. We have:
    a) A BTF based on fragments:
    a.1) The transaction/data control scope = Use Existing Transaction if Possible/Shared
    a.2) It contains a single fragment
    a.3) The fragment contains a table based on an ADF BC View Object (VO)
    a.4) The VO has a view criteria defined at design time, implemented via the Application Module (AM)
    a.5) The table allows the user to filter the data
    a.6) The BTF does not include any task flow returns or parent actions
    b) A consuming BTF based on pages:
    b.1) The transaction/data control scope = Always Begin New Transaction/Isolated
    b.2) It contains 2 pages with navigation rules to move between them (back/forward)
    b.3) The fragment from "a" is included on both pages in "b"
    b.4) When navigation occurs between the pages, it is invoked via buttons in this BTF, not the original BTF via parent actions or task flow returns. This aligns with point a.6. As such when navigations occurs between the 2 pages, the region/task flow binding instance of "a" in the region of the current page of "b" is prematurely terminated. The implication is the instance of "a" doesn't get a chance to do any processing before it is closed.
    Note that "a" and "b" are built in isolation of each other. "b" has no inherit knowledge about the components of "a" nor the ADF BC components. The implication is "b" cannot attempt to grab the table UI component, nor manipulate the ADF BC components as it doesn't know anything about the BTFs dropped on its pages.
    If the user opens the 1st page in "b" and enters a query-by-example criteria on the table from the region containing the 1st of instance of "a", then the user navigates to the 2nd page, the filter criteria are still set on the 2nd instance of "a". This is expected behaviour as "a" has data control scope = shared implying when the QBE criteria are set on page 1, they are written down to the VO, which when the user navigates to page 2, as it is sharing the same VO the QBE criteria are there to reuse/share on page 2.
    In our scenario what we want to do:
    1) Is in navigating between the 2 pages, we wish the query-by-example filter criteria to be cleared/reset, such that navigating between pages the filter criteria are empty/fresh
    2) However in navigating between the pages we must not lose the design time view criteria (and it's bind variable value) that has already been applied
    3) Maintain shared data control scope so we minimize the amount of database connections
    The common solution to clearing the QBE filter is as per Timo Hahn's following blog entry: http://tompeez.wordpress.com/2011/10/29/jdev-how-to-reset-a-filter-on-an-aftable/
    Yet that solution assumes the code has access to the table UI component. As we need the QBE criteria reset on navigation caused by "b", and such navigation causes a premature termination of "a" there's no chance for "a" to grab the table component and clear the filter criteria before "b" navigates away. The logical solution to this is on entering "a" again, to programatically reset the QBE criteria as part of the initial steps in the "a" BTF. But on entering "a" using Timo's solution, the method call doesn't have access to table UI component as the fragment isn't yet rendered, making this solution not viable.
    Another solution we've tried is calling applyViewCriteria(null) then reapplying our view criteria from a VO client interface method, but it appears we aren't clearing the QBE criteria. This worries me a bit because it looks like you can't discern the QBE view criteria from the normal view criteria unless you go through the table UI component methods.
    So how do we clear the QBE filter criteria programatically, without clearing (or at least restoring) the design time view criteria, and without relying on the table UI component to clear the QBE criteria?
    Phew, I hope that makes sense? Thanks for your help in advance.
    CM.
    PS. There is an assumption in the title of my post that table Query By Example criteria are stored as ADF BC View Object view criteria. Possibly it's a separate mechanism so please be careful this doesn't lead you astray in answering my post.

    Chris,
    I don't have time to follow this through right now, but I'm on to something.
    I was able to affect the filter via the binding container (at least it's not the UI). See this code:
      public void a(ActionEvent e)
       String s = "#{bindings.EmployeesView1Query.queryDescriptor}";
       Object o = JSFUtils.resolveExpression(s);
       FilterableQueryDescriptor f = (FilterableQueryDescriptor) o;
       f.removeCriterion(f.getCurrentCriterion());
      }Now, it doesn't do exactly what you want (it actually somehow makes no rows show up in the table), but I believe it's moving in the right direction.
    Am leaving for the office (5:40 am), so I'll pass this over to you to have a gander.
    John

  • Query by Example

    Hi All,
    Query by example will provide the search criteria.
    Like it is a buttion in navigation bar.If I click on that all the data in the screen will be cleared if I have a JTable binded to a viewObject.
    IF I enter 'not null' for an attribute and click on execute..
    It will display all the records which matches the criteria.
    My Question is Can I get the 'not null'...which I used for one of the attribute filter.
    Like I want to retrive the runtime attribute value?
    Please help me.
    Any help will be appreciated.
    Thanks
    Sowmya

    you'll find Query By Example screens inside our SQLWorkshop, and those do look much like the Portal ones. if you'd like to build your own QBE forms into your web app, i'd suggest the following:
    -use our Report wizard to generate a report based on a sql query that selects all the columns of your table.
    -add text field Items to the page for each column for which you'd like to do provide QBE ability.
    -add Where clauses to the sql in your report region that refer to the items you added in the previous step
    -add a button that branches back to the same page
    that should pretty much do it. you'd probably want to smooth things with a reset button to clear the cache for the items, but that depends on how you want your QBE page to function.
    hope this helps,
    raj

  • Expert Mode ViewObject: default 'query by example' mechanism does not work

    In JDeveloper 11G 1.1.1
    I have created an Expert Mode view object(VO) which I'm trying to filter in an ADF Swing Panel
    The Panel contains a Swing Table created by dropping a VO data control on the panel as an ADF bound Swing Table.
    TEST
    Run the panel.
    Set the Query Mode on (from the Database menu)
    Enter a relevant view criterion
    Execute the Query
    TEST FAILS
    Table is refreshed but it still displays the entire VO collection (non-filtered).
    Repeating the same experiment with a default, entity object generated VO works as expected.
    Question
    Can the default 'query-by-example' mechanism as provided by the JUTestFrame and the JUNavigationBar be used with Expert Mode view Objects?
    If yes are there any tricks to making this work?

    Hello Frank;
    Additional TEST RESULTS
    In JDev11G
    The default 'query by example mechanism' does not work if you create a new View Object using the <Select data source...> option <Read-only access through SQL query>.
    However, IT DOES WORK if you create a new ViewObject selecting <Updatable access through entity objects> and in the Query step you select <Expert Mode>
    Could you please check and confirm.
    Thanks!
    Ioannis
    Edited by: imouts on Dec 5, 2008 1:38 PM

  • Query By Example search in Uppercase (value only)

    Hi,
    I am using Jdev 11.1.1.6.
    I need to allow users to use QBE on table (wrapped by PanelCollection) using case-insensitive search.
    My application stores everything in uppercase, so there is no need to put UPPER on database column. So I am looking for solution to only uppercase value entered by user.
    I found one old post by Steve Muench here[http://radio-weblogs.com/0118231/2004/04/16.html#a276]
    private void adjustStringViewCriteriaToUppercaseWildcards() {
        ViewCriteria vc = getViewCriteria();
        if (vc != null) {
          ViewCriteriaRow vcr = (ViewCriteriaRow)vc.first();
          AttributeDef[] attrs = vc.getViewObject().getAttributeDefs();
          int attrCount = attrs.length;
          while (vcr != null) {
            for (int z = 0; z < attrCount; z++) {
              if (attrs[z].getSQLType() == Types.VARCHAR ) {
                String criteria = (String)vcr.getAttribute(z);
                if (criteria != null) {
                  vcr.setAttribute(z,criteria.toUpperCase()+"%");
            vcr = (ViewCriteriaRow)vc.next();
      }Steve suggested to put this method in custom ViewObjectImpl and called from getViewCriteriaClause(), something like this:
    public String getViewCriteriaClause() {
        adjustEnameViewCriteriaToUppercaseWildcards();
        return super.getViewCriteriaClause();
      }I noticed that getViewCriteriaClause() has been deprecated in 11gR1, so I instead implemented it in getViewCriteriaClause(boolean b).
    The problem is that first statement ViewCriteria vc = getViewCriteria(); returns null. My view object does not have any View Criteria. I was expecting the temp VC that is attached by framework during QBE.
    I modified the code to this:
            ViewCriteria[] vcs = getApplyViewCriterias(ViewCriteria.CRITERIA_MODE_QUERY | ViewCriteria.CRITERIA_MODE_CACHE);
            if (vcs != null && vcs.length > 0) {
                for (ViewCriteria vc : vcs) {
                    if (vc != null) {
                        ViewCriteriaRow vcr = (ViewCriteriaRow)vc.first();
                        AttributeDef[] attrs =
                            vc.getViewObject().getAttributeDefs();
                        int attrCount = attrs.length;
                        while (vcr != null) {
                            for (int z = 0; z < attrCount; z++) {
                                if (attrs[z].getSQLType() == Types.VARCHAR) {
                                    String criteria = (String)vcr.getAttribute(z);
                                    if (criteria != null) {
                                        vcr.setAttribute(z,
                                                         criteria.toUpperCase());
                            vcr = (ViewCriteriaRow)vc.next();
            }Now I see that, it is getting the VC and executing vcr.setAttribute(z,criteria.toUpperCase()); on the value that I entered during search but still matched rows are not retrieved.
    When I explicitly put the value in Uppercase on UI then it returns the correct rows.
    What am I doing wrong here? What else do I need to handle here? Is there another way to achieve my usecase?
    Note: If I do vc.setUpperColumns(true) then it returns all rows matching search criteria but the statement is executed with UPPER on both sides of where clause, which is desired behavior but something I don't want as it will not use any index on that column.
    Thanks,
    Jai

    Thanks for the info Timo.
    I did not mention it explicitly but I need this for entire application. I don't need this for my declared bind variables, which are already taking care, but for QBE provided by PanelCollection component where framework attaches temp bind variables. So I don't know the bind variable name to set their values.
    Do you know how to achieve using the method you mentioned in your post?
    Update on Steve's method:
    When I tried to test it using BC Tester (as the post suggests for testing), it worked. Here is what the post says:
    To test out your work, you can use the Business Components Tester tool that's built-into JDeveloper (right-mouse Test... on your application module in the navigator).
    When viewing your view object, their is a "Specify View Criteria" toolbar button that allows you to enter one or more rows of View Criteria query-by-example criteria.It does not work when I invoke QBE from UI using PanelCollection filter component. At that time, first statement [i.e. ViewCriteria vc = getViewCriteria();], in the helper method returns NULL.
    I thought the solution is meant for BC Tester as well as UI but since the post is very old [2004], I am not sure if something has changed on the framework side, which is breaking the logic for UI.
    Question: What is causing this not to work from UI? How can I tweak this method to make it work from UI?
    Any help is appreciated here.
    Thanks,
    Jai

  • Query By Example getting recorded, How to clear it ?

    Hi
    Say i have a page A, It has a table , I did a Query By example here.
    Then i navigate to another page, say B (from A ) and then if i come back to page A (not through Back Button ) , I still see the results modified by the Query By Example i did in last step.
    How to clear the previous query by example ? ?
    Thanks in advance
    Sajith

    Clearing Filter criteria in ADF Rich Table
    In ADF table, filter criteria is stored in filter model. So to clear filter, first get filter model then filter criteria and clear it. Many times you may need to queue event so that filter listener method is called.   At end you may need to refresh table to reflect this on UI.
    FilterableQueryDescriptor queryDescriptor = (FilterableQueryDescriptor)getTable().getFilterModel();
    if (queryDescriptor != null &amp;&amp; queryDescriptor.getFilterCriteria() != null){
    queryDescriptor.getFilterCriteria().clear();
    getTable().queueEvent(new QueryEvent(getTable(),queryDescriptor));
    http://adfscopes.blogspot.com/2011/03/programatically-clearing-filter.html

  • What's the exact difference between "Query Def. Filter Value Selection" and

    Hi Gurus,
    what's the exact difference between "Query Def. Filter Value Selection" and "Query Execution Filter Val. Selectn" in info-object's "Business explorer" tab?
    I found out that if my info-object A has a input-ready variable in a query,after the query running,in  the selection screen,my info-object A's F4 value is follow the setting of "Query Execution Filter Val. Selectn",as the setting of "Query Def. Filter Value Selection" I tried every diff setting, it won't effect my query anyway.
    so:
    1.what's the exact difference between "Query Def. Filter Value Selection" and "Query Execution Filter Val. Selectn" in info-object's "Business explorer" tab?
    2.how they effect query's presentation?
    I searched forum,didn't find the answer what I want.
    Thanks everyone.

    Hi Denny,
    I will try to explain it again.
    Query Def. Filter Value Selection : Let say the value is set to "Only Values in Infoprovider"
    Lets take an example infoobject - 0MATERIAL (Material)
    Total material records in material Master = 1000 (master Data table /BI0/PMATERIAL)
    You create a query on top of an Infoprovider using Material.
    Total unique materials in Infoprovider= 500.
    Now when you are in design mode in Query Designer, and you try to restrict Material by few materials (for e.g. 1, 2, and 3), for this you right click on material and select Restrict, the pop-up opens with list of materials, this list is all those 500 materials which are in the infoprovider, because the setting is  "Only Values in Infoprovider". Which means then when you are trying to restrict a characterstic in query definition the list of values displayed for restricition is derived from Infoprovider.
    Query Execution Filter Value Selection  - I think you already know what it is , its the read mode for F4 help selection.
    I hope this helps.
    Thanks
    CK

  • QSUF (Query string url filter) and SQL Server reporting services report viewer parameters

    Hi,
    this is my issue:
    I have a SQL Server reporting services web part on a page with a report with 1 parameter, lets say it's a client list
    Then i have a QSUF that will be used to filter the clients list through the URL
    However, once i connect the filter and the report viewer web part, the parameter goes away and is no longer accessible
    I'd like to somehow keep the parameter visible, in case there is no parameter sent through the URL, i would like the user to be able to choose a client from the parameter drop down list
    I saw that there is a "send empty if no values are passed" option, but i can't seem to get this working properly and i don't know if this option will make the parameter visible again
    Any help would be appreciated
    Thanks.

    Hi,
    According to your post, my understanding is that the query string url filter web part not worked well with SQL server reproting services web part.
    Did you use the Wiki page layout in your environment?
    You can change the page to a web part page, then check whether it work.
    There is a similar thread for your reference.
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/4d7584e3-8e1a-48bf-9346-32f8cb480dd1/query-string-url-filter-web-part?forum=sharepointgeneralprevious
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Query by example - how can I display VCRow in JTable?

    I would like to provide the user with a searchable table.
    Actually I would like to use two tables: one, displaying one row where the user can specify the search criteria. And the second table should display the data found.
    I could store the entered criteria locally in a hashmap in TableModel, for example, then create a WHERE clause. This solution is quite messy, since the user can add, remove and rearrange the columns of both tables.
    Or I could use -I hope- the query-by-example feature, like this:
    am = app.getApplicationModule();
    ViewObject vo = am.createViewObject( "MyVO", "mypackage1.PatView" );
    ViewCriteria vc = vo.createViewCriteria();
    ViewCriteriaRow vcr = vc.createViewCriteriaRow();
    Now I can set attributes and use vo.applyViewCriteria() to find my data.
    But how can I bring the first JTable to display this single ViewCriteriaRow, so that the user can do the editing?
    The JUNavigationBar does it, if I am not mistaken. It switches the PanelBinding to find mode, and then a JTable displays a ViewCriteriaRow (?) instead of the ViewObject's data. But I don't want to use the bar. How do I create this behaviour manually?
    The javadoc of JUPanelBinding says:
    "Sets this panel and all its associated iterators into find mode."
    So I guess that setting iterators into find mode is what I need. But I cannot figure out how to do that. Who can?

    You cannot set the iterators in a panelBinding to separate find/data modes individually.
    However you can create two JUPanelBinding objects one for the findMode form and one that displays Data.
    here's what I did to modify a generated SingleForm, to display two panels of the same type one in find mode and other in data mode.
    I changed the jbInit method of the "LayoutPanel" class to be like:
    //declare this as a member of the class.
    JButton findBtn;
    public void jbInit() throws Exception
    // Panel layout
    masterViewPanel = new PanelDeptView(panelBinding);
    //create another instance of PanelBinding for a second (findform) DeptView panel.
    JUPanelBinding binding = new JUPanelBinding("Project3.Mypackage1Module", this);
    binding.setApplication(panelBinding.getApplication());
    masterViewPanel1 = new PanelDeptView(binding); //create second instance
    findBtn = masterViewPanel1.navBar.getButton(JUNavigationBar.BUTTON_FIND);
    findBtn.doClick(); //set the second instance in find mode.
    //add a listener on the second instance's execute button so that it resets the form into find mode
    //this forces the second instance to be in find mode when execute button is pressed.
    masterViewPanel1.navBar.getButton(JUNavigationBar.BUTTON_EXECUTE).addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ev)
    SwingUtilities.invokeLater(new Runnable() {
    public void run()
    findBtn.doClick();
    this.setLayout(panelLayout);
    add(masterViewPanel, BorderLayout.WEST);
    //add the second instance.
    add(masterViewPanel1, BorderLayout.EAST);
    I also had to call findBtn.doClick() again in the "constructor" that takes (JUApplication, boolean) after the panelBinding is executed,
    to force the initial startup of this panel in findmode

  • How to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part

    Hi,
    I want to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part like mentioned below:
    http://server/pages/Default.aspx?Title=Arup&Title=Ratan
    But it always return those items whose "Title" value is "Arup". It is not returned any items whose "Title" is "Ratan".
    I have followed the
    http://office.microsoft.com/en-us/sharepointserver/HA102509991033.aspx#1
    Please suggest me.
    Thanks | Arup
    THanks! Arup R(MCTS)
    SucCeSS DoEs NOT MatTer.

    Hi DH, sorry for not being clear.
    It works when I create the connection from that web part that you want to be connected with the Query String Filter Web part. So let's say you created a web part page. Then you could connect a parameterized Excel Workbook to an Excel Web Access Web Part
    (or a Performance Point Dashboard etc.) and you insert it into your page and add
    a Query String Filter Web Part . Then you can connect them by editing the Query String Filter Web Part but also by editing the Excel Web Access Web Part. And only when I created from the latter it worked
    with multiple values for one parameter. If you have any more questions let me know. See you, Ingo

  • How to build "Query by example" Report?

    I want to create a report which allows user to select which columns to return.
    It is similar to "Query by example" form. Have someone done that before and share me the PL/SQL how to do that?
    Thanks in advance.

    I got the answer, u need to set table.setFilterModel("") and refresh panel collection which contains this table
    whenever u need to make "Query By Example" button of panel collection invisible.

  • Query related to filter group on matnr created in ALE distribution model

    Hi All,
    I have query related to filter group on matnr created in ALE distribution model.
    I have created a filter group on matnr in ALE distribution model and put the value E*  ( purpose is that all the material number started with E should be triggered in case of any changes in the material).But it is not working.
    <b>Can anybody suggest the solution for this i.e how to capture E* value for the material master changes and should trigger idoc using change pointer using BD21.</b>
    Thanks & Regards
    Prabhat

    Unfortunately, you cannot filter using wildcards or exclusions.  You have to explicitly list each allowed value in its entirety.
    In my opinion, the simplest solution would be to copy function MASTERIDOC_CREATE_SMD_MATMAS, modify it to handle your custom filtering and update the message type entry in transaction BD60.

  • Use of Sub Query in a filter is throwing error

    Hi
    I am using a sub query in a filter which throws me the following error in owb 9i.
    PLS 00405 : Subquery cannot be used in this context.
    But the use of subquery works fine in a joiner operator.
    Use of Sub Query in a filter works fine in owb 2i.
    Could any one please help me.
    Thanks in Advance
    Nanda Kishore

    Nanda,
    Please wrap the source table in a view containing the subquery and then use the view as a source rather than use the subquery in the filter.
    Regards:
    Igor

  • PanelCollection -   Query By example Label Change

    Hi,
    We have panel collection in our screen with the properties of defaultToolbarItemDisplay="iconAndText",
    but its showing the Query By Example icon only, not showing the label.
    Our requirement is We have to show the label as Search after the QBE icon.
    We are using Jdeveloper 11.1.1.4.0
    Please give me the suggestion..
    Best Regards,
    Vijay

    Hi,
    did not have a chance to reproduce, but I would suggest testing with 11.1.1.5 and if it is the same problem there, file a bug with customer support
    Frank

  • JClient query by example doesn't work in 10.1.2.

    I've a JClient application I migrated from 9.0.4 to 10.1.2.
    In the migrated app query by example doesn't work anymore in JTables.
    Could someone help ?
    Tks
    Tullio

    Frank, I got a testcase from Tullio. It's a 9.0.4 project uding JClient that is pre-ADF bindings.
    I migrated his 9.0.4 project to 9.0.5.2 first.
    In 9.0.5.2, I see already a change in behavior related to enter-query mode in the JTable, but the number of rows displayed looks correct.
    Tullio, can you confirm if the problem you are seeing vis a vis enter query mode is that if you:
    1. Click enter-query button
    2. Click into a field like Ename and type SMITH but don't [Tab] out of that field yet
    3. Click on the execute-query button
    It behaves as if you've entered no criteria there.
    If at step 2 above you clicked [Tab] to exit the field where you typed SMITH, then it works correctly.
    Is this the enter-query-JTable-related problem you're seeing (that is, related to when you don't focus-out of the field?)
    The "number-of-rows-displayed" issue you mention in this other thread (10.1.2 JClient binding Error. does reproduce with your testcase only in 10.1.2 (as well as also still having this 9.0.5.2 focus-related issue in enter query mode).

Maybe you are looking for

  • Imported photos, transferred some photos to new album, deleted originals, ones in album are gone. How do I retreive them?

    Imported photos, transferred some photos to new album, deleted originals, ones in album are gone. How do I retreive them?

  • Posting with MP3s

    Hi, I've been using Logic Express to record original music, then I transfer it to iTunes as an MP3 file and add it to iWeb for publishing. Here's my question/problem. When I 1st got my iMAC (5 weeks ago) I placed around 14 songs that I either recorde

  • Lightroom is distorting photos

    I am trying to uplaod photos from my memory card, via a USB. When doing so, many of the photos are appearing disorted, with bands of colors masking the entire photo. I don't know why this is happening. Did anyone else experience such an issue? How do

  • Editing app with no cloud upload?

    I'm looking for an app that can do what Notability does (edit PDFs, take notes) but that DOESN'T have cloud integration, so Dropbox, etc.  The random apps I've tried all have the 'upload to cloud' facility... Does anyone know of a good editing app th

  • Cannot see previous purchase on iPad

    I Have Adobe digital on my laptop with an e book. I have now loaded adobe reader on my iPad but cannot see this e book in my account.