Get Apex Select List value

Hello,
I've used APEX_ITEM.SELECT_LIST_FROM_QUERY in one of my dynamically built report.
SELECT 'Add' "Add",(SELECT APEX_ITEM.SELECT_LIST_FROM_QUERY (1,ENAME,'SELECT DISTINCT ENAME,EMPNO FROM EMP') FROM EMP WHERE ROWNUM=1) "SELECT",A.* FROM ('||OBJ_SQL||') A ORDER BY 2;
OBJ_SQL we get from a table which contains a query. The query is different for each of the selection made in another region. Probably a select list with different countries and clicking on each country, the below dynamic report should be built. Each country will be having different columns. So we store all the countries and respective queries in a table. The report should appear as :
Add is a link.
Select is a select list with Employee Names.
Some Other columns from the query corresponding to the country.
My requirement is Whenever I click on Add link for any row, the different columns in each row should be inserted into a table. I tried using a javascript call to a function passing all the values like #COL2#,#COL3# etc. But for the select list, though I select SCOTT, the whole string (all employees are concatenated) is being sent.
Is there a way we can pass only the selected value to the javascript function? How can we achieve this? Please help.
The select list gets displayed perfectly.

Hey.
Somebody help me please.
I have to get value from APEX_ITEM.SELECT_LIST_FROM_QUERY - column on a report.
SELECT DISTINCT ROLE AS GET_ROLE,
JOB AS GET_JOB,
APEX_ITEM.SELECT_LIST_FROM_QUERY
( 1, '%', 'SELECT DISTINCT CODE c,
MODE m
FROM T2
WHERE ROLE = ' || ROLE
) AS GET_CODE
FROM T1
WHERE AGE >30 AND
SEX = 'M' ;
I was trying to use javascript :
for (var i = 0; i < selectlist_name.options.length; i++)
if (selectlist_name.options[ i ].selected)
result=selectlist_name.options;
but I don't know what is the name of this APEX_ITEM.SELECT_LIST_FROM_QUERY and what "selectlist_name" must be there.

