Retrieve Value Upon Populating An LOV Based Field

Hello.
I have a really urgent need. I'm developing an Apex 2.2.1 application in which I have a parent-child set of LOV fields: P1_STATES (Parent field populated via a dynamic LOV) and a P1_CITIES field (populated by a dynamic LOV which uses the value from
the States field).
I have a P1_CITY_DESCRIPTION field that needs to get populated automatically with the description of the city that fills my P!_CITY field.
The problem is that P1_CITY_DESCRIPTION never gets filled until the page submits.
How can I get P1_CITY_DESCRIPTION to auto populate with the description of the city name that gets placed into field P1_CITY?
I know of no way to automatically submit the page unless the user manually clicks a GO button. Even placing something like "onchange="htmldb_item_change(this)"
does nothing.
Anyone ... Please Help!
Thank you.
Elie

Hello,
TEMPORARY_ITEM is really an Application Level item........On Demand Process I calledON_DEMAND1.
Sorry if that wasn't apparent
It sounds like your halfway there, you should follow this one instead it's a bit easier to start out.
http://htmldb.oracle.com/pls/otn/f?p=11933:11
Copy that example like you did the other one but
where it has this P11_TEXT_DROP put this P1_CITY_DESCRIPTION.
and where it has this P11_TEST put P1_CITY
Was not sure how your your javascript fucntion is even called and from where?Just create a test button if you copy the example on the newer link I gave you.
<input type="button" value="Test" class="t200Button" style="border: 1px solid black;" onclick="f_TestOnDemand()"/>Also there is a more detailed explanation of how some of the AJAX stuff works here http://apex.oracle.com/pls/otn/f?p=11933:63
Regards,
Carl
blog : http://carlback.blogspot.com/
apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5

