Dynamically subsetting a LOV based on a View Object

Hi,
Hoping you guys can help out. I am having issues with Partial Page Refresh and Dynamically
STATUS table ( STATUS_ID NUMBER, STATUS_NAME VARCHAR2(10)) with values 1 = Open, 2 = Won, 3 = Lost
ACTIVITIES ( ACTIVITY_ID NUMBER, ACTIVITY_NAME VARCHAR2(20), STATUS_ID NUMBER)
The list of permissible activities is dependent on the value of the Status Id and both are shown as LOV's in the same popup/dialog.
I've created EO's and VO's for both tables. I've created a query based view object called voPermissableActivities with sql "select * from activities act where act.status_id = :pStatusId " and have set up the bind variables, etc.
Against the Activities VO I created a LOV for the ActivityId using the voPermissableActivities.
I've set the autosubmit property of the Status Id LOV to true and created a ValueChangeListener for the Status LOV in the backing bean. I've also set the partialRefresh property of the Opportunity LOV to point to the Status LOV
In the StatusChange listener I
1. get the a DCIteratorBinding which points to the view iterator underpinning the two LOV's
2. using the iterator I get the value of the Status LOV
3. I then grab a reference to the ViewObject for voPermissableActivities and set the bind variable pStatusId to reflect the value of the Status LOV using the following code snippet
ViewRowSetImpl vOppRSI = (ViewRowSetImpl) currentRow.getAttribute ( "voAccountOpportunity1");
ViewObject voOpportunities = vOppRSI.getViewObject();
voOpportunities.setNamedWhereClauseParam("StatusId", currentRow.getAttribute("StatusId"));
System.out.println ( "Est. Row Count : "+voOpportunities.getEstimatedRowCount());
voOpportunities.executeQuery();
System.out.println ( "VO Query: "+voOpportunities.getQuery());
I've got a tonne of debugging code in the method and can see the server log accurately reflecting changes at the UI layer - so I know it's working properly - also the estimatedRowCount returns values I would expect to see. However, the values in the LOV based on the voPermissableActivities view are not changing. So, I'm guessing that the LOV does not properly get refreshed !? or at least, the ADF framework does not automatically refresh it. So, I then found the following snippet to pogrammetically refresh the LOV -
System.out.println ( "Getting ADF Context");
AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
System.out.println ( "Calling PPR") ;
adfFacesContext.addPartialTarget(getLovOpportunityId());
System.out.println ( "after calling ppr");
Any ideas? This is driving me crazy !!!

Cheers Frank,
That works fine where I have a discrete and manageably small set of potential values - in the snippet I included there were 3 potential values - and it is feasible to prepare three VO's to drive the LOV. However, in the PRODUCTION version of what I'm trying to do I may have many more.
Any other thoughts?
One approach I wanted to explore was dynamically creating the VO at run time. Would that work?

