Manipulating an attribute's LOV accessor's VO

Hi,
I'm using JDev 11.1.1.2.
I have a 'parent' VO that has an attribute I have set up an LOV/accessor for, to a 'child' vo.
And I have a page on which I've dropped the parent VO and the parent attribute is rendered correctly as a dropdown, with the child vo's values.
Now the business case is that the dropdown doesn't always show ALL the values from child vo. Depending on some combination of scenarios on the screen, there should be a restricted set of values in the dropdown.
For starters, I tried applying where clause to the child vo in 2 ways, and neither works (where clause never gets applied and I see all values in both cases). If I drop child VO directly on the page, the filtered version of the data is shown, but I cant get the dropdown which is tied to childvo through the parent VO's accessor to use that value.
1. Used application module method, and called this method in a method call before the page fragment that shows the dropdown.
                 ViewObject childvo = this.getChildVO1();
            childvo.setWhereClause("somewhereclause");
            childvo.executeQuery();
     2. Tried manipulating the list binding from the backing bean method that is tied to the dropdown.
              public RichSelectOneChoice getChild() {
     BindingContext bctx = BindingContext.getCurrent();
        BindingContainer bindings = bctx.getCurrentBindingsEntry();
        FacesCtrlListBinding lov = (FacesCtrlListBinding)bindings.get("Child");
        lov.getListIterBinding().getViewObject().setWhereClause("somewhereclause");
        lov.getListIterBinding().getViewObject().executeQuery();
        lov.getListIterBinding().executeQuery();
        return child;
     Anyone able to provide some guidance on this?
Thanks!
Kalp

Thanks Jobinesh, but found a simple way to fix my problem.
I just removed the accessor and attribute LOV from the parent VO, and left the child vo as an independent VO.
And then just used the following. So basically no accessor, no problem..
            ViewObject childvo = this.getChildVO1();
            childvo.setWhereClause("somewhereclause");
            childvo.executeQuery();
         <af:selectOneChoice value="#{bindings.ParentAttr.inputValue}"
                              label="Select a value"
                              required="true"
                              id="soc1">
                    <af:forEach var="row"
                                items="#{bindings.ChildVO1.rangeSet}">
                      <af:selectItem label="#{row.Description}"
                                     value="#{row.Id}" id="si1"/>
                    </af:forEach>
          </af:selectOneChoice>thanks
Kalp

Similar Messages

  • Show Display Attributes for LOV in af:query

    ADF 11g (11.1.1.3.0)
    Hi all,
    I'm using an af:query that uses an LOV for a PERSON_ID column, with an EMPLOYEE view as the View Accessor.
    Since the user experience may require the user to search for a particular employee, using either a "Combo Box with List of Values" or an "Input Text with List of Values" makes most sense, but those UI controls only display a the PERSON_ID when returning from the search pop-up. This is in contrast to using a Choice List, which would show, in addition to the original column (PERSON_ID), the selected Display Attributes (eg PersonID, FirstName, LastName).
    It is possible to show the additional Display Attributes when using the "Combo Box with List of Values" or "Input Text with List of Values" controls for an af:query, and if so, how?
    Thanks!

    Hi user,
    Take your base VO and create a transient attribute or an attribute derived from a reference entity as the display value (let's say "PerFirstName"). Then, create the list of values of employees on this attribute and set the return values "FirstName" > "PerFirstName" and "EmployeeId" > "PersonId". Define a view criteria to be used for your af:query component and add "PerFirstName" with '=' operator (this will render as a LOV).
    Let me know if it helps...
    Barbara

  • How to set the View instance and view  attribute to lov field ?

    Hi
    I created lov and textfield programatically.
    I want to set the viewattribute and view instance to that items(lovbean, texfieldbean).
    How to set programatically?
    Thanks in Advance
    Awadesh

    Hi
    Thanks. Its working fine. But now i got some another issue.
    after setting, i put simple system.out.println(Pagecontext.getparameter("idoflov"));
    But it returns null value.
    why. Actully i want to pass this value (according to my requirement).
    The view instance and view attribute are setting correctly. But after that i checked means it returns null value .
    plz let me know.
    Thanks

  • Multiple attributes in lov

    Hi, forum.
    I don't know where do I make a mistake.
    I tryed to make lov with multiple attributes how it is described in the
    JHeadstart Developer's guide.
    But when I type several attribute names, separated by comma
    in Lookup Display Attribute property and run JAG I receive the following error:
    Attribute ..., ... does not exist in VO.
    Help, please!!!

    Check your Jhs version. This feature (multiple LOV attributes) is only available in 10.1.2.1 version.
    Eduardo

  • Customize display attributes for LOV

    Hi all,
    In normally, when create List of values for attributes :
    After we selected List Attribute, next UI hints tab we select Available display attribute, for example: I select two attributes : CountryID and ProvinceName --> that's means multiple values are separated by white space like this: 1 England....The question is how can customize to: 1.England
    i want replace "." instance of "space". Thanks

    The trick is that you add a calculated attribute to the sql like
    select country_id, country_name, country_id || ' ' || country_name as LOV from countries
    COUNTRY_ID COUNTRY_NAME                             LOV                                      
    AR         Argentina                                AR Argentina                               
    AU         Australia                                AU Australia                               
    BE         Belgium                                  BE Belgium                                 
    BR         Brazil                                   BR Brazil      
    then in you use the country_id to store the selected value and hte LOV column to display the options on the ui.
    Timo

  • Capture an advaced table attribute in lov fire action

    Hi Gurus,
    I have one advanced table in the custom page. There is one lov field in the table. My requirement is, I need to pass a session (one attribute from the advanced table) value when the lov is pressed or tabed out. How to achieve this in the lov fire action.
    Waiting for needful solution for this requirement.
    Regards,
    Tarun

    Attach a PPR to the LOV field, capture the LOV event in PFR of CO and get the row reference (if needed). You should be able to create session value or pageparameters etc once you capture the event. Search for older threads on similar topic.
    Thanks
    Shree

  • To Set LOV to a transient Attribute??

    Hi,,
    Is it possible to set LOV To a transient Attribute?
    Also How we handle LOV programmatically???
    By NZL

    Is it possible to set LOV To a transient Attribute? you answer goes here,
    http://andrejusb.blogspot.com/2009/11/defining-lov-on-reference-attribute-in.html
    http://dstas.blogspot.com/2011/12/create-description-attribute-of-lov.html
    http://docs.oracle.com/cd/E21764_01/web.1111/b31974/bcquerying.htm#CHDHJHBI
    http://docs.oracle.com/cd/E15523_01/web.1111/b31973/af_lov.htm
    for programatic lov
    Create and setup LOV programmatically
    Edited by: ADF 7 on Jan 9, 2012 5:41 AM

  • Validation error message is not displayed for an attribute as an Input List Of Value

    Hi everyone,
    I use jdev 11.1.1.7.0
    In my application I've created an Entity Obj and a View Obj base Employees table.
    for the JobId attribute I've taken actions as listed below:
    1. in Employees EO I've created a validation for this attribute and in some cases an error message returns (the error message is "the salary is not high"):
         * Validation method for JobId.
        public boolean validateJobId(String jobid) {
            if (...) {
                return false;
            if (...) {
                return false;
            if (...) {
                return false;
            return true;
    2. in Employees VO  I've created a LOV for this attribute (the view accessor is JobsViewObj ) and I display the attribute as an Input Text with List Of Values.
    in jspx page I drag& drop this attribute as below:
              <af:inputListOfValues id="jobIdId"
                                    popupTitle="Search and Select: #{bindings.JobId.hints.label}"
                                    value="#{bindings.JobId.inputValue}"
                                    label="#{bindings.JobId.hints.label}"
                                    model="#{bindings.JobId.listOfValuesModel}"
                                    required="#{bindings.JobId.hints.mandatory}"
                                    columns="#{bindings.JobId.hints.displayWidth}"
                                    shortDesc="#{bindings.JobId.hints.tooltip}"
                                    autoSubmit="true">
                <f:validator binding="#{bindings.JobId.validator}"/>
              </af:inputListOfValues>
    I open the Popup and I select a row from the Popup list and then I click Ok. After that if the validation method(validateJobId) returns false, the error message("the salary is not high") must be show to the user. but the error message doesn't display. I don't understand why this happens.
    Can anybody guide me about this problem?
    Regards
    Habib

    yes, you're right, I've tested it in 12.1.3 and error message was displayed.
    it seems it's a bug(bad bug ) in both 11.1.1.7 and 12.1.2. and now what can I do? is there any way to display the the error message?
    Regards
    Habib

  • LOV's auto refresh and having unique values.

    Hi, I'm having LOVs connected with few attributes of a table, and those fields are used in view criteria of the table.
    This view criteria is used in the af:query component as search fields.
    To avoid the duplicates in the LOV, i created a separate view for each of the attribute, using the distinct key , and connected them with the attribute via view accessors. So that the af:query component , search field drop downs can give unique value of the column.
    There is an another requirement, to refresh the LOVs of the search field, when there is a change in the database. To accomplish this auto refresh property of the view's query, i added the PK of the table with each view. By doing this i can see the latest values of the database in the UI . ie, the LOVs of af:query getting the changes of database.
    But this one causing, the duplicate values to be in LOV, and the distinct key word in the view's query will not work because of the PK of table is added to query.
    I tried different ways to query , like groupby . But no success.
    I need both auto refresh as well as unique values in the LOVs of the af:query . Could some one point me a reference to solve this. Thanks .
    Edited by: user642477 on Oct 7, 2010 10:52 AM

    user642477 wrote:
    Hi, I'm having LOVs connected with few attributes of a table, and those fields are used in view criteria of the table.
    This view criteria is used in the af:query component as search fields.
    To avoid the duplicates in the LOV, i created a separate view for each of the attribute, using the distinct key , and connected them with the attribute via view accessors. So that the af:query component , search field drop downs can give unique value of the column.
    why you have done that what is your reason?!!! it seems so wierd to me? you could easily add distinct on query of the viewobject!

  • ADF View Accessor Validation with Bind Variable

    Hi
    I need to solve the following requirement using a view accessors and bind variables;
    1. User can select a value for a attribute from LOV which is unfiltered.
    2. User can manually edit code into the same attribute as in 1 above, which needs to be validated.
    As the data set for the attribute is large, I need to be able to validate 2 using a query with a where clause.
    My approach has been;
    1. I have a view object for the source lookup table, ProductVO.
    2. I have created a view criteria on ProductVO that accepts a bind variable, pProductCode.
    3. On my OrderEO I have a attribute, productCode.
    4. I create a new view accesor on the OrderEO using the view criteria created in point 2.
    5. I have lft the bind variable parameter blank, as I need to be able to dynamically pass a product code at run time.
    6. On my OrderVO for the productCode attribute, I have create a LOV, based on the ProductVO. This will ensure that the user can view and search all products if needed.
    What I am not getting working;
    1. How can I pass the attribute value to the view accessor at runtime when the value is manually captured.
    2. Ensure that if a value is selected from the LOV, that the view accessor validation does not get invoked.
    What I have tried to solve point 1;
    1. I created a validator on the productCode attribute on the OrderEO as a list validator using the view accessor as my list. I am not sure how to get the bind variable populated. Leaving out the bind variable, I assume, would cause the value to be validated against all my products.
    2. I then tried using a method validator and passing in the productCode value and querying the view accessor.
    3. I have not yet tried using Key Exists, is this maybe the missing link/trick?
    All help will be considered a early christmas gift!!

    Hi
    I have found that when using validation type Key Exists and the VO is in the local application, then the bind variable is available in the Create Validation wizard. When I try and create a validator on a VO that is core to all my applications, then I put that VO into an ADF library, the bind variable parameter is not available for mapping to my entity object attribute, even though I can select the VO to create a view accessor from the ADF library.
    Possible bug?

  • LOV with different query values

    Hi,
    I am using JDeveloepr 11.1.1.1.4 and ADF-BC in my project.
    In my project,in one of the pages,I need to open a popup on click of button[near an input box] and show an LOV in the popup.
    On selection of the value in the LOV and some business logic,the value has to be set to the input box in the calling page.
    I have 10 input fields in my page,with 10 buttons besides them and I have to open the same popup and same kind of business logic needs to be implemented to return and set the values
    in the calling page except that the query to display the LOV values is different each time.
    Basically same popup page needs to be displayed every time,but the query to display the values for LOV is different every time.
    If LOV is built through read only view object,then I cannot the change query :(
    Please advice on how to achieve this.
    Thanks,
    Praveen

    Assume the following sample as per your use-case.
    Departments VO is to shown as a LOV for ten different attributes in Employees VO, but the set of departments to be shown are different for each LOV/attribute.
    For each of the attributes in Employees VO, while defining the LOV, create separate view accessor for each of the attributes. In your case, as each of the LOV are totally distinct, you might need 10 different accessors for each of the attributes defined as a LOV in Employees VO.
    For applying view criteria, you could apply different view criteria for different view accessors created as follows:
    As for example, for attribute1 in employees VO, you would like to show only departments starting with 'A'. In this case, define a view criteria in Departments VO as DeptWithStartingA.
    Now in the Employees VO, for attribute1, select the view accessors created by moving to the view accessor tab & shuttle the VC to be executed.
    Similarly do for all other attributes.
    Why can't we use single view accessor for all the attributes? - you cannot because while you select a value for one attribute defined as LOV in employeesVO, the corresponding row is set as selected. But when you choose the other attribute using LOV, all other previous selections would point to the same.
    Thanks,
    Navaneeth

  • Cascaded LOV loose value when pooling disabled

    Hi All,
    I am using jdev 11.1.1.5
    my scenario is i have search VO with transient attributes.Most of attribute are LOV using accessor.
    Few of LOV are dependent on each other. When i am running by enabling pooling true.it is working fine.
    But when pooling disabled, cascaded LOV are not persisting value in the VO. It is happening only for dependent LOVs . I am not sure  why is it so.?
    I am creating a new row of Search VO usng Create Method of VO operation.Should i try anything else?
    Is anyone faces this issue earlier?  any suggestion to handle this. All attribute are passivated and VO have key attribute.
    Please suggest?

    Hi Frank,
    Well all LOV are transient attribute.Problem is this - Everything working with AMPooling enbaled.But when AMPool disabled then only attribute whose value are depend on other LOV are not persist or loose.
    Yes they are marked passivate. and i also override afterRollback and beforeRollback in all ViewObjectImpl.java with commenting super call.
    Seems , variable are setting by bind variable are not passivated the value. I am not sure, is it some strange behavior or i am doing anything wrong.
    What you suggest  to investigate further more on this?
    Regards
    Vinay

  • ADF Issue - LOV based on parameter not appearing

    Hi All,
    I am getting error as “AttibuteManagerID required” in my page
    Technical Description:
    Application Module: EOMUIModelAMImpl.java
    View Object:
    View1: EOMVO
    View2: NameOfNomineeVO - has a criteria Requestor_PersonId =: ManagerId(View criteria have a validation of type 'required' for attribute Requestor_PersonId )
    In View1 one of the attribute is NomineePersonId(Long) is an LOV which uses View2. View2 has a criteria with bind variable requestorPersonId(Long) =:ManagerId(Long), which we are setting using the criteria in EOMUIModelAMImpl.java file:
    These are the 2 methods used to set criteria in EOMUIModelAMImpl.java class.
    Method setManagerIdUsingCriteria will set ManagerId to display subordinates of Manager.
    public Long setRequestorPersonId(){
            Long requestorPersonId = 0L;
            try{
    EmployeeOfTheMonthRequestModelAMImpl employeeOfTheMonthRequestModelAM = (EmployeeOfTheMonthRequestModelAMImpl)getEmployeeOfTheMonthRequestModelAM();
    ViewObjectImpl employeeOfTheMonthVO = getEmployeeOfTheMonth();
    System.out.println("----- Before Calling fetchRequestorPersonId in EmployeeOfTheMonthRequestUIModelAMImpl-----");   
                requestorPersonId = employeeOfTheMonthRequestModelAM.fetchRequestorPersonId().longValue();
    System.out.println("--After Calling fetchRequestorPersonId in EmployeeOfTheMonthRequestUIModelAMImpl--"+requestorPersonId);
    employeeOfTheMonthVO.setApplyViewCriteriaName("EmployeeOfTheMonthVOCriteria");
    employeeOfTheMonthVO.setNamedWhereClauseParam("requestorPersonId", requestorPersonId);
    System.out.println("--End of setRequestorPersonId in EmployeeOfTheMonthRequestUIModelAMImpl--"); 
                } catch (Exception e) {
    e.printStackTrace();
    return requestorPersonId;
    * This method is used to set the value for bind variable ManagerId
    public void setManagerIdUsingCriteria(){
    Long requestorPersonId = 0L;
                EmployeeOfTheMonthRequestModelAMImpl employeeOfTheMonthRequestModelAM = (EmployeeOfTheMonthRequestModelAMImpl)getEmployeeOfTheMonthRequestModelAM();
    requestorPersonId = employeeOfTheMonthRequestModelAM.fetchRequestorPersonId().longValue();
    System.out.println("--After Calling fetchRequestorPersonId from setManagerIdUsingCriteria--"+requestorPersonId);
    ViewObjectImpl fetchManagerId = getNameOfNominee();
    fetchManagerId.setApplyViewCriteriaName("NameOfNomineeVOCriteria");
    // requestorPersonId =300000001130413L;
    fetchManagerId.setNamedWhereClauseParam("Requestor_PersonId", requestorPersonId);
    fetchManagerId.executeQuery();
    System.out.println("--End of setManagerId in EmployeeOfTheMonthRequestUIModelAMImpl----");
    Method setManagerIdUsingCriteria() is able to fetch  ‘requestorPersonId’ value but it is not able to set the criteria after query execution.
    Please share your ideas.
    Thanks

    Issue is resolved after mapping bind parameter variable to the db attribute in view accessor.

  • ADF Table: LOV Iterator Issue

    I have an editable ADF Table, with a column that contains an LOV (Select One Choice). This LOV gets it's data from another View Object. We have an LOV Maintenance screen that populates the LOV's View Object with data.
    My problem is when you insert new data into the LOV's View Object, then go to the Editable ADF Table which contains the LOV Column, the new LOV Data does not show up in the Select One Choice. However, if I open up a new browser window and open the application, I see the new LOV data. Also the new LOV Data shows in the database. This is telling me the LOV's iterator is not updating properly.
    However, since i have an ADF Table, the LOV along with all other columns are bunched into a Tree Binding and respectively the ADF Table's Iterator (In the page bindings). Thus I don't know how i can directly access the LOV's iterator and refresh it.
    How do I refresh the LOV iterator?
    Currently we're on ADF 11.1.1.3.

    Another Edit:
    Okay I got this workaround functioning properly... It was a combination of settings that need to occur. I'm not crazy about it because it seems inefficient -  but it works.
    1.) I exposed the View Row Imp Class of my ADF Edit Table View Object (and Included Accessors). Included Accessors so I had programatic access to my LOV's View Accessors. I had two Accesors so i could have a switching LOV on my LOV Attribute.
    2.) Then in the RowImpl class, I went to the LOV Accessor getter methods, i did this below, so we refresh the View Accessor.
         * Gets the view accessor <code>RowSet</code> ActiveSmsModules.
        public RowSet getActiveSmsModules() {
          RowSet rs = (RowSet)getAttributeInternal(ACTIVESMSMODULES);
          rs.executeQuery();
          return rs;
            //return (RowSet)getAttributeInternal(ACTIVESMSMODULES);
         * Gets the view accessor <code>RowSet</code> AllSmsModules.
        public RowSet getAllSmsModules() {
          RowSet rs = (RowSet)getAttributeInternal(ALLSMSMODULES);
          rs.executeQuery();
          return rs;
            //return (RowSet)getAttributeInternal(ALLSMSMODULES);
    3.): After that, I had to go to my ADF Edit Table's Iterator (In the bindings), set Refresh to Always. I'm not sure why but it didnt work without this setting.
    4.) Then in my ADF Page Backing Bean, which holds the ADF Editable Table, i had to run this code once when the ADF Table gets rendered. Basically, re-execute the ADF Edit Table's iterator query. Then refresh the LOV UI Component. The LOV object was bound with a getter and setter in my backing bean.
            BindingContainer bindings = getBindings();
            DCIteratorBinding iterator = (DCIteratorBinding)bindings.get("UnvPracSmtView1Iterator");
            iterator.executeQuery();
            AdfFacesContext.getCurrentInstance().addPartialTarget(getSmtSmsCode());
    It would be easier to be able to simply access the LOV's iterator through the ADF Table's Tree Bindings, but there doesn't seem to be a straight forward way to do this. If anyone has any other solution to this, please let me know!

  • CreateInsert and LOV with multiple return values

    HI. I am on Build JDEVADF_11.1.2.3.0_GENERIC_120914.0223.6276.1
    I have a View Object which is based on Entity Object.
    View Object has customer_name and customer_id attributes.
    customer_name attribute has LOV (input field with LOV) based on some other View Object (which of caurse holds customer name and customer id data)
    I defined that when LOV return the chosen values it will populate customer_name with "Customer Name" value and customer_id with "Customer Id" value
    All atributes are updatable
    I droped my View Object on the page and also "CreateInsert" buton. When I click on "CreateInsert" button, I can see new row added as expected, customer_name field has LOV. I can choose from LOV and can see customers and customer_id data. But when I click OK in the LOV pop-up only customer_name attribute is populated!
    I do see that customer_id is returned from LOV (I implemented ReturnPopupEvent listener), but still the customer id remains empty.
    I though maybe I need to add LOV as auto submit = true and set LOV to be a partial trigger for customer_id. But still  - it didn't help
    However, if I run Application Module tester, I do get what I want. I can create new row and when I change customer name , both customer name and customer id fields are populated
    Please advice

    Hi Michael,
    On Lov VO, make sure you have at least one or combination of attributes as Key attribute. and re test.
    Thanks,
    Jeet

Maybe you are looking for

  • Green vertical line at startup

    Has anyone experienced this before? 2009 iMac, happened at startup and will not bootup.

  • Suppressing 'Further Selections' in PNP LDB

    Hi All, Can you please tell me how I can disable the 'Further Selections' button in the PNP logical database? I am unable to find anything suitable in the report category which can disable this feature. Thanks and Regards, Vidya.

  • Very Slow Scrolling with Images

    I'm running Framemaker 11 on a Windows 7, 64-bit machine with an i7 processor at 2+ ghz and 8.0 MB RAM. My Frame files, with imported/referenced images, are scrolling extremely slowly. When I say slow, I mean as the page scrolls into view it freezes

  • [SOLVED] Unable to start vmware 9 after update

    Hello Folks, I got one weird issue after update, I tried to start vmware, failed as nothing happeded, no error message shown. Do you have any clues ? ┌─[root@tp]─[/tmp]─[0+4]─[99%=] └─# uname -a Linux tp 3.6.11-1-ARCH #1 SMP PREEMPT Tue Dec 18 08:57:

  • Power Point Generation

    Hi all, Can you help me.I am trying to generate PPT using java.Can you tell me an API for doing this. Thanks