Class to Generate Dynamic Filter Function

I have built an ActionScript Class to allow me to create a
dynamic Filter Function for the several ArrayCollections I use in
my Flex Application. It works just as I intended, however, I'm
wondering if it's too verbose, and can be skimmed down to use less
code. For example, is there some way I could extend the Function
class? See a snippet of my Class attached.

I have built an ActionScript Class to allow me to create a
dynamic Filter Function for the several ArrayCollections I use in
my Flex Application. It works just as I intended, however, I'm
wondering if it's too verbose, and can be skimmed down to use less
code. For example, is there some way I could extend the Function
class? See a snippet of my Class attached.

Similar Messages

  • Dynamic filter function

    I would like to be able to pass a dynamic item.property to the filter function.
    Hardcoding it like this works
    private function filterthis(item:Object):Boolean {
    if(item.companyname == _sortvalue)    // I don't want to hardcode the property of item
         return true;    
         } else {
         return false;
    ----- but this is what I need ------
    private function filterthis(item:Object):Boolean {
    if(item._sortfield == _sortvalue)      // I tried passing in a string but it doesn't work
         return true;    
         } else {
         return false;
    What is the proper way to pass the item.property of my array collection,
    Thanks

    Never mind got it ... item[_sortfield]
    knew it was something simple ... sorry wear too many hats.

  • How can i extend the filter function to also include an option to select which column to filter on?

    Hi.
    I have built an spry test-page (testing it on my localhost  so i cannot give you direct access to it) here i have an XML file that i show in an dynamic/ repeat table with 5 columns.
    I hvae included an spry filter function to easy filter out records, but the code only allows me to filter on one of the columns.
    I would like to add an extra "select-menu" to define which column the filter should be active for, how can i do that
    Here is the filter code and also the html code for the select-menu and the box to type in what to filter.
    The bold parts is the important parts, i would like the options values from the select menu to be inserted in the filterData function to be able to define which column to do the filtering on.
    var ds1 = new Spry.Data.XMLDataSet("report3.xml", "orders/order", {sortOnLoad: "@id", sortOrderOnLoad: "descending"});
    ds1.setColumnType("date", "date");
    ds1.setColumnType("BUTIKNR", "number");
    ds1.setColumnType("EXTRAFRAKT", "number");
    ds1.setColumnType("job/@idx", "number");
    var jobs = new Spry.Data.NestedXMLDataSet(ds1, "job");
    function FilterData()
        var tf = document.getElementById("filterTF");
        var menu = document.getElementById("searchIdent");
        if (!tf.value)
            // If the text field is empty, remove any filter
            // that is set on the data set.
            ds1.filter(null);
            return;
        // Set a filter on the data set that matches any row
        // that begins with the string in the text field.
        var regExpStr = tf.value;
        if (!document.getElementById("containsCB").checked)
            regExpStr = "^" + regExpStr;
        var regExp = new RegExp(regExpStr, "i");
        var filterFunc = function(ds, row, rowNumber)
            var str = row["@id"];
            if (str && str.search(regExp) != -1)
                return row;
            return null;
        ds1.filter(filterFunc);
    function StartFilterTimer()
        if (StartFilterTimer.timerID)
            clearTimeout(StartFilterTimer.timerID);
        StartFilterTimer.timerID = setTimeout(function() { StartFilterTimer.timerID = null; FilterData(); }, 100);
    html:
                <select name="searchIdent" size="1" id="searchIdent">
                    <option value="@id" selected="selected">ID</option>
                    <option value="date">DATUM</option>
                    <option value="time">TID</option>
                    <option value="BUTIKNR">BUTIK</option>
                    <option value="REF">REFERENS</option>
                  </select>
              <input type="text" id="filterTF" onkeyup="StartFilterTimer();" />
    Contains:
      <input type="checkbox" id="containsCB" /></td>
    Thanks in advance.
    //Rickard H

    Now it works, i had to do it like this:
        var filterFunc = function(ds, row, rowNumber)
            var str = row["@id"];
            if (str && str.search(regExp) != -1)
                return row;
            var str1 = row["date"];
            if (str1 && str1.search(regExp) != -1)
                return row;
            var str2 = row["time"];
            if (str2 && str2.search(regExp) != -1)
                return row;
            var str3 = row["BUTIKNR"];
            if (str3 && str3.search(regExp) != -1)
                return row;
            var str4 = row["REF"];
            if (str4 && str4.search(regExp) != -1)
                return row;
            return null;
    I also had to remove the line "ds1.setColumnType("BUTIKNR", "number");" from the code, otherwise it would not search at all (only searches string types?).

  • Linking a class to a dynamic text field to load XML data.

    Hi,
    I'm quite new to ActionScript and would be grateful for any help here.
    I want to load text into a dynamic text field (called 'about_tab') using  a class depending on the language selected (by clicking on a flag icon)  by the user.
    I managed to get this to work when the ActionScript was written directly  in the timeline, but am having problems with doing the same thing via a  class.
    This is my class file:
    package
    import flash.display.SimpleButton;
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import flash.net.URLRequest;
    import flash.net.URLLoader;
    import flash.events.Event;
    public class ChangeLang extends SimpleButton
    public function ChangeLang()
    addEventListener(MouseEvent.CLICK, switchLang);
    trace("ChangeLang class working");
    public function switchLang(event:MouseEvent):void
    var lang = event.target.name;
    var req:URLRequest = new  URLRequest("languages/"+lang+".xml");
    var loader:URLLoader = new URLLoader();
    var substance:XML;
    function xmlLoaded(event:Event):void
    trace("function xmlLoaded is running");
    substance = new XML(loader.data);
    about_tab.text =  substance.about_lbl;
    loader.addEventListener(Event.COMPLETE, xmlLoaded);
    loader.load(req);
    Here's one of my XML files (the other is the same except "About" is  written in German):
    <substance>
    <about_lbl>About</about_lbl>
    </substance>
    When I run it, it returns my trace statements that the class ChangeLang  and the function xmlLoaded are running, but no text appears in the  dynamic text field (I should/want to see the word 'About'). I get this  error message:
    1120: Access of undefined property about_tab
    The problem, I'm guessing, is in the part in red in my code. I think I need to target the text field in the display list by creating a  reference to it. If so, could someonw point out how I do this, or perhaps a tutorial that would help. I've tried adding the word stage (i.e.,stage.about_tab.text =  substance.about_lbl; ) but it still doesn't connect. I guess there's something really simple I'm missing, so I  apologize if this comes across as a stupid question
    Thanks for any help.

    Hello flashrocket!
    I'm also new to AS3 and I've just started using external classes and I think I know what you should do to put your code to work.
    Instead of using the text field you created inside your flash file, why don't you use the "TextField" class to create an instance of this object? It's the exact same thing as when you create and instantiate a new text field inside Flash.
    First, import flash.text.*; (includes classes like TextField, TextFieldAutoSize, TextFormat, TextFormatAlign, etc)
    Than you just have to create a var like
    public var about_tab : TextField;
    or
    public var about_tab : TextField = new TextField();
    then, to adjust the properties of this tab you use dotsyntax as if it where on your stage like:
    about_tab.x = 50; about_tab.alpha = .5; etc...
    you can even create a function to "config your textField"
              private function createAndConfigTextField() : void {
                   about_tab = new TextField(); //you only need this line if you
              // only typed something like "public var about_tab:TextField;
              // if instead you used "public var about_tab:TextField = new TextField(); outside
              // this function, just skip this first line because you already have an instance of
              // text field named "about_tab"...
                            about_tab.autoSize = TextFieldAutoSize.CENTER;
                   about_tab.background = true;
                   about_tab.border = true;
                   var aboutTextFormat : TextFormat = new TextFormat();
                   format.font = "Arial";
                   format.color = 0x000000;
                   format.size = 11;
                   format.bold = true;
                   format.align = TextFormatAlign.CENTER;
                   about_tab.defaultTextFormat = aboutTextFormat;
                   addChild(about_tab);
    This is just an example of what you can do... I hope you get it... let me know if you have any doubt...

  • CHART BUILDER ERROR WHEN TRYING TO GENERATE DYNAMIC CHARTS ON A JSP PAGE

    I'm working with J Develop 9.03 on Windows 2000 Professional Edition.
    I'm using the JSP demo files provided with Oracle Chart Builder to generate
    dynamic charts. The user specifies the query parameters, including the date
    range and the query results are returned by means of a line chart (with date on
    the x axis and values on the y axis).
    When trying to compile the project I get the following error messages:
    Error(165,2): class FileOutputStream not found in class _graph
    Error(170,5): class File not found in class _graph
    Error(176,4): exception java.io.IOException is never thrown in the
    corresponding try block
    I checked to see that the chartbuilder library (chartbuilder.jar) files are
    loaded into the project library. It's unusual that the class is not being
    found. I don't understand why. I developed my project using the following steps:
    1. Unzipped Chart Builder installation files into c:\Oraclechartbuilder
    2. Loaded chartbuilder class library
    c:\Oraclechartbuilder\chartbuilder\lib\chartbuilder.jar into J Developer class
    path (by selecting <Project Settings> <Paths> and browsing to the
    chartbuilder.jar file).
    3. Created a new JSP page in J Developer (graph.jsp)
    4. Copied JSP code syntax from the Word Pad demo file and pasted into graph.jsp
    5. Changed the DB connection parameters and static directory location on the
    JSP page.
    6. Compiled the project and received the above errors.
    I would like to know why the classes are not being found and how to fix the problem. Thanks, Jaafar

    Hi mshah101,
    This can happen if the applet is compiled using an higher version of java and the browser is pointing to an older version (even if minor version number is higher)

  • How to set a dynamic filter to a prompted one?

    Hello:
    I have a dashboard prompt whose values determine the columns for a constructed dynamic filter column using case statement.
    There is another dashboard prompt whose value determine the the values for the dynamic filter column.
    I have a need to set this dynamic filter to the operator 'is prompted'. According to the OBIEE documentation, the requirement for 'is prompted' filter is to have the dashboard prompt column match with the filter column.
    I currently use a presentation variable for the dashboard prompt column that gives the filter value.
    How do I make my dynamic filter to be prompted (for pre-filtering results as a default behavior) and subsequently use the presentation variable (derived from the dashboard prompt) if a user enters the appropriate prompt values?
    Here is an example:
    Dashboard prompt: Location Type-> (State, District, City) (The case statement on my filter determines the appropriate logical column State or District or City)
    Filter Value: Dallas (pv1)
    The dynamic filter will generate "City" = '@{pv1}' (Dallas in the above example)
    I want this dynamic filter to be set to 'is prompted' for pre-filtering results as a default behavior.
    Thanks for reading this far and looking forward to your suggestions.
    Regards
    Sankar Bala

    Please read this carefully, you may find what you are looking for:
    Dynamic dashboard prompts and columns used in multifunctional report, full guided navigation
    http://108obiee.blogspot.com/2009/08/dynamic-dashboard-prompts-and-columns.html
    Or this one:
    http://obiee101.blogspot.com/2009/04/obiee-dynamic-prompt-content.html
    Regards
    Goran
    http://108obiee.blogspot.com

  • Filter function causing 0 items in combo box

    HI there, I have combobox with the dataProvider set up like below
        <mx:ComboBox rowCount="10" id="selectUser" 
                        dataProvider="{VO.getInstance().clientsResultForAddTrade}" width="258"
                        x="28" y="10" >        
                    </mx:ComboBox>
    in the VO class I have some code that calls the filter function (when clientsResultForAddTrade is refreshed in the clientsDataChangeHandler) when the clientsResultForAddTrade data changes.
          private function clientsDataChangeHandler( event:PropertyChangeEvent ):void{
               clientsResultForAddTrade.refresh();
            public function VO(caller:Function=null)
                if (caller != VO.getInstance)
                    throw new Error("Singleton is a singleton class, use getInstance() instead");
                if (VO.instance != null)
                    throw new Error("Only one Singleton instance should be instantiated");
                //put instantiation code here
                clientsResultForAddTrade.filterFunction = clientAuthorisedFilterFunction;
                 activityWatcher = ChangeWatcher.watch( this, "clientsResultForAddTrade", clientsDataChangeHandler);
                private function clientAuthorisedFilterFunction(item:Object):Boolean
                    var b:Boolean =  item.status == 'Authorised';
                    return item.status == 'Authorised';
    However there are 0 items in the selectUser combobox after the filter function is called, I have checked that it returns true when item.status == 'Authorised'
    Please advise, 10 points available

    Could it be a problem with the way I assign the data in the first place?
    private function handleGetClients(event:ResultEvent):void
                    VO.getInstance().clientsResult=event.result as ArrayCollection;
                    //the following has a filter function in the model that automaticly refreshes
                    VO.getInstance().clientsResultForAddTrade.source = (event.result as ArrayCollection).source;

  • Quartz Filter function in Preview.

    I am having a problem with the Quartz Filter function in Preview. I do a monthly newsletter for a local car club. The newsletter is distributed as a printed copy and as a PDF for e-mail and on-line viewing. I prepare the newsletter in iStudio Publisher and then open it in Preview. The file size can be quite large so I use the Export-Quartz Filter-Reduce File Size to prepare the PDF for e-mail use. Since I have updated to Mavericks 10.9 some portions of the newsletter come out as a negative.  See the below example.

    Hi. Thanks for answering.
    Take a look in what I have in Google Sheet:
    Maybe I'm not using it right, but seems to me if I need to change what I want to see (if Chinese, Italian...) I need to go back in Filter dialog and change the value, can't be dynamic, based in a cell value. Besides that seems to me if I use filter all the rest of my sheet disappears. This Filter Function can be put in any place, so I can do, for example, first 5 lines showing Chinese, the next 5 showing Italian etc.
    Hope my screenshots helps.
    Thanks.

  • Database Generator: PL/SQL Functions in packages

    I've created a package, P. I've created a function, F. I've specified that F is a sub-program of P.
    I run the designer generator, and tell it I want to generate everything. I get both the package with its function. So, P.F all fine :)
    But, since I selected everything to generate, it also generates F as a stand-alone function. How do I stop this happening?
    Obviously, in this case I could not select the function F to be generated. But we've actually got a mixture of stand-alone functions and procedures, as well as packages. And I don't want to have to manually ensure that I'm selecting and de-selecting the right names.

    What you want to do is use a filter - in other words filter Function Definitions so that only stand-alone functions are listed in the Navigator tree. But what property to filter? Function definitions don't have a property that shows the parent package. Well, they do have a property under Invocation called "Top Level?", but if you display the help on this property, you'll see that is documentation only, not used in generation, and has to be set manually. The default is "No". Still, you work with what you've got.
    So as a one-time deal, turn on the Property Palette (F4), highlight each stand-alone function in the Navigator, and change this property for all of your stand-alone functions to "Yes". Make sure that you do the same with stand alone Procedure Definitions and ALL Package Definitions. Save your changes. Whenever you create a new stand-alone function, or ANY package you'll have to remember to set this property to "Yes". Then right click PL/SQL Definitions, select Filter, then in the "Filter in Navigator set Top Level to Yes. You can make this your permanent default filter, or only use this filter when you are generating.

  • Filter function problem in Tree

    Hi All,
    In the below code, I am trying to put filter function on parent. Now if I type "Ratings" and then again clear the search. the Bottom node gets lost. Please let me know ho can I retin the bottom node. Please note that bottom node also contains "Rating" wth one less "s".
    here is the code.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" viewSourceURL="
    srcview/index.html"creationComplete="init()"
    >
    <mx:Script>
    <![CDATA[
    import vo.Person; 
    import mx.collections.ArrayCollection; 
    private function init():void{ 
    var person1:Person=new Person("Parent"); 
    var person2:Person=new Person("Watch Status"); 
    var chilPerson:Person=new Person("Ratings"); 
    var childPersion2:Person=new Person("rating"); 
    person1.children=
    new ArrayCollection([chilPerson]);person2.children=
    new ArrayCollection([childPersion2]); 
    people.addItem(person1);
    people.addItem(person2);
    personsTree.dataProvider=people;
    Bindable] 
    private var people:ArrayCollection = new ArrayCollection(); 
    private function refreshData():void{ 
    for (var i:int=0;i<this.people.length;i++){ 
    //reset the root node to its original unfiltered data
    people[i].children =
    new ArrayCollection(people[i].children.source); 
    //start the recursion at the root node
    refreshRecursiveChildren(people.source[i]);
    //update the Tree after the data has been filtered
    personsTree.invalidateList();
    people.filterFunction=filterData;
    people.refresh();
    //end refreshData function 
    private function refreshRecursiveChildren(person:Person):void{ 
    if(person.children){ 
    //loop through each child and filter its children 
    for each(var _person:Person in person.children.source){refreshRecursiveChildren(_person);
    //reset each "children" ArrayCollection to its original unfiltered dataperson.children =
    new ArrayCollection(person.children.source); 
    //set the filterfunction for the newly updated nodeperson.children.filterFunction = filterData;
    //run the fitlerFunctionperson.children.refresh();
    //end refreshRecursiveChildren function 
    public function filterData(item:Object):Boolean{ 
    //get the string to filter the nodes by 
    var searchString:String = iNameFilter.text; 
    //if string is found in node return true. 
    //since the recursive filtering takes place from bottom up, if 
    //a collection still has children after filtering, also return true 
    if(searchString.length == 0 || item.name.toLowerCase().indexOf(searchString.toLowerCase()) >= 0) 
    return true; 
    else if(item.children != null && item.children.length > 0) 
    return true; 
    return false;}
    //end filterData function 
    ]]>
    </mx:Script>
     <mx:VBox width="200" height="300" paddingTop="10" paddingBottom="10" paddingLeft="5" paddingRight="5">
     <mx:Tree id="personsTree" dataProvider="{people}" labelField="name" width="100%" height="100%" />
     <mx:HBox>
     <mx:Label text="Filter the Tree:" />
     <mx:TextInput id="iNameFilter" change="refreshData()" />
     </mx:HBox>
     </mx:VBox>
     </mx:Application>
    Below is the Action script packge
    package 
    vo{ 
     import mx.collections.ArrayCollection; 
    public class Person{ 
    public var name:String; 
    public var children:ArrayCollection; 
    public function Person(_name:String, _children:ArrayCollection = null){ 
    this.name = _name; 
    if(_children != null) 
    this.children = _children;}
    //end Person constructor 
    //end Person class 
    //end package declaration
    Regards,
    Abhinav

    Hi ,
    I was able to fix this issue for my purpose. Below is the code that beeds to be chnaged to.
    private  
    function refreshData():void{ 
    this.people=new ArrayCollection(this.people.source); 
    for (var i:int=0;i<this.people.length;i++){ 
    //reset the root node to its original unfiltered data
    people[i].children =
    new ArrayCollection(people[i].children.source); 
    //start the recursion at the root node
    refreshRecursiveChildren(people.source[i]);
    personsTree.invalidateList();
    people.filterFunction=filterData;
    people.refresh();
    this.callLater(expandAllAvailable);}
    //end refreshData function
    Basically, I am reassigning the arraycollection to its source whenever a new character is typed in. This will do a proper filtering to complete new arrayCollection.
    Thanks for your prompt responses so far. I really appreciate it.
    Regards,
    Abhinav

  • Dynamic filter on time characteristics on OLAP SAP BEX query based universe

    Dear all,
    I'm currently working on the integration between SAP NetWeaver BI 7.0 and SAP BusinessObjects XI 3.1 FP 1.5 via integration kit.
    I've built an OLAP universe on the top of a BW query based on a multiprovider that contains 10 infocubes.
    Everything works fine but I need to create a filter in the OLAP universe that allows to restrict data by current date (e.g. using TIME characteristic of Infocube such as 0CALDAY or 0CALMONTH). From that filter we could start creating other conditions to compare data to different time periods.
    I've already tried to use a SAP exit variable in  a BW query but this kind of object would restrict query data only by current date and for example it would be impossible to browse data by previous years (to bypass this problem we could use restricted key figures with different offsets but we have too many key figures in the query and the number of restrictions
    would rise exponentially). 
    In a relational DataBase we can do that using a "where condition" based on 'CURRENTDATE' (SQL DB2 syntax).
    Now, we need to apply the same logic but translated in MDX syntax. 
    Is it possible to enter a dynamic filter in the OLAP universe or just fixed or promt values ?
    Any advise?
    Thanks in advance.
    Best Regards.
    M.

    Hi Ingo,
    1) My question is: "How can I have to manage variable in BEX queries and in the UNIVERSE in order to obtain the maximum flexibility to create reports with measures on actual day (for example) without asking the user to promt a value ?"
    I want to use an unique BEX query to define an unique UNIVERSE. On this UNIVERSE I want to create many reports (actual day, previous day, and so on).
    If I restrict 0CALDAY with an EXIT variable then shall I be able to create a different restrictions on the same Universe based on 0CALDAY ?
    2) Another question is:
    Is it possible to insert an XML / MDX filter on the OLAP Universe with dynamic derivation of the system date ?
    For example:
    Instead of this:
    <FILTER KEY="[0FISCYEAR].[LEVEL01].[NAME]">
        <CONDITION OPERATORCONDITION="Equal">
            <CONSTANT CAPTION="Z12008"></CONSTANT>
        </CONDITION>
    </FILTER>
    Is it possible to insert a tag with a dynamic function to derive the system date ?
    Thanks in advance.
    Best Regards.

  • Dynamic filter to capture the highest value at runtime.

    Hi,
         Is there a way through which we can have a dynamic filter in Webi, which would automatically filter the maximum value from a list of values associated with a dimension object? 
         I have the following scenario :- I have a dimension object called 'Plan Version', whose list of values would typically be 00, 01, 02, 03.....and so on. These values are updated in the database after every 15 days. Now, in my report, i need to display the data which would be associated only to the highest 'Plan Version' value. This requires me to apply a filter on the highest value of 'Plan Version', which is not a difficult job to do if it has to be a static filter. However, I need it to be a dynamic filter, i.e., every time a new plan version is uploaded in the system, and if the report is refreshed, the report filter should automatically select (highlight) the highest value for 'Plan Version' and display the data accorsingly.  One way would be to use the 'Max' function, but aggregate functions cannot be used in filters. Any help would be greatly appreciated.
    Thanks,
    Alok.

    Hey Alok,
    You're correct, using Max(). But you have to apply/use it @Universe level not @Query panel.
    Create Object @Universe:
    Plant version = Max([Plant Version]) and make it as Dimension type.
    Now use this Plane version object for Prompt @ Query level. So that it will fetch max value for the Plant Version all times.
    Hope you got the logic.
    Gracias...!!

  • Programmatically use a view filter function

    Are there any way to activate the built-in filter functionality from the SDK? (The one on top of a view: Edit Criteria->Add Criteria)
    I need to make a task, which filters the current view, based on what the user selects in my task.
    More specifically: A view has a number of columns, one of them being Classification Category. So by using a list of those, can I take the users input, and use it to filter a view by Classification Category?
    Alternatively, as I suspect the above isn't possible, how do I display a list of incidents in a custom form? Something like the search window, I would like to be able to display a list of incidents, which corresponds to some criteria, and enable the users to
    double-click to open them.

    Yes, essentially. I'd like to define the content of my emails in facelets via XHTML files, ideally with as few restrictions on what parts of JSF/facelets can be used as possible.
    To be a little more explicit, suppose I've defined my email contents in /WEB-INF/email.xhtml and it has parameters x, y and z. I'd like to have a class, say MagicViewRenderer, which could do the following:
    MagicViewRenderer mvr = new MagicViewRenderer(facesContext);
    mvr.setParameter("x", objX);
    mvr.setParameter("y", objY);
    mvr.setParameter("z", objZ);
    String contents = mvr.render("/WEB-INF/email.xhtml");
    // Use contents as the body of an email message

  • OAAdvancedTableBean.queryData doesn't use dynamic filter on VO

    My page contains two regions:
    1. Search region with fields and button Go
    2. Search results
    At first search results region was made on ordinary table and I used initQuery method to set filter and execute query. table displayed results of execution query.
    Then I changed it to advancedTable and had to use it as in devguide:
    1. initQuery with executeQuery=>false 2. queryData with checkForExecuted=>false
    It populates advancedTable with data but... without dynamic filter wich I set in initQuery. I'm getting full VO without where condition
    There's my mistake? Pls help
    JDev for apps 11 RUP6

    Hi ealex,
    I create one search page & Results advanced table(Based upon VO) on same page based upon VO. I want to show the all search records in Table/Advanced Table. Now my page is running fine if I click on GO button page is refreshed but no results in results table. It shows the default message like "No search Found".
    How can I display the records in either normal Table or Advanced Table?
    If u have the sample code for displaying the records in Table please forward to me. My mail id: [email protected]
    Here is my SQL script & CO, AM & VO codes please correct on my code anything I missed here.
    Any mistakes in my code?
    I am using JDeveloper 9.0.3
    OAFramework version is 11.5.10.K
    Please help me on this ASAP. It's urgent.
    Thanks in Advance.
    My Select Stmt:
    SELECT * FROM
    (select wn.nid notification_id
    ,ou.name company
    ,I.PAY_GROUP_LOOKUP_CODE paygroup
    ,'AP' source
    ,pf.full_name initiator
    ,pv.vendor_name supplier_name
    ,I.GL_DATE FROM_TO_DATE
    from ap_invoices_all i
    , po_vendors pv
    , hr_operating_units ou
    , per_all_people_f pf
    , FND_USER FU
    , (SELECT trim(substr(substr(substr(WN.subject,(instr(WN.subject,'Invoice ') + 8),100),1,100),
    1,instr(substr(substr(WN.subject,(instr(WN.subject,'Invoice ') + 8),100),1,100),' for'))) inv_no
    ,notification_id nid
    FROM WF_NOTIFICATIONS WN
    WHERE WN.MESSAGE_TYPE = 'APINV'
    AND WN.STATUS NOT IN ('CANCELED','CLOSED')) wn
    where i.vendor_id = pv.vendor_id
    and i.invoice_num = wn.inv_no
    and i.WFAPPROVAL_STATUS = 'REQUIRED'
    and pv.vendor_name = nvl(:vendor_name,pv.vendor_name)
    and i.org_id = OU.organization_id
    AND OU.name like nvl(:company_name,name)
    and i.pay_group_lookup_code = nvl(:pay_group,i.pay_group_lookup_code)
    and exists (select ad.invoice_id
    from ap_invoice_distributions_all ad
    where ad.invoice_id = i.invoice_id
    and ad.accounting_date between nvl(:from_date,ad.accounting_date)
    and nvl(:to_date,ad.accounting_date))
    and 'AP' = nvl(:source,'AP')
    and i.created_by = fu.user_id
    AND fu.EMPLOYEE_ID = pf.person_id
    AND pf.full_name like nvl(:initiator, pf.full_name)
    UNION ALL
    select po_num.nid notification_id
    ,ou.name company
    ,ps.PAY_GROUP_LOOKUP_CODE paygroup
    ,'PO' source
    ,pf.full_name initiator
    ,pv.vendor_name supplier_name
    ,P.CREATION_DATE FROM_TO_DATE
    from po_headers_all p
    ,po_vendors pv
    ,po_vendor_sites_all ps
    ,hr_operating_units ou
    ,per_all_people_f pf
    ,(select trim(substr(wn.subject,24,instr(wn.subject,' for')-24)) po_no, notification_id nid
    FROM WF_NOTIFICATIONS WN
    WHERE WN.MESSAGE_TYPE = 'POAPPRV'
    AND WN.STATUS NOT IN ('CANCELED','CLOSED')
    and wn.subject like 'Standard Purchase Order%') po_num
    where p.SEGMENT1 = po_num.po_no
    and p.vendor_id = pv.vendor_id
    and p.org_id in(select organization_id
    from hr_operating_units
    where name like nvl(:company_name,name))
    and pv.vendor_name = nvl(:vendor_name,pv.vendor_name)
    and p.AUTHORIZATION_STATUS = 'IN PROCESS'
    and p.CANCEL_FLAG = 'N'
    and 'PO' = nvl(:source,'PO')
    and p.agent_id = pf.person_id
    and pf.full_name like nvl(:initiator, pf.full_name)
    and pv.vendor_id = ps.vendor_id
    and ps.org_id = ou.organization_id
    and ou.name like nvl(:company_name,name)
    and ps.PAY_GROUP_LOOKUP_CODE = nvl(:pay_group,ps.PAY_GROUP_LOOKUP_CODE)
    and trunc(p.creation_date) between nvl(:from_date,trunc(p.creation_date)) and nvl(:to_date,trunc(p.creation_date))
    In CO PFR Code:
    if (pageContext.getParameter("Go") != null)
    OAQueryUtils.checkSelectiveSearchCriteria(pageContext, webBean);
    String COMPANY = pageContext.getParameter("COMPANY");
    String PAYGROUP = pageContext.getParameter("PAYGROUP");
    String SOURCE = pageContext.getParameter("SOURCE");
    String INITIATOR = pageContext.getParameter("INITIATOR");
    String SUPPLIER_NAME = pageContext.getParameter("SUPPLIER_NAME");
    Boolean executeQuery = BooleanUtils.getBoolean(false);
    Serializable[] parameters = { COMPANY, PAYGROUP, SOURCE, INITIATOR, SUPPLIER_NAME, executeQuery};
    Class[] paramTypes = { String.class, String.class, String.class, String.class, String.class, Boolean.class };
    am.invokeMethod("initSearch", parameters, paramTypes);
    OAAdvancedTableBean table = (OAAdvancedTableBean)webBean.findChildRecursive("ResultsTable");
    table.queryData(pageContext, false);
    AM invoke Method():
    public void initSearch(String company,
    String paygroup,
    String source,
    String initiator,
    String supplier_name,
    Boolean executeQuery)
    WorklistFindVOImpl vo = getWorklistFindVO1();
    if (vo == null)
    MessageToken[] tokens = { new MessageToken("OBJECT_NAME", "WorklistFindVO1") };
    throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", tokens);
    vo.initQuery(company, paygroup, source, initiator, supplier_name, executeQuery);
    VO Code:
    public void initQuery(String company,
    String paygroup,
    String source,
    String initiator,
    String supplier_name,
    Boolean executeQuery)
    StringBuffer whereClause = new StringBuffer(500);
    Vector parameters = new Vector(5);
    int clauseCount = 0;
    int bindCount = 0;
    setWhereClauseParams(null); // Always reset
    if ((company != null))
    String companyname = null;
    try
    companyname = new String(company);
    catch(Exception e) {}
    whereClause.append("COMPANY= :COMPANY");
    whereClause.append(++bindCount);
    parameters.addElement(company);
    clauseCount++;
    if ((paygroup != null) && (!("".equals(paygroup))))
    if (clauseCount > 0)
    whereClause.append(" AND ");
    whereClause.append("PAYGROUP = :PAYGROUP");
    whereClause.append(++bindCount);
    parameters.addElement(paygroup);
    clauseCount++;
    if ((source != null) && (!("".equals(source))))
    if (clauseCount > 0)
    whereClause.append(" AND ");
    whereClause.append("SOURCE = :SOURCE");
    whereClause.append(++bindCount);
    parameters.addElement(source);
    clauseCount++;
    if ((initiator != null) && (!("".equals(initiator))))
    if (clauseCount > 0)
    whereClause.append(" AND ");
    whereClause.append("INITIATOR = :INITIATOR");
    whereClause.append(++bindCount);
    parameters.addElement(initiator);
    clauseCount++;
    if ((supplier_name != null) && (!("".equals(supplier_name))))
    if (clauseCount > 0)
    whereClause.append(" AND ");
    whereClause.append("SUPPLIER_NAME = :SUPPLIER_NAME");
    whereClause.append(++bindCount);
    parameters.addElement(supplier_name);
    clauseCount++;
    setWhereClause(whereClause.toString());
    if (bindCount > 0)
    Object[] params = new ObjectbindCount;
    parameters.copyInto(params);
    setWhereClauseParams(params);
    if ((executeQuery != null) && (executeQuery.booleanValue()))
    executeQuery();
    } // end initQuery()

  • How to determine one class is a dynamic one or not?

    hello,i got a simple question,like the title says.
    how to determine one class is a dynamic one or not?
    finally,i got an indirect solution.
    package {
    public dynamic class MyClass extends MySuperClass
    public function MyClass()
    super();
    this.isDynamic=true;
    this is a simple dynamic class,i defined a varible
    directly,it is ok with dynamic class though i didn't declare it.
    then in another class(parent class of this dynamic
    class),where i try to determine the instance of this dynamic class
    is a dynamic one or not.
    i will use one function "checkIsDynamic" to check that
    varible is exsit or not.then it will help me to determine what i
    want know.
    protected function checkIsDynamic():Boolean
    try{this["isDynamic"]}
    catch(er)
    return false;
    return true;
    if another child class of MySuperClass didn't defined this
    property,i can affirm it is not a dynamic class,or vice versa
    this function also can be expanded to another one:
    protected function checkProperty(prop:String):Boolean
    try{this[prop]}
    catch(er)
    return false;
    return true;
    it is an useful solution,defined in parent class,and to check
    the property is exist or not in child class.

    try adding a property to a class instance.

Maybe you are looking for

  • Gif support true transparency?

    gif support true transparency?

  • DashboardMaxBeforeMenu Tag in OBIEE 11g

    Hi Please let me know wether we can use "<DashboardMaxBeforeMenu>" tag in the instanceconfig.xml file in OBIEE 11g. Thanks.

  • Satellite A130: Fn key not working with Vista - only FlashCards

    Hi, I have been looking around in the forums but I couldn't find solutions to my problem. I have a satelite A130 and I am running a windows VISTA home basic. I have a problem with my fn functions. I can only use the flash cards on top of my screen, j

  • Iphone synced with another library

    I used to use a PC to sync my iPhone but recently but a MacBook.  Now when I try to sync my iPhone with the MacBook it says my iPhone is synced with another iTunes Library and if I continue everything on my phone will be erased and synced with the li

  • Offline preview differs from online display of Japanese text

    I can't figure out why my web site in English and Japanese cannot correctly display the Japanese type when uploaded. The offline preview is fine, but the online version turns the Japanese to gibberish. I have set the charset="UTF-8" in metatags and i