Similar Messages

  • Creating a dynamic Selection List based on a View Object

    Hello,
    I'm new to JDeveloper and I would like to create a JSP Page with dynamic Selection List based on a runtime query or based on a view object (BC4J). The selection made by an user should serve another dynamic query with the necessary parameters that I built using createViewObjectFromQueryStmt(). By now I tried this using the InputSelectLOV from the Component Palette in JDeveloper. But without success. By the way: the selection list is not very large (5 values), so it's not necessary to have a form finding the desired value.
    Maybe someone had experience about creating this already. Please give me a tip or a little example.
    Thanks.

    http://otn.oracle.com/products/jdev/howtos/jsp/renderers.html

  • How to create LOV not based on a View Object attribute?

    Hi,
    I am creating a handed-made search form and I want to create an af:inputListOfValues.
    I have :
    - a read-only-view-object to get the LOV values from BD.
    - af:inputListOfValues tag (droped from Component Palette).
    How can I create the listOfValuesModel in Bindings layer? (the inputListOfValues is not based on a View Object attribute).

    Sorry, I think I am not very clear in my posts.
    My requirement is to create a LOV but I have no ViewObject. I just want an input (not based on a view object attribute), alone, but with a LOV (where lov's datas are get from a view object).
    In a "normal" LOV I would have something like this :
    in jsff :
    <af:inputListOfValues id="departmentIdId"
                                popupTitle="Search and Select: #{bindings.DepartmentId.hints.label}"
                                value="#{bindings.DepartmentId.inputValue}"
                                label="#{bindings.DepartmentId.hints.label}"
                                model="#{bindings.DepartmentId.listOfValuesModel}"
                                required="#{bindings.DepartmentId.hints.mandatory}"
                                columns="#{bindings.DepartmentId.hints.displayWidth}"
                                shortDesc="#{bindings.DepartmentId.hints.tooltip}">
            <f:validator binding="#{bindings.DepartmentId.validator}"/>
            <af:convertNumber groupingUsed="false"
                              pattern="#{bindings.DepartmentId.format}"/>
          </af:inputListOfValues>in pageDef :
    <listOfValues StaticList="false" IterBinding="EmployeesView1Iterator"
                      Uses="LOV_DepartmentId" id="DepartmentId"/>in model layer : a view object (EmployeeView) with view accessor and LOV based attribute, and a read only view object (DepartmentRVO) to get datas for the LOV.
    But in my case I have no ViewObject, so I don't know how to create the listOfValuesModel in fragment pageDef.
    I have :
    <af:inputListOfValues label="Label 1"
                                    popupTitle="Search and Result Dialog"
                                    id="ilov1" model="here I want to point to a listOfValuesModel but I don't know how to create it"/>in pageDef : the listOfValuesModel but I don't know how to create it.
    in model layer : just a read only view object (like DepartmentRVO), to get the datas for the LOV.
    Edited by: h0s on 29 févr. 2012 00:31

  • BI Publisher report based on VO (View Objects)

    Hi,
    I would like to know, can we generate BI Publiher report based on VO (view Objects ). Actually we are creating VOs for ADF and want to know if that can be used for generting BIP report.
    Thank,s
    Niraj

    Hi Niraj
    Yes, you can, there is a method on the VO to get the data from it in an XML format. Then use our APIs >> documentation to format it with a template.
    Regards, Tim

  • How to create ADF UI based on polymorphic view objects

    Hi,
    I'm using JDeveloper build JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660. I created a simple application based on Steve's example #10 [url http://blogs.oracle.com/smuenchadf/examples/]ViewRow and EntityObject Polymorphism.
    I added a men-only attribute "Age" to the "Men" VO and filled it with an arbitrary value in MenRowImpl.java:
    public String getAge() {
         return (String) "45";//getAttributeInternal(AGE);
    }Running the TestModule works perfectly - a row of type "Men" displays the "Age" attribute whereas a row of type "Women" doesn't.
    Afterwards, I setup an ADF ViewController Project and created a JSPX with a read-only form based on the "People" datacontrol with navigation buttons. Running that page always shows the same set of attributes independent of the row type. That's expected behaviour because the binding is defined at design time.
    So my question is: can I somehow achieve the same behaviour for polymorphic VOs as the business component tester shows?
    Kind regards,
    Markus

    Andrejus' example shows how to calculate different values for the same attribute based on overridden view objects. That's not exactly what I'm looking for. I need to display a (at least partly) different set of attributes that changes while the user scrolls through the records of the result set.

  • LOV based on multiple views

    Is it possible to create a dynamic LOV that is based on multiple views? If so, how? Example code?

    I got it to work, however the order is still lacking. I tried using "order by" but it only worked if there was only 1 view. Perhaps I am setting up the code incorrectly.... and I am a bit foggy on what you mean about the 3rd column. What is supposed to be in that third column that would make it order, and how do you stop it from being in your final results?
    Thank you very much for your help!!

  • Adf table data based on web service -  LOV based on entity / View

    My tools version:
    Jdev: 11.1.2.3.0
    ADF essential 11.1.2.3
    My case:
    I have a data table based on webservice (client and proxy). In this table I have status ID field, I would like to show the status ID description, I have also a LOV View (based on entity).
    I try a lot things, but nothing work, could you please give an idea to show my status description in my data table for each line?
    Thanks a lot

    Frank,
    I would like to get the status description from the ADF BC LOV, because in my table (based on the webservice) I have only the ID status.
    It is possible?
    Regards
    KM

  • How to send a Row based in a view Object

    Hi,
    i has in the app module a method to insert but i want from the baking bean send a Row with the information but not function well
    ---this is my method in the app module
    public boolean CreaCliente1(Row row){
    ViewObjectImpl vo =this.getClientesVo();
    vo.insertRow(row);
    this.getDBTransaction().commit();
    return true
    in the bean the the method where i asign the data to the object row is
    public Row CreaCliente(Row row){
    SimuladorAppImpl app = new SimuladorAppImpl();
    ViewObjectImpl vo = app.getClientesVo();
    Row row = vo.createRow();
    row.setAttribute("IdCliente",0);
    row.setAttribute("NuDocumento",this.getNumeroDocumento());
    row.setAttribute("IdTipoDocumento",1);
    row.setAttribute("CaPrimerNombre", this.getPrimerNombre());
    row.setAttribute("CaSegundoNombre",this.getSegundoNombre());
    row.setAttribute("CaPrimerApellido",this.getPrimerApellido());
    row.setAttribute("CaSegundoApellido", this.getSegundoApellido());
    row.setAttribute("CaDireccion",this.getDireccion());
    row.setAttribute("CaTelefono",this.getTelefono());
    row.setAttribute("CaCorreoElectronico", this.getCorreoElectronico());
    row.setAttribute("IdCiudad",11);
    row.setAttribute("IdDepto",11001);
    row.setAttribute("FeFechaCreacion", new java.sql.Timestamp(new java.util.Date().getTime()));
    then i invok the method with the command button but apers a error
    how is the best way to do this
    thansk
    Edited by: JuanAndresDeveloper on 10-feb-2009 8:05

    You can't just simply create a new application module like that:
    SimuladorAppImpl app = new SimuladorAppImpl();This will not work!
    An other thing to mention is that you don't push Row objects from the view controller to the server side (this breaks the MVC paradigm).
    If you have to create a new row, you can create a method in your application module and call this method either with a number of attributes or a POJO object holding the values.
    Remember too that your new row normally have a primary key attribute which you have to fill with a distinct value for each row.
    To get the application module from within a backing bean you can look at ADFUtils.getApplicationModuleForDataControl("YourAppModuleDataControl");Search the FOD application for the ADFUtils class or this forum.
    Timo

  • Which is better creating view accessor based on view object or view instanc

    When creating view accessors whether in the entity object or in the view object, we have two options:
    1- create the view accessor based on a view object.
    2- create the view accessor based on a view instance.
    what are the differences between these two options?
    what are the cases where I should only use option 1 or option 2?
    which one is better?

    Hello Timo,
    I will try to explain my question better.
    when we create view accessor, after click on create new view accessor icon, the create view accessor window is opened, at the header of this window there is a statement says:
    Select a view object or shared view instance and shuttle it to the selected list to create a view accessor.
    and here is my concern, which one to use
    1- select a view object from one of the available view object and shuttle it to the selected list.
    2- select a view instance from the application module and shuttle it to selected area.
    If you have FOD sample (and I am sure you have it :) ), I see that oracle team has used both of them in different places, for examples
    1- in oracle.fodemo.storefront.entities.PersonEO all view accessors are created from view instance in SharedLookupService application module.
    <ViewAccessor
        Name="PersonTypesVA"
        ViewObjectName="oracle.fodemo.storefront.lookups.LookupsBaseVO"
        AMUsageName="SharedLookupService"
        ViewInstanceName="PersonTypes"/>is it because they are used to create LOV?
    2- in oracle.fodemo.storefront.entities.OrderEO the view accessor is created from a view object, not from instance inside application module.
        <ViewAccessor
        Name="OrdersVO"
        ViewObjectName="oracle.fodemo.storefront.store.queries.OrdersVO"/>I couldn't find the usage of this accessor?
    Hope it is clear now.

  • Can LOV base on a view?

    Hi,
    My client created a LOV based on a view. She attached the LOV to a form. When she runs the form, she chooses from the LOV, and insert a record. She tries to query what she just inserted, nothing shows up. She is using version 3.06 on HP unix.
    I did the same thing as she did, but I have version 3.07 NT on my laptop. I have no problem insert and query the record using a LOV based on a view. Is it a bug for 3.0.6?
    Thanks;
    Kelly.

    Kelly,
    This could be a bug in 3.0.6, but I'm pretty sure this is related to LOV style (popup lov most likely) rather than fact that it is based on a view. There was a number of bugs fixed in 3.0.6 - 3.0.8 timeframe, you may check the bug database for that.
    Thanks,
    Dmitry

  • Separate App Module, View Object based on Select not EO: Best practice?

    Hi,
    I have a list of base tables(parameters) that are used everywhere in my application for selection components (List, Combo, Radio).
    I'm considering creating a separate app module with a view object based on query for each table.
    I have created a BaseTableAM application module for managing those tables, Entity objects and View Objects in update mode.
    Those tables are rarely changed.
    Example of table:
    ItemType
    item_type_id = primary key
    name = description
    In the BasetableAM:
    ItemTypeEO entity object
    ItemTypeVO updateable view object based on related entity object.
    Now in my project I will create combo boxes for selection of the item_type_id.
    Separate application module:
    SelectionViewAM composed of View Objects based on Select statements and not on Entity Objects.
    Example of view object ItemTypeViewVO:
    SELECT ItemType.ITEM_TYPE_ID,
    ItemType.NAME
    FROM ITEM_TYPE ItemType
    All view objects in this application module will be read-only and for selection only.
    By basing all those View Objects on select statements not based on Entity Objects I suppose there will be no locking and "value changed" management => less overhead.
    Is this a good practice?
    Being read-only I could have based those View Object on Entity Object with flag updateable set to no, what would you recommend?
    By creating a separate Application Module for those selection view objects, I know that update will not be possible.
    Thank you for your advice.
    Frederic

    See this article for View Object tuning tips:
    http://www.oracle.com/technology/products/jdev/tips/muench/voperftips/index.html
    Are you planning to use this AM as a nested AM inside other application modules?
    If you don't the "selection AM" will have its own, separate database connection/transaction.
    If you do, it will share connection, transaction with its containing "root" AM.
    It may not be relevant to your application, but just realize (which is explained in the article I point to above) that view objects that are not related to entity objects do not "see" pending changes in the current transaction. That feature depends on the VO/EO cooperation. It's fine to build VO's without an EO -- in fact we've made it easier to do this in 10.1.2 in the Design Time wizards -- but you just want to make sure you realize what features it's giving up. If you don't need those EO-related features, then by all means create an Expert Mode VO that's not related to EO's.

  • ADF table and ADF form on the same view object

    Hi,
    As per the ADF demos available on ADF site, I created a jsf page with 2 panels. One panel is an ADF table based on a view object. And the other panel is and ADF form based on the same view object. My requirement is that as I scroll through the records in the ADF table, the ADF Form should dynamically display the details of the record in the ADF table. My understanding is that this should be automatic. However, its not working as expected. What have I missed?

    Hi,
    Apply PPR for form that displays details.
    Like :
    <af:table id="t3">
    </af:table>
    <af:panelFormLayout id="pfl2" partialTriggers="t3">
    </af:panelFormLayout >

  • How To change the ADF View Object  query where-clause at RunTime?

    I am trying to create a simple display page which will display user data (username, assoc_dist_id, assoc_agent_id, status , etc). The User data is stored in a database table and i am using an ADF Read Only table based on the View Object to display the data on the JSF page.
    However, i want to display only the users that a particular person accessing the page has the AUTH LEVEL to see. e.g. If the person accessing the page is an 'ApplicationAdministrator' then the page should display all users in the table, If its a 'DistributorAdministrator' then the page should display only users associated with that Distributor (i.e. assoc_dist_id = :p_Dist_id ) and If its an 'AgentAdministrator' , then the page should display only users associated with that Agent ( i.e. assoc_agent_id = :p_Agent_id).
    Currently my af:table component displays all the users in the table because the query for the view object is (select * from users) . However, i want to use the same viewobject and just set the where-clause at runtime with the appropriate parameter to restrict the dataset returned.
    Do anyone knows how to accomplish this ?

    David,
    See the custom method initializeDynamicVariableDefaults() in the SRViewObjectImpl.java class in the FrameworkExtentions project in the SRDemoSampleADFBC sample application. You can find out how to install the demo if you haven't already from the ADF Learning Center at:
    http://www.oracle.com/technology/products/adf/learnadf.html
    This class is a framework extension class for view objects that adds a neat, generic feature to be able to dynamic default the value of named bind variables. You can read more about what framework extension classes are and how to use them in Chapter 25, "Advanced Business Components Techniques" of the ADF Developer's Guide for Forms/4GL Developers, also available at the learning center above.
    It is an example of generic framework functionality that "kicks in" based on the presence of custom metadata properties on a named bind variable. See section 25.3.3 "Implementing Generic Functionality Driven by Custom Properties" in the dev guide for more details. Using this sample code, if you add a bind variable to a view object, and define a custom metadata property named "DynamicDefaultValue" on that bind variable, and set this custom metadata property to the value "CurrentUser", then that bind variable will have its value dynamically defaulted to the name of the authenticated user logged in. If instead you set this custom property to the value "UserRole", then the bind variable will be set to the comma-separated string containing the list of roles that the authenticated user is part of.
    Once you've created a framework extension class for view objects like this, you can have the view objects you create inherit this generic functionality.See section 25.1.4 "How to Base an ADF Component on a Framework Extension Class" in the dev guide for more info on this.
    By adapting a technique like this (or some idea similar that better suits your needs) you can have your view object query contain bind variables whose values automatically take on the defaults based on something in the user-session environment.

  • Passing an argument in the SQL Query of a View Object

    Hi,
    It is possible that this question has been asked before, however I have searched for a half an hour in the forums and couldn't find a solution.
    I am also new to using JDeveloper and ADF. Here's the situation:
    I am developing an application that doesn't have to do anything else then displaying data from a database. Pretty straightforward actually.
    Now I have made a vew pages with several collapsible panels (af:showDetailHeader) and have setup the datasources (or so I thought).
    All that remains is:
    - drag & drop a view object, from the application module that I created, onto the collabsible panels, so a child element gets created which displays data from the database.
    - hack the layout so it looks like I want it to.
    The problem that I have is the following:
    I am using a 'User'-class that contains values I need when quering the database.
    That User-object is part of a user-session.
    What I want, for example, is to use the 'getPersonId()' function of that User-object and pass the argument to a SQL-query of a certain view-object.
    The query would become something like:
    'SELECT * FROM people WHERE people.personId = :someNumber'.
    Now I've read some stuff about variable binding, which is complemented by something like (backing bean code):
    getDBTransaction().getRootApplicationModule().getACertainViewObject().setWhereClauseParameter(1, user.getPersonId());
    The examples I have found that might match my wishes are not using business components, but EJB's. I am having difficulty with understanding the 'how'-part of variable binding.
    Also, I do not know enough of ADF to be able to create a situation like:
    'User loads page, collapsible panel 1 is fully shown, the others are undisclosed.'
    (meaning, that for panel1 a query has been executed.)
    'User clicks on collapsible panel 2 which triggers a backingbean that somehow retrieves data from a view object'.
    I would appreciate any help that somebody can give.
    If it is not too much of a problem, please provide code snippets in case you have a solution. I am new to ADF :(.
    -edit
    I am using JDeveloper 10.1.3.3.0 in case that is of any importance.
    Message was edited by:
    Hugo Boog

    Hello Stijn,
    I didn't think about a referenced bean rule in the faces-config.
    I added it right away and I am now able to set parameters of a View-object, not using a page button and before the page loads. You made my day!
    In case anyone ever reads this post again, the summary of how to generate a table based on a View-object using dynamic parameters.:
    1a: Go to faces-config.xml -> Overview tab'
    1b: Go to the menuitem "Referenced Beans"
    1c: Click on 'new' and select the existing bean you want to access data from and input a name. In this example I use name="user"
    2: Create a View-object using the wizard.
    2a: Specify the query you want in the menuitem 'SQL Statement'.
    Add the 'parameters' you want to. You will have something like:
    "SELECT * FROM someTable WHERE table.columnname LIKE :someArgument".
    - hint: if you want the result to become something like:
    "SELECT * FROM someTable WHERE table.columnname LIKE '%someArgument%'" then you have to add the '%'-characters in your code itself (read: someClass.setParameter("%" + someArgument);).
    2b: In the menuitem 'Bind Variables' you have to add the variables you are referring to in the query. If you look at the query in 2a, then you have to add a variable with name "someArgument".
    2c: Add the View-object to a Application Module (create one if nessecairy).
    3a: Open a .jsp(x) file. Drag the View-object created in step 2 from the 'Data Controls'-pane to the page.
    3b: Click on the '+' of the View-object in the 'Data Controls'-pane and open 'Operations' and drag 'ExecuteWithParams' to your page as a button.
    3c: We do not want to use a button, the action has to be executed immediatly. So In the page source remove the lines that were created after dropping 'ExecuteWithParams'.
    3d: Right-click on the page and select "Go to Page Definition".
    3e: Go to the action id that is called 'ExecuteWithParams#', where # is a number.
    Change the id to something useful.
    3f: Change the NDValue so it corresponds with the value you want.
    Example:
    <action id="getAddressData" IterBinding="AddressesView1Iterator"
    InstanceName="MyHRServiceModuleDataControl.AddressView1"
    DataControl="MyHRServiceModuleDataControl" RequiresUpdateModel="true" Action="95">
    <NamedData NDName="someArgument" NDType="java.lang.String"
    NDValue="#{user.personId}"/>
    </action>
    Note: It is possible to use the value of a Backing Bean in NDValue.
    Note 2: user is the bean I referred to in the faces-config.xml!
    3g: Under the executables item, add an 'invokeAction' to pass the parameter to the View-object before your JSP-file loads:
    <executables>
    <invokeAction Binds="getAddressData"
    id="loadAddressDataOfPersonIdInSession"
    Refresh="prepareModel"/>
    Thank Stijn Haus for this :)

  • Adding and Calling custom method to the application module or view object

    My project uses jheadstart 10.1.2.
    I want to run "oracle reports" from my uix page. I have coded a method which takes "VOParameter view object" as a parameter to run report.
    I have generated the input page (parameter page) which based on VOParameter view object, by using jheadstart for using jheadstart lov, date etc. advantages. But I dont know how can I add custom method on application module or view object implementation class and custom button on uix page to call from uix page.
    THANKS for your help

    Yes, method binding has been added to the page UI model.
    I have find some clue that When I darg and drop metod as a submitButton, the code "
    <SubmitButton text="runReport" model="${bindings.runReport}" id="runReport0" event="action" />"
    is added to the uix page code. I change this code like this;
    <button text="runReport" model="${bindings.runReport}" id="runReport0" event="action" onClick="submitForm('dataForm',1,{'event':'action','source':'runReport0'});return false"/>
    by adding onClick method and changed submitButton to button tag..
    Then button action is triggered. But I can not pass to the design part of the uix page. It gives me the message like that "The document is not a valid state" But it works. I dont know why?

Maybe you are looking for

  • Firefox hangs -- no fixes work -- even if I uninstall it, it stays open in task manager!

    UPDATE 2: Disregard update 1: The problem's still there: If the computer goes into sleep or hibernate, Firefox hangs when I wake it up and the problem proceeds as described. I think it's something to do with Firefox sync and/or various add-ons. I sup

  • Year-month-week selection screen format?

    Hi experts, I will create sd report but I need selection screen that includes year-month-week, example; Year   :   2012 Month :  March    ( Listbox for all months ) Week :  1.week    I wıll execute report like that. This report program is going to be

  • Watermarking for Aperture's web gallery

    I really like Aperture's web gallery feature but would like to make use of the watermark feature for those images. That way, if images are 'borrowed' there is still a reference to my website. Any ideas on how this could be done? I'm guessing the only

  • Still no fix for two annoying Lightroom 5 bugs

    I'm very disappointed that Adobe still hasn't fixed two of the most annoying bugs in Lightroom 5.  The first is the issue with full screen mode.  Unpredictably, the screen will occasionally become trapped in full screen.  The only way I know to escap

  • ORacle 9i new features Instructor led course

    Does any one has 9i instructor led course lab material for forms 9i or 9i new features for developers I have the book but do not have the Lab that creates the table and all rows