Similar Messages

  • LOV return value to submit multi LOV/Text field order by value!

    I have nested LOV and return value reflected to another LOV/Text field by order wise.
    My problem,
    The return value LOV or Text field should be dispay with one by one values order by (Dynamic).here i using the query in each LOV source.
      select DMS_DD_ENG_DESC dis, DMS_DD_ID ret from DMS_DEPT_DETAILS
    where DMS_DD_DT_REF_ID=:P3_DETAILS
    Workspace          :RAM_R&D
    User Name/Password :aramani/apex
    App                http://apex.oracle.com/pls/apex/f?p=36167:3I should do the dynamic action for this case?
    anyone can help me plz.
    Thanx,
    Ram

    Hi Ram,
    I changed your application and i think it is working the way you want.
    I don't know if it exactly what you need but take a look and let me know.
    Regards,
    Kees Vlek
    <tt>Company: http://www.orcado.nl
    Blog: http://www.orcado.nl/blog/blogger/listings/69-kvlek
    Twitter: http://www.twitter.com/skier66</tt>
    If the question is answered please change it to answered and mark the appropriate post as correct/helpfull.

  • ADF BC selectOneChoice- populating an LOV based on another LOV

    scenario:
    country:country_id, country_nme ViewObj: CityVO
    city: city_id, country_id, country_nme ViewObj:CountryVO
    cc: cc_id, country_id(FK), city_id(FK) ViewObj:CCVO
    i have got two combo boxes(selectOneChoice) displaying
    coutntry LOV which i created by selecting
    base data source:CCVO, list datasource:countryVO
    mapped attribute:country_id, display attrib:country_nme
    similarly,city LOV which i created by selecting
    base data source:CCVO, list datasource:cityVO
    mapped attribute:city_id, display attrib:city_nme
    objective:
    now i need to populate the city LOV based on the country selected.
    i added valueChangeListener on countryLOV so that it will get the country_id and execute view criteria on cityVO
    problem:
    problem is that i can not get country_id value! i explored methods on the selectOneChoice variable accessor and ValueChangeListerner component but no luck!
    as i am displaying the country_nme so i have to use DCIteratorBinding to actually reach to the country_id value.
    this seems to be a tedious way! plus if country selected again it gives nullPointerException on 3rd line:
    DCBindingContainer dcBc = (DCBindingContainer)getBindings();       
    DCIteratorBinding  iter = dcBc.findIteratorBinding("CountryVO1Iterator");    
    Row row = iter.getRowAtRangeIndex(vce.getNewValue().toString()); //[error-prone] first time returns the database row of the selected country record.gives exception on 2nd time
    Q1. is there any direct way of getting country_id, based on the display name?
    Q2. is there any way to refresh the iterator? iter.release(), iter.clear() did not help
    Regards,
    Rabs

    Hi
    This is not possible in Discoverer 4i. The concept of Cacading lists of values was only introduced in Discoverer 10g R2 (10.1.2).
    Now there's a good reason to upgrade :-)
    Best wishes
    Michael

  • How to bind value to lov based on the output from other lov

    HI all, i have 2 message choice Lov, i am selected a value from the 1st lov based on this value i am a executing a query, i want to display one of the attribute value from the query result in the second LOV. i am getting the attribute value correctly but i dont know how to bind that(display) in the 2nd LOV(at runtime).

    Read the dev guide LOV section, it should give you details about this implementation.

  • Based on select list, i need to retrieve values in other select list

    Hi,
    am new to apex using apex3.2, i need to retrieve values in select list based on the other select list vale with out refreshing page.
    ie i have region select list and country select list,in country corresponding region country must be display but with out refreshing page.
    can you please any body guide me.
    Regards
    shashidhar
    Edited by: 871140 on Jul 7, 2011 10:34 PM

    Hi,
    you can use cascading LOV for that, i which the other LOV field will be changing depending upon the selection of other value(which is in LOV).
    http://www.inside-oracle-apex.com/oracle-apex-4-0-cascading-lovsselect-lists/
    Regards,
    Mini
    Mark Answers Promptly

  • How to change the values in an LOV based on values selected in another LOV

    Hi,
    I have a requirement in ADF where there are two LOVs. Based on the values that I select in the 1st LOV, the values in the second LOV should change dynamically.
    Also, the 1st LOV accepts 3 values, for every value I select, a different query is executed to populate the 2nd LOV.
    I have a rough thought that I can use 3 different read only view objects containing these 3 queries. And based on the value I select in the 1st LOV I can execute the corresponding View object from the backing bean. But my doubt is how to link the results of that query that is executed to populate the 2nd LOV.
    Thanks in advance.
    Edited by: 886591 on Sep 21, 2011 4:48 AM

    Hi Brisk,
    Thanks for your reply.
    The link that you have provided explains how to disable and enable the other LOVs based on a parent LOV. But in my case there are two Select One Choice fields i.e. the dropdowns (sorry that I addressed it as LOV in my previous post which might be confusing). There are 3 static values in the parent dropdown where each of them are associated with a different query. for e.g if the three values in the drop down are A, B and C; if i select A, then query associated to A should be executed ; if i select B, then query associated to B should be executed and if I select C, query associated to C should be executed. Then the output attribute of that query should be populated in the child dropdown.
    Please let me know about the solutions to this.
    Thanks,
    Kavitha

  • Radio LOV not showing the retrieved value

    I have a radio button with 3 options: STATIC2:One;1,Two;2,Three;3
    On "load after header", I run a retrieve that populates all the fields on the screen, including this field. The session state has this correct value but the radio button that matches the value does not get "selected". (So the session state value is 3, but no radio is marked.)
    I changed it to a select list and chose option TWO. After I save, the DB gets the correct value, and when I reload the page, the session state also has the value 2, but the select list still shows ONE
    How do I make the correct radio button/select list item get marked when the data is loaded? I've tried every combination of Source that I can think of (always load, only load when null, static assignment, DB column, etc... nothing works).
    If I change it to a text field, it does show the right value from the DB.
    (APEX 3.1.1 Oracle 10g)

    It still doesn't work with those settings. In debug, it shows that the "value" is 2 but the select list will only show the first item in the list (in this case it's 1). I can't think why this would be occurring, is there some other setting that one can change to make select lists show properly (no select lists in tabular forms will show properly either, but I figured that was related to the tabular form, not to the select list)
    ETA: I think it might have something to do with the column originally being a char, instead of a number. I changed the column datatype and made a dynamic lov based on this and it works now.
    Edited by: mimi_jones on Apr 5, 2010 5:37 AM

  • Text fields populated from lov mapping are not saved to database

    Hi Everyone,
    I'm having a wierd problem. My requirement is to autopopulate two text fields field 2 and field 3 when a value is selected from lov in field1 and save all the values to database on click of a submit button.
    Using lov mapping i'm able to populate field 2 and field 3 with corresponding values based on the value selected in field1. And also field2 and field3 should be in the readonly mode so that user cannot change the value.
    So to make the fields readonly i have changed the property of readonly to true for field2 and field3. But if I change the readonly property, the values for field2 and field3 are not being saved to database.
    The values are getting saved to database only when readonly = true for messageTextInput item type or if the item type is a form value.
    I also tried disable = true, which also didnt work.
    I tried to debug by writing some sop statements in PFR, but these statements also returned null for pageContext.getParameter("field2") etc;
    Can anyone please tell me how to solve this problem?
    Thanks
    Sunny

    Hi Gyan,
    I forgot to mention that , I also tried messageStyledText. Which also didn't work. I wanted to use vo.setAttribute as my last option, but i wanted to understand why the values are not saved to database when the text item is showing the values on the page.
    Thanks
    Sunny

  • SQL to get a LOV based on a value range (zips based on zipcode range)

    I have a requirement to capture state,county,city and zipcode values based on AR Tax tables. I created an DFF with Input field for State, County and City and corresponding LOVs based on the tax tables. I am not sure how to proceed with zipcode (I am not a FORMS expert, that further makes it complicated :) )
    For those who are aware of the tax tables - AR_LOCATION_VALUES and AR_LOCATION_RATES, there are no list of zipcode values. zipcodes are maintained at the city record level as a range FROM_ZIP_CODE and TO_ZIP_CODE. So a CITY record for GA.FULTON.ATLANTA has a from_zip of 30301 and to_zip of 30321-9999. I am not worried of the ( +4 ) values, all I care is the 5 digit zip and zip will increment by 1. For this scenario I want to show each zip code as a value in my LOV..so I want to show 30301, 30302, 30303....30320, 30321. Is there a SQL to generate such LOV based on range?
    Any SQL experts out there with ideas?
    Thx, Suresh

    William Robertson wrote:
    Nice, but I think he wants the zip range as 30301 - 30321, discarding the '-9999' (apparently known over there as the '+4' component of the zipcode).Thanks William, i missed out on that detail (though it makes a heck of a lot more sense than generating a LOV with 60,000+ elements :) )
    TUBBY_TUBBZ?
    with
       parsed_data as
       select
          lower_bound,
          substr(range_string, 1, instr(range_string, '-') - 1) as high_bound
       from
          select
             30301          as lower_bound,
             '30321-99999'  as range_string
          from dual
    select
       lower_bound + level - 1
    from
       parsed_data
    connect by level <= high_bound - lower_bound + 1;
    LOWER_BOUND+LEVEL-1
                  30301
                  30302
                  30303
                  30304
                  30305
                  30306
                  30307
                  30308
                  30309
                  30310
                  30311
                  30312
                  30313
                  30314
                  30315
                  30316
                  30317
                  30318
                  30319
                  30320
                  30321
    21 rows selected.
    Elapsed: 00:00:00.01Would be the proper approach based on having a lower bound and having to parse the upper bound from a range string.
    William Robertson wrote:
    Now if I had a clue how to use MODEL...You're not alone in that boat :)

  • OO ABAP having problems retrieving value from screen dropBox field

    Hi,
    I am a new in ABAP, and need some advice.
    I have a class and in its definition I  have class-data: dropBox (same name as in screen) field from the screen. When I create a instance of a class and fill with data dropBox. data is populated properly using F4IF_INT_TABLE_VALUE_REQUEST method. But I can not retrieve the selected value. In screen dropBox field 'conversion exit' is set to ALPHA.
    Tried to do it without a class it works, and I can get data.
    Question is, can I do it using a class the way I explaining at the beginning of discussion.
    Am I missing something?
    Thanks,
    Aivaras

    It is not possible to have screen field attribute and use it. Solved my problem of returning value by increasing the value of Defined length on screen field.

  • Restrict the list of values retrieved by a model driven LOV

    hi all
    i'm try to restrict the list of values retrieved by a model driven LOV just like the article in this link
    http://www.oracle.com/technology/products/jdev/tips/fnimphius/restrictlovlist/restrictlov.html
    and i'm using the jdev11.2 but i always get this error
    java.sql.SQLException: parameter IN or OUT is missing at index 1
    my code is :
    public void SetSchoolLovVar(LaunchPopupEvent launchPopupEvent)
    String var_val=getOt7().getValue().toString();
    System.out.println("++++++++++++++++++++++++++++++++"+var_val);
    BindingContext bctx = BindingContext.getCurrent();
    BindingContainer bindings = bctx.getCurrentBindingsEntry();
    FacesCtrlLOVBinding lov = (FacesCtrlLOVBinding)bindings.get("DeptCode");
    System.out.print("LOVE "+lov);
    System.out.println("+_+_+_+_+__+_+_+__+_+_+_+_+_+_+_+_+_+_________+++++_+_+_"+lov.getName());
    lov.getListIterBinding().getViewObject().setNamedWhereClauseParam("Rejon_For_Prj_Dept",var_val);
    Rejon_For_Prj_Dept is the bind variable of the Lov Query.
    any good idea

    Hi,
    The error might be due to making the bind variable as required but not using it in the vo query. Edit the bind variable and make it as optional by unchecking the required checkbox.
    Sireesha

  • Not able to find values in LOV of field "Help Desk" of Global contract

    Not able to find values in LOV of field "Help Desk" of Global contract defaults.
    This value should be coming from resource setup.
    Resource is already created.

    Issue resolved:
    The resource should ahve valid Email id in HR People setup

  • List of values (LOV) based on PL/SQL

    Is it possible to create a LOV based on PL/SQL ?
    I want to do this because I have at least 5 LOV based on the same query (when you are using bind variables).
    This is the normal query (ex.: LOV_FREQ_CODES) :
    SELECT c.code ||' - '|| c.description AS display,
    c.code AS return
    FROM codes c,
    code_types ct
    WHERE c.code_type = ct.id
    AND ct.code_type_description = 'Frequency' (should be a Bind Variable)
    Thx

    Look into "Pipelined Table Functions" (http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/x/Table_Functions_Cursor_Expressions/Pipelined_Table_Functions.htm)
    Basically you have your codes tables and a function (get_code). The function is passed a parameter (bind variable). The function then fires a query using the parameter value to render rows which are "pipelined" are a return value of the function. So you LOV query would look like:
    SELECT c.code ||' - '|| c.description AS display,
    c.code AS return
    FROM codes c, TABLE(get_code('Frequency')) ct
    WHERE c.code_type = ct.idMike

  • Display value instead of key in input field with LOV?

    Sorry, this is so basic I'm sure it must be easy but somehow I can't find it in the documentation. The LOCATION table contains a foreign key referencing the CLIMATE table. As well as its primary key, CLIMATE has a column called NAME holding the name of the climate (e.g. temperate, tropical, etc.). The user must be able to update the climate value for the location he is working on. So I have a list of values which looks up possible climate names, the user selects the name he wants and the value gets set in the LOCATION table. That works, but the problem is that the input item displays the key value of the CLIMATE record, and I need it to display the value of NAME instead. Of course I can have another field showing the name, but that is messy, the user doesn't understand the key value and shouldn't have to see it. So how do I make one input field display the NAME, while actually updating the key value from the LOV choice?
    Thanks

    Thank you, Joseba. It does help to some extent. Now I have a non-updatable field with the climate name in it, and below that is the magnifying-glass icon that invokes the list of values. I guess that's not bad, and I can put a label next to the magnifying class saying "Click to select climate". So it's better, but still looks very odd compared to updating fields that are in the LOCATION table itself, where it's an updatable field and the maginfying glass is right next to it. Really the user should not have to behave differently just because the database chooses to hold the value that he wants to alter as a reference to another table.
    Is there at least a way to put the list of values magnifying-glass next to the field that displays teh value, rather than underneath it? They are all inside a thing called "af:panelFormLayout", and I tried setting MaxColumns to 2 in its properties, but it still won't let me move the list-of-values field alongside the other one.
    Thanks.

  • Populating a reqd. selection field based  on other selection field-Reports?

    Hi,
    I have a selection screen wherein there are several fields which are mandatory.Now it has fields like customer Number(KNA1-KUNNR) for which there is a standard help coming in and customer name(KNA1-NAME1).
    My requirement is as soon as user selects a customer no along with customer no customer name field is also populated without performing any action on screen.Now if I write the code as:-
    at selection-screen on p_name1.
    select single name1 into p_name1
                                  from kna1
                                  where kunnr = p_kunnr.
    There are few problems in this:-
    1)It will be executed only when user presses enter or F8 but I dont want that...
    2)Also if I perform any action on screen say pressed enter this code will be executed only when i have put in values in all the MANDATORY fields.So will have to put in a dummy value first since its a mandatory field and then this code will be executed which doesn't serve my purpose..
    Please suggest a way out..Its really urgent..Have to make an object delivery
    Thanks in advance,
    Swati

    Try  this example, this will also automatically update the NAME1 field when user does F4 help on the customer number.
    data: dynfields type table of dynpread with header line.
    data: return type table of ddshretval with header line.
    parameters: p_kunnr type kna1-kunnr,
                p_name1 type kna1-name1,
                p_kdgrp type knvv-kdgrp.
    at selection-screen.
      if not p_kunnr is initial.
        select single name1 into p_name1 from kna1
                  where kunnr = p_kunnr.
      endif.
    * Now do checks
      if p_kdgrp is initial.
        message e001(00) with 'Customer group is not valid'.
      endif.
    at selection-screen on value-request for p_kunnr.
      data: xkna1 type kna1.
      data: xkunnr type kna1-kunnr.
      clear dynfields . refresh dynfields .
      clear return.     refresh return.
      call function 'F4IF_FIELD_VALUE_REQUEST'
           exporting
                tabname           = 'KNA1'
                fieldname         = 'KUNNR'
                dynpprog          = sy-cprog
                dynpnr            = sy-dynnr
                dynprofield       = 'P_KUNNR'
           tables
                return_tab        = return
           exceptions
                field_not_found   = 1
                no_help_for_field = 2
                inconsistent_help = 3
                no_values_found   = 4
                others            = 5.
      read table return with key fieldname = 'P_KUNNR'.
    * Add it back to the dynpro.
      dynfields-fieldname = return-retfield.
      dynfields-fieldvalue =  return-fieldval.
      append dynfields.
      call function 'CONVERSION_EXIT_ALPHA_INPUT'
           exporting
                input  = return-fieldval
           importing
                output = xkunnr.
      clear xkna1.
      select single * into xkna1
             from kna1
            where kunnr = xkunnr.
      dynfields-fieldname = 'P_NAME1'.
      dynfields-fieldvalue = xkna1-name1.
      append dynfields.
    * Update the dynpro values.
      call function 'DYNP_VALUES_UPDATE'
           exporting
                dyname     = sy-cprog
                dynumb     = sy-dynnr
           tables
                dynpfields = dynfields
           exceptions
                others     = 8.
    start-of-selection.
    Regards,
    RIch Heilman

Maybe you are looking for