Similar Messages

  • How to get the selected node value of a tree which is build on java code

    Hi Experts,
    How can i get the selected node value if I build the tree programatically.
    I am using the following code in selectionListener but it is throwing error.
    RichTreeTable treeTable = (RichTreeTable)getQaReasontreeTable();
    CollectionModel _tableModel =
    (CollectionModel)treeTable.getValue();
    RowKeySet _selectedRowData = treeTable.getSelectedRowKeys();
    Iterator rksIterator = _selectedRowData.iterator();
    String selectedQaCode ="";
    while (rksIterator.hasNext()) {
    List key = (List)rksIterator.next();
    JUCtrlHierBinding treeTableBinding =
    (JUCtrlHierBinding)((CollectionModel)treeTable.getValue()).getWrappedData();
    JUCtrlHierNodeBinding nodeBinding =
    treeTableBinding.findNodeByKeyPath(key);
    String nodeStuctureDefname =
    nodeBinding.getHierTypeBinding().getStructureDefName();
    selectedQaCode = selectedQaCode + nodeBinding.getAttribute(0);
    where I am using following link to create a tree with java code.
    http://one-size-doesnt-fit-all.blogspot.com/2007/05/back-to-programming-programmatic-adf.html
    Please help me in resolving this issue.
    Regards
    Gayaz

    Hi,
    you should also move
    JUCtrlHierBinding treeTableBinding =
    (JUCtrlHierBinding)((CollectionModel)treeTable.getValue()).getWrappedData();
    out of the while loop as this is not necessary to be repeated for each key in the set
    Frank

  • Refresh classic report based on select list value selected

    hello,
    can anyone please help me out with this issue. I have a parameterized classic report based on a select list and I want to refresh this report whenever the select list value is changed. I am using oracle apex version 3.2. i just want to have a javascript function onchange event for the select list which refreshes my report whenever a value is selected.
    My select list item is p1_datastore
    select distinct datastore d,datastore r from my_table1 order by 1;
    My classic report query is
    select * from my_table2 where datastore = :p1_datastore order by last_updated_dt desc;
    ****************************************************thanks,
    orton

    can anyone please help me out with this issue.
    thanks,
    orton

  • Tranferring on "select list" value to another "select list" value

    We have a drill through feature in our application where the user clicks on a value on page 1 and is taken to page 2. (e.g. the user drills on EUROPE in the REGION column on page 1 and is taken to page 2 where they see a report by countries in EUROPE.)
    We also have identical SELECT LISTS on page 1 and on page 2 for REGION (EUROPE, NORTH AMERICA, ASIA). How do we program our application so that when the user clicks on EUROPE on page 1 and is taken to page 2 the value of EUROPE from the REGION SELECT LIST on page 1 is chosen in the REGION SELECT LIST on page 2?
    We tried embedding this in the url for the drill through but the REGION SELECT LIST value on page 2 didn't change.
    In the below link shouldn't the value of the REGION SELECT LIST named P2_REGION be assigned the current value of the REGION SELECT LIST called P1_REGION? (in this case 'EUROPE')
    Thanks for help on this. John Wisnieff
    f?p=&APP_ID.:102:#APP_SESSION#::::P102_PRG1_LINK:#P1CAMP_NAME#,P2_REGION:&P1_REGION

    It would be great to get quick reply on this as we have a project due soon. I just need an answer to the below question:
    In the below link shouldn't the value of the REGION SELECT LIST named P2_REGION be assigned the current value of the REGION SELECT LIST called P1_REGION? (in this case the value is 'EUROPE')
    f?p=&APP_ID.:102:#APP_SESSION#::::P102_PRG1_LINK:#P1CAMP_NAME#,P2_REGION:&P1_REGION

  • How to get Saved Selection list in javascript?

    Hello!
    Recently I met a little problem about save selection. I want to get saved selection list so that I can used in javascript. Now I have no ideals. Hope you tell me some useful information about how to get Saved Selection list in javascript!

    Mark is right, it's not possible.
    But do you know you can assign selection to a variable, and get back to it simply like this?
    var sel = app.selection;
    app.selection = null;
    /* your codes here
    app.selection = sel;

  • Inserting checkbox into a APEX select list

    After aloooottt of time spend in google and script foruns, i found a way to transform the simple APEX select list into a multiselec combobox with checkbox inside. Its working prety cool, and its not so hard to implement.
    I´m sry if someone alread post it before, but, due to the time spend it on it, i know that is a bit hard to found.
    If someone is looking for that too, i can share all my work into this. I will be glad to help.
    just send me a email [email protected] or ask here on forum.
    Tnks to all who help me on this "quest" lol.

    Good to hear. If you have an account on apex.oracle.com you can put your demo there for everybody to see. If not, just create an account.

  • Refresh PL/SQL Report Region (not Page) using Select List value

    Hi,
    I've got a report region based on a 'PL/SQL function body returning a SQL query'which gets generated on selecting a value from a Select list item, The Select List action is 'Redirect and Set value' but this causes the whole page to refresh rather than just the report region. I've tried to refresh the report only using a dynamic action on the Select List item (Action now reset to  'None') but now the report is not appearing on choosing from the List. Can anyone suggest a solution that will allow me to refresh this report without refreshing the page? I am using APEX 4.2.2 and the report syntax is as follows:
    DECLARE
      v_statement VARCHAR2(500);
    BEGIN
      SELECT query_text
        INTO v_statement
       FROM sql_queries
       WHERE query_id = :P2_QUERY ;
       RETURN v_statement ;
    END ;
    where P2_QUERY is Select List Item,
    regards,
    Kevin.

    KevinFitz wrote:
    The report region being displayed is conditional on P2_QUERY item being NOT NULL. I assume the region not appearing is because the Action for the Select List Item is set to None and so P2_QUERY is always NULL.
    No, the region is not appearing because it is conditional on P2_QUERY being NOT NULL. This means that the report region never exists on the page shown in the browser, so it can't be dynamically refreshed. (Dynamic refresh doesn't evaluate region conditions, and it only re-renders the report content, not the entire region.)
    Remove the condition on the report region, check the refresh is working, then reconsider exactly what the requirements here are. If you want the region to appear only when P2_QUERY has a value, and you want it to be refreshed without submitting and re-rendering the page, then the region needs to be hidden rather than conditionally rendered, and shown via a dynamic action when P2_QUERY gets a value.
    I tried adding an additional Set Value True Action for the DA event but got an error as listed above,
    All irrelevant if Page Items to Submit on the region is used properly.

  • How to get option select single Values in select options

    Hello All,
    I have a requirement where, in select-options i should avoid the range selection and should have only select single values option. User wanted to give the list of 10000 materials by using copy and paste as we have in normal abap with pase clip board option.
    Please let me know if you need any further clarification. your quick response would be highly appreciated.
    Thanks
    Raj.

    Thanks for the reply, I have already done this but when you add values to it at a time 1000 material information we can not add.
    so you go to selection screen and you have only one input box with arrowe button. click on the arrow and then you will get the screen where it will ask you to add five records and that to ranges.
    but if you click the same arrow in normal selection screen of SAP you get 4 tabs in which first tab will be select single values.
    and there by using copy from notepad option we can add how many entries we want.
    Let me know if you need any further clarification to understant the requirement.
    Thanks,
    RaJ.

  • Using select list value as column name in SQL

    Folks,
    Thanks in advance for any help with this
    I have a select list with two values (Instance and Username) created by
    STATIC2:Username;USERNAME,Instance;INSTANCE
    I am trying to pass the value of this (:P2_SELECT) and use it as a column name in a SQL query as below
    select USERNAME,
    INSTANCE
    from table_name
    where :P2_SELECT like '%'||:P2_TEXTSEARCH||'%'
    When I substitue the :P2_SELECT for one of the values (either instance or username) this works fine
    I suspect it is due to how Application Express interprets the value of :P2_SELECT
    Any help would be much appreciated!
    Gareth

    Thanks Munky that worked a treat!
    The next hurdle I have now is that because I have changed the region type to "PL/SQL Function(returning SQL Query)" there is no longer the option to add sorting to the columns as I have had to change the Source option to "Use Generic Column Names (parse query at runtime only)"
    I will have a scout around and see how I can get around this
    Gareth

  • Pass Select list value to URL as a parameter

    I am trying to pass the selected value from a select list via a button to a URL.
    &P_VALUE=&P_VALUE.
    P_VALUE is set to USER SESSION.
    It shows as prevous session value. If I show the the session value is not set to the selected value.
    If I call a PDF report via a button, it displays the correct value and the session values is correct.
    If I select the button for the URL again, is shows the previous value.
    When I go back to the form and call select the button again, the correct parameter is passed to the URL.
    Any Ideas?
    Thanks,
    Jerry

    If you use substitution at the time, the button gets generated, you don't have the new value - the button is generated with the rest of the page, and then later the user changes value of the select list. You have two choices:
    1)Use Select list with submit - and transfer the user to second page using branch (which get's calculated after submit when select list has already the new value)
    2)Use Javascript to catch the onChange/onClick event of SelectList, read the current value and do the redirect from JavaScript.

  • Using Select List value for building report

    I have an interactive report form. I have a "After Header" (LOAD) process that run sql commands that will populate a table with the data that the report needs for a given week.
    I have a Select List item that is run as a "Before Header" that gets a list of dates from a table. The dates only contain the first day of the week for the past two years. It is called "WEEK_OF" table and the column is called "WEEK_OF_DATE".
    The default value for the Select List is the first day of the current week. And then all of the first day of the week from the WEEK_OF table.
    I would like the LOAD process to use the value in the Select List. So at start up I would like the List to show the current week and report to begin with data from the current week.
    So I have tried to use the variable :WEEK_OF_DATE (Item name) as the beginning date for the report. However :WEEK_OF_DATE is null.
    Also, after I have the report displayed, I would like to select a new date from the list and have the report automatically refresh with that new data.
    Any Ideas what I am doing wrong?

    Hi Lyle,
    When setting a default value for a select list that is to be used to filter a report, I have found it best to do that using a computation, conditional on the item being NULL and running Before Header. If other computations rely on this value, then it should have the lowest sequence number to ensure that the value is available for those.
    Andy

  • Automatically update text field depending on the in select list value

    I have got 2 tables. Table A (Employee Personal Detail), Table B (Employee Academic detail). Employee no is common field between two tables).
    I have created interactive report with form on table b using in-built templates. I have added text box on form to display employee name which is stored in table A. I want to automatically display employee name depending upon value in employee no field on form. I know I can write query to get value in employee name field. It gives me error when employee no is blank. How to handle error?

    Sagar,
    For the employee name value to change according to the emp_no, your page needs to get submitted. can you use a select list with submit for emp_no? And then use the PL/SQL mentioned above to run on page submit?
    I'm not sure but I guess you can also achieve this in Ajax. May be someone expert in that could help.

  • Update fails when select list value isn't changed

    Hi Folks,
    I am using htmldb_item to create a report form that is updateable. There is a checkbox in the first column and I am using a technique discussed in the forum to make sure I am getting the values from the checked rows in order to perform the updates.
    However, I have noticed that if I do not change the selection in the select list, and check the "update row" checkbox, I get a "ORA-01722: invalid number" error.
    I'll provide both the select and update statements and would appreciate it if someone could help me discern a solution.
    == SELECT STATEMENT ==
    select
    htmldb_item.checkbox(1,rownum),
    htmldb_item.hidden (2, p.id) ||
    htmldb_item.text(3,p.project_name, 40) as project_name,
    htmldb_item.select_list(4, p.gts_dependant, 'Y;Y,N;N', null, 'NO')as GTS_Dependant,
    htmldb_item.select_list(5, p.gxp_relevant, 'Y;Y,N;N', null, 'NO') as GxP_Relevant,
    htmldb_item.select_list_from_lov(6, u.user_first_name||' '||u.user_last_name,
    'PROJECT_MANAGERS', NULL, 'NO') as project_manager
    from
    eprs_project p, eprs_project_monthly pm, eprs_user u
    where
    p.id = pm.project_id and
    pm.project_manager = u.id and
    to_char(record_date, 'MON YYYY') = to_char(sysdate, 'MON YYYY') and
    p.program_id = :P8_SELECT_PROGRAM== SUBMIT STATEMENT ==
    for i in 1..HTMLDB_APPLICATION.G_F01.COUNT
    loop
    update eprs_project set
    project_name = HTMLDB_APPLICATION.G_F03(HTMLDB_APPLICATION.G_F01(i)),
    gts_dependant = HTMLDB_APPLICATION.G_F04(HTMLDB_APPLICATION.G_F01(i)),
    gxp_relevant = HTMLDB_APPLICATION.G_F05(HTMLDB_APPLICATION.G_F01(i))
    where id = HTMLDB_APPLICATION.G_F02(HTMLDB_APPLICATION.G_F01(i));
    update eprs_project_monthly set
    project_manager = HTMLDB_APPLICATION.G_F06(HTMLDB_APPLICATION.G_F01(i))
    where project_id = HTMLDB_APPLICATION.G_F02(HTMLDB_APPLICATION.G_F01(i)) and
    to_char(record_date, 'MON YYYY') = to_char(SYSDATE, 'MON YYYY');
    end loop;
    Analysis
    I've narrowed the behavior down to the Select List. The "u.user_first_name||' '||u.user_last_name" assembles the first name and last name from the user table, but must not have a value associated with it, as the rest of the names do (because they come from the application LOV "PROJECT_MANAGERS." Therefore, when the user checks the "Update Row" checkbox (rownum), there is no value associated with the selection. This would explain the invalid number error message.
    If this is correct, then I am not understanding the SELECT_LIST_FROM_LOV function sufficiently. The documentation says about the p_value parameter: "This value should be a value in the p_list_values parameter." This is a small cut and paste typo because there is no p_list_values parameter, but rather a p_lov parameter. Anyway, the p_value is the default displayed value, which ideally would be one of the items from the p_lov list. It is, but not really. By that I mean, the current value is a valid name but isn't from the application LOV, per se. Therefore, I had proceeded merrily on my way believing I had fulfilled the API requirements because I had provided a "current value" and an application LOV.
    The example in the user guide provides only a column name for the p_value parameter, so I don't understand how I would associate a value with the display item (from the p_value parameter) to prevent the error message from being generated. Is there a best practice for this?
    Any guidance would be most gratefully appreciated.
    Yours,
    Petie

    Hi. I've tried a few things to get a value into the p_value parameter.
    Attempt 1:
    u.user_first_name||' '||u.user_last_name;u.idAttempt 2:
    'u.user_first_name||'' ''||u.user_last_name;u.id'Unfortunately, neither of these was successful. The first one wasn't valid syntax and the second was reproduced as a string literal.
    Have I stumped everyone? Or am I just missing something really obvious? Any thoughts? Any workarounds? Should I create an intermediate view with the first and last names already concatanated? That wouldn't put the ID into the p_value parameter. The examples in the Users Guide don't address the value part of the "Display/Value" pairing in the Select List. They provide either a static display or a single column.
    Right now, I have to put something like the following into the users manual:
    "When updating core project data, you must re-select the first occurance of the project managers name from the select list. If you do not re-select the project manager name, you will receive an error when you Submit the data for update."
    IMHO, this is pretty lame. Don't you agree?
    Thanks for reading and any thought you can offer.
    Petie

  • Apex Select List

    Hi,
    In my application. I have a requirement like the below
    one select list is there where iam displaying the country name returning country code.
    another select list i have a province name displayed returning the province code.
    Now my requirement is when i select country name another province select list should show only the province names belongs to that country dynamically,
    created dynamic action and wrote plsql function on change event to set value as follows but no luck please advice.
    IF :LANG_PREF_CD = 'E' THEN
    RETURN 'SELECT province_name
    , province_id
    FROM (SELECT E_province_name province_name
    , province_id province_id
    FROM province_table
    where province_table.country_id=:p1_country_name
    UNION ALL SELECT 0, '' '', NULL FROM DUAL )
    ORDER BY province_id;
    ELSE
    RETURN 'SELECT province_name
    , province_id
    FROM (SELECT f_province_name province_name
    , province_id province_id
    FROM province_table
    where province_table.country_id=:p1_country_name
    UNION ALL SELECT 0, '' '', NULL FROM DUAL )
    ORDER BY province_id;
    END IF ;
    can any one help where is the mistake please. thanks

    Hi,
    not sure for older versions but for > Apex 4.0 this is possible "out of the box".
    Define 1 list of values called country and set this as the LOV on your country field ( e.g. P11_COUNTRY ).
    Define a second field called P11_PROVINCE and set Cascading LOV Parent Item(s) to P11_COUNTRY, also set Page Items to Submit to P11_COUNTRY
    now define the list of values for the P11_PROVINCE in the List of values definition on the item page ( so not a named LOV since you shoudlk reference a page item ):
    select
         province,ID
    from provincelovtable
    where
    and country_id = :P11_COUNTRY
    The field country_id should contain the country id where the province is linked to.
    regards
    Bas

  • How to use a select list value in a PL/SQL function body returning SQLquery

    Hi Friends,
    I have a select list P6_TEST with values 'nav' anf 'jyo'. I am trying to create a report using "SQL Query (PL/SQL
    function body returning SQL query)". In my report query can i check if P6_TEST='nav' and do something like the
    code shown below.How can i do that.
    DECLARE
    v_sql VARCHAR2(3000);
    BEGIN
    IF :P6_TEST = 'nav' THEN
    v_sql :=
    'SELECT
    * from department';
    ........................Thanks,
    Nav

    Nav:
    What you have should work. Give it a go. Post back if you run into issues.
    Varad

Maybe you are looking for

  • Difference between core switch types WS-C3750X-12S-S and N3K-C3524P-10G?

    Hello All, I am new to this domain and yet have to look after the setup of our datacenter for a new branch. Could any one of you provide difference between core switch types WS-C3750X-12S-S and N3K-C3524P-10G! Thanks in advance!!

  • Finder Window appearance changed and I can't get it back to normal

    Okay this is just driving me nuts and despite all my efforts I can't fix it. About a month ago, my Finder window changed appearance. Instead of the normal view on the left hand side that shows Devices, Network, Places and Search For, it is showing no

  • File to ABAP proxy via AAE

    Hi All Am doing a file to ABAP proxy scenario and using SOAP adapter(XI protocol 3.0) at target side in order to make use of AAE. But while testing am getting the following error at both the channels(file and soap) : Error Transmitting the message to

  • IMac display/keyboard do not function properly

    Took my 21.5" iMac to get the HDD replaced (as per email received from Apple). Computer started up fine, paired mouse and keyboard with no issues. When I try to put the computer to sleep it sounds like it goes to sleep but the display stays on. Also

  • Iphoto calendar photo limit

    is there a way around the 7 photo limit per month in iphoto when you are making a calendar?