Select List with Redirect clears Foreign Key

I have two pages created by the Form wizard, a report and a form, with a Create button on the report page. When the Create button is pressed it passes a Foreign Key item using f?p syntax - stardard code, so far, so good, the form page works fine.
However, the form contains three Select List items, and the second and third ones need to be restricted by the value of the first one. That is, once they choose an Organization using the first Select List the second Select List should only show Groups that belong to that Organization. To do this, I have chosen the first Select List to be "Select List with Redirect". This does exactly what I want, restricting the values in the second and third items because the LOVs they are based on refer to the value of the first item in their where clauses.
This works fine when I edit an existing record, and also works if I create a new record but don't touch the value of the first Select List. The problem is that when there is no database record and the first Select List is changed, it wipes out the Foreign Key value that was passed - so the record cannot be saved. The url after redirection shows only a value for the item that was changed, and does not include the value of the Foreign Key item as it did when the Create button was pressed.
I cannot find anywhere to specify item/value pairs for the redirection url. So I have created a Computation which sets the value of the Foreign Key item and computes it Before Header, After Header or Before Region, etc. It sets the value, and Session State displays the value. Debug shows it being set, too. But the displayed field is empty in the region, and the record cannot be saved because the item has no value!
Can anyone tell me what I'm missing here? I suspect the processing of the region is overriding the computation. But I can't find a way around this. Any ideas?

Scott,
Sorry, my mistake - it's not a database column, and Alternate Source Used is set to "Only...". The problem is still occurring.
The tables are:
- Person - list of People
- Organization - list of Organizations
- Organization Role - Roles defined for each Organization, has foreign key to Organization
- Person Role - Assignment of a Person to an Organization Role, has foreign key to Organization Role and also to Person
I generated a report on Person with a link to a form on the table. When they press the edit icon, the form for the person comes up fine. Then I enable a series of tabs for that person - to edit addresses, phone numbers, etc. and carry the Person ID forward to each page.
On the Person Roles page, I generated a report that lists the roles that person is assigned to and a form to maintain the assignments. Pressing the edit button goes to the form to maintain the assignment, which works fine.
There is also a Create button to add a new assignment, which goes to the same form and clears the primary key of this table to create a new record. I also pass the Person ID in the url so that the new record can create the foreign key value to Person.
Now here's the problem. On the form to create or edit an assignment, there is a Select List to choose the Organization Role record that they are being assigned to. But this can be a long list, with the same role in several organizations, etc. So I want to allow them to first select the Organization, then select Roles in that Organization.
To do that, I created a new item on the page that is not a database column. It is defined as a Select List on Organization, and they can choose the Organization from the list. Then the select statement for the Organization Role LOV has a where clause that compares Organization ID against the value chosen by the user. To make this work, the page has to be updated when they choose a different Organization, so I made the Organization field a Select List with Redirect.
When I edit existing role assignments this works fine. As soon as I select a new Organization, the Organization Role Select List is updated and I can choose roles defined for that Organization. But when I create a new record (which passes in the Person ID in the url) and then choose an Organization, the Person ID is wiped out - and the record cannot be saved without this foreign key value.
After selecting an organization on a new record, the url shows that the page has been called with only the new value of Organization - so the Person ID is lost, because there is no database record to fetch and it is not passed to the page. And I cannot find a way to set the item/value pairs passed to the url when the redirect is performed.
I am displaying the Person ID for debugging purposes, and see it disappear if I set Display As to "Text", "Display as Text", "Display as Text (based on LOV, does not save state)" or "Display as Text (based on LOV, saves state)". Interestingly, even though the later saves state (I can see it in Session State), it still gets wiped out in the record - presumably because it's a database column and there is no record, and the value is "Always" going to update the session state.
Another interesting behavior: If I set the Person ID to display as a Select List, it remains. I think this is because I do not allow extra values or nulls, so it displays the first value in the list if there is no value. (I have only created one person so far in my testing, so I can't tell yet for sure if it changes. Will try that.)
Is this clear? I'm trying to get this application created in my workspace on htmldb.oracle.com (currently it's on my local database) but having problems creating the tables - unable to create initial extents. Hopefully, I'll have it up there soon and you can examine what I'm doing. I'll let you know when it's available.
Thanks for your help.
Sam

Similar Messages

  • Select list with redirect - clearing field issue

    I'created an APEX page where there is 2 items. A Select list with redirect and a Text Field. Both have "Only when current value in session state is null" for "Source used". If some data has been written into the Text Field and I'm selecting someting from the Select List with redirect, the value of the Text Field is cleared.
    The page has no Computations, Validations, Processes or Branches.
    As you may guess, I want the the Text Field NOT be cleared.
    I know, that subject has been discussed over and over, but I'm all reading about it told me that "Source used" set to "Only when..." for the Text Field, it's suppose tol keep it's value.
    Could please someone explain me what I've not understood.
    Many thanks in advance.

    Thanks for helping me. In fact, my real problem is about a page where two select lists are needed. The first one shows CATEGORIES and the second one shows SUB-CATEGORIES, based on the value selected at the first select list. Since there is other fields on the page and the data has not been saved yet (other fields afterwards and validations anyway), data entered has to be kept until the user click "Save" button and all the validations are ok. I was expecting to solve the issue by using "Select list with redirect" for CATEGORIES (this is the only way I was able to make SUB-CATEGORIES works) and having all my fields "Source used" set to "Only when...".
    So, can someone told me if "Select list with redirect" is the way to solve my problem or should I use something else?

  • Select List with Redirect clears unrelated fields

    The Select List with Redirect seems to clobber any fields that were passed in from the calling form.
    In particular, I have a form where I'm trying to populate an intersection table. The first FK column is passed, and shows up when the form first appears, but as soon the select list is selected from, it disappears. The select list with redirect is needed to provide a filter for the select list to populate the second FK column.
    How do I preserve the value passed to this form so it's still there when the create button is pressed?
    Thanks

    Try to give condition to your process...
    In select list ... give some name to request....
    and then in your process enter :REQUEST <> 'SELECT' in this case when select list is submitted then that process will not be fired

  • How to access the value of fiedl ( select list with redirect )

    WE created one report and form. When i click in the edit button of the report
    for the specific record ; the system go automatically in the form
    and show me all the information. In my form ia have some fields ( select list with redirect ) in this way i store the key but i can see the description.
    I want to control the delete operation in checking the value of some field
    in my form. How can i do that. When i verfy the content with SESSION
    my variable are empty
    Thanks
    Marc Fortin

    Hello Larry,
    You can use a select list with submit and create a branch to the page you want to go to.
    Hope that helps.
    Regards,
    Dimitri
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/
    http://www.apexblogs.info/

  • Select list with redirect and save the item to insert row

    On the Form, I want to select from the item (P105_ADMIN_DOMAIN_ID)
    and pop the result on the item (P105_ADMIN_NAME).
    P105_ADMIN_DOMAIN_ID define:
    Display as "select list with redirect"
    Alternate source used "Only when .."
    Source Type "Database Column"
    Source Value or express "ADMIN_DOMAIN_ID"
    P105_ADMIN_NAME define:
    Display as "Text Field"
    Altrenate source used "Only when .."
    Source Type "SQL Query"
    Source Value or express "select party
    from responsible_party
    where logonid
    = :P105_ADMIN_DOMAIN_ID"
    questions:
    1. item P105_ADMIN_DOMAIN_ID DROP DOWN LIST is limited to
    some threadhold, it did not list all the value from
    the LOV which is follow:
    select LOGONID d, LOGONID r
    from RESPONSIBLE_PARTY
    order by 1
    2. I want to insert a row after complete the form.
    But my item P105_ADMIN_NAME is defined
    Source Type "SQL Query" instead of the 'Database
    Column'
    How could I overcome these?
    Thanks so much for your help.

    1) what i meant was for you to test this ridiculously huge LOV outside of htmldb, but it occurred to me last night that you could, in fact, be hitting a limit of ours. after some poking around, i have confirmed that. select list items in htmldb are currently limited to 10,000 rows. this was initially done for performance reasons, but they're now opening up the restriction. if you really need to work with that many rows where the user is allowed to pick from a set of values, consider using a popup item type instead. it'd help your app performance as well (in my test cases, it stank to have to wait for my 10k select list rows to come down to my browser).
    2) sorry to not have been more clear about this, but when you set your item's "Source Type" back to "Database Column", you'd have to specify that column in the "Source or value expression" field. also, you can't put a sql query into that "Post Calculation Computation" field. as i said before, "you can take a look at the attribute-level help for that field to see implementation examples."
    3) stick with "Always..." for now if you're using our auto-dml process(es)
    regards,
    raj

  • How to Fix Select list with redirect Problem

    Hi
    I have a field F1 of type select list with redirect.
    It has an LOV with 2 values USA and Canada for eg..
    I choose USA and hit save and saved it to DB..
    now f1 is stored in table with my User ID and value is USA.
    when I log in next into this page,
    this field should show me the value USA.
    But its not happeneing for me..it always gives the null value when i re login
    is there a way to default/source it to my value??
    I am using
    select f1 from table
    where user_id=:user_id;
    i checked and this query works in sql plus...

    Earl, please see the response in italics for each of your questions below:
    You do want your default value to be one of the values in the select list. Otherwise why would you want the value there at all?
    So, then should I have a default value at all? And, if yes, then what should it be?
    And can't you just set the default value to the first value in your select list, whatever that is, so the first value is the selected value?
    I did that and it works, only if the first value in the select list is always going to be there.  The select list is based on a column data in a table.  And if the data for that column changes then the values in the select list will change.  And, the first value might not always be the same.
    I guess I'm not clear why this isn't doing what you want, besides the fact that
    you seemed to have removed the default value from the dynamic select list query, which you shouldn't do.
    I removed the first value (it could have been any values) from the select list to mimic the "dynamic" select list -- just to test.  The select list data is based on a table and the data in the table can change.
    Thanks
    DP

  • Select list with Redirect

    Version HTMLDB 2.0.0.00.49
    Can you help?
    New to HTML DB and struggling with Select Lists.
    I have 3 select lists based on LOVs (SQL Queries).
    On selecting a value from Select List 1, this filters Select List 2 (Using Select List with Redirect) and on Selecting a value from Select List 2, this in turn filters Select List 3 (Again using Select List with Redirect).
    The problem that I have is that after the Select List with Redirect has executed, the page is rendered and the value that I selected is overwritten by the first value in the select list as determined by the SQL order clause in my LOV definition.
    Is there a way to 'freeze' the value that I have chosen regardless if the page is rendered because of the Select List with Redirect?
    I have checked the Session State and the correct values are being assigned to the appropriate ITEM variables, however what the USER sees makes it very confusing.
    Perhaps there is a better way of achieving the desired functionality?
    Perhaps I am using Select List with Redirect inappropriately?
    Any guidance gratefully received.

    id,
    Set each item's Source Used attribute to 'Only...' to cause cached values to be used in preference over newly computed values for each page view. Just be sure to clear cache for the page when first linking to it or when branching to it from other pages.
    Scott

  • Using a Select list with Submit

    I am trying to use the select list with Submit on my page.
    I have 3 select lists.
    On the first one,I am showing the list of all jacks.
    When the user selects a jack from the first list, I want to show all the jacks except the one which was selected.
    When the user selects a jack from the second list, I want to show all the jacks except the ones selected in the first list and the second list.
    I have created the select lists with submit and then I have put the query for getting the jacks. I created an unconditional branch. I am also passing the variables so that I can set the values of the items on submit.
    I also created a computation as mentioned in one of the OTN discussions, and have mentioned the value of second list to be calculated from the first and 3rd from first and second.
    But after clicking the first select list, I am losing all the existing values on the first page. I wonder what I am missing here. Can anyone hellp?
    Thanks,
    Gargi

    Gargi,
    In this case using 'select list with redirect' makes more sense rather than with SUBMIT. So change all the select lists to 'select list with redirect' (it redirects to same page inserting 'select list' value session state).
    Now for the 2nd select list query add a condition in where clause like
    WHERE sl_col != :P1_SL1And for the 3rd select list query add a condition in where clause like
    WHERE sl_col NOT IN (:P1_SL1, :P1_SL2)Hope it helps :-)
    Cheers,
    Hari

  • Select list with URL redirect - not showing the same display value selected

    Hi
    I have several select lists with URL direct on my page similar to this
    for p6_queries item the LOV is
    select QUERY_NAME display_value, 'f?p='
    || :APP_ID
    || ':'
    || 6
    || ':'
    || :APP_SESSION
    || '::::p6_queries:'||QUERY_ID||'#qtables' return_value from .....
    I am assigning a return value to the item p6_queries. But when the page is redirected, I dont see the selected value as selected in the list. Instead it goes to the null display text. Can any one help me on this?

    The problem is that your setting the item value to value of query_id. But your select list has the value of each item as the URL so it will never match and show you what you selected.
    The best thing to do may be to change your select list from a "redirect to URL" to "submit page", make it a normal query:
    select QUERY_NAME display_value, QUERY_ID return_value ...
    Then create an "On Submit: Before Computation" branch:
    Target Type: URL
    URL Target: f?p=&APP_ID.:6:&SESSION.::&DEBUG.::P6_QUERIES:&P6_QUERIES.#testing
    Condition Type: Request = Expression 1
    Expression 1: P6_QUERIES

  • Dynamic select list with one static 'not_listed" option

    Hi guys,
    I want to create a dynamic select list with one static 'not_listed' option.
    One possible alternative is to add the 'not_listed' record into database, but I really dont want to go that way unless there is no other way around.
    Can anyone shed some lights on this?
    Many thanks,
    William

    As usual : "It depends"...
    If you have a foreign key defined on that field, Scott's reply won't work - unless you define '0 - Not listed' in the database. You can use selec 'not listed' d, to_number(null) r from dual though...
    Another - more declarative way - is in the on 'Edit Page Item' page, in the 'List of Values' region set 'Display Null' to 'Yes' and 'Null Display Value' to ' - Not listed - '.
    Roel

  • Select list with bind variable does not work

    Hi,
    What can be wrong with a 'select list' with the a simple select
    select omschrijving o, id i
    from basiscodes b
    where domein = 'OPTIES'
    and b.id in
    (select eo.basiscode_id from evenementen_opties eo
    where eo.event_id = :P16_ID)
    The :P16_ID has a value and should give result
    But it does not work at all with 'select list'
    Using the POPUP LOV (display discription, return key value) works nice
    The select retuns less then 10 records

    Hi Flavio,
    As I explained, the P16_ID is an item of the master page (page 16)
    In Page 18 where I want to reuse that value, the item is not there, but I use it to assign
    P18_EVENT_ID with the value in P16_ID and that works fine.
    In an after submit process, I do this :
    declare
    function get_pk return varchar2
    is
    begin
    for c1 in (select EVENEMENT_INSCHRIJVING_SEQ.nextval next_val
    from dual)
    loop
    return c1.next_val;
    end loop;
    end;
    begin
    :P18_ID := get_pk;
    :P18_EVENT_ID := :P16_ID;
    :P18_CREATIE_DT := TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS');
    :P18_CREATIE_USER := APEX_APPLICATION.G_USER;
    end;
    The value P16_ID is there before I open page 18
    I made a display item that displays the value P16_ID
    If I change the LOV select in :
    select b.omschrijving o, b.id i
    from basiscodes b
    , evenementen_opties eo
    where b.domein = 'OPTIES'
    and b.id = eo.basiscode_id
    and eo.event_id = 16
    then it returns the value I want : 1 record
    You see, I'm a really new one in apex.
    Forms 6i was easier for me...
    Regards Jules
    null

  • Select List with Submit - Branch Error - form data does not save

    I am a new APEX user so please excuse my ignorance. I have created a simple application in which a primary data entry form branches either to a detail form (one to many on the parent ID) or a master tabular report used for navigation. These branches work fine. Then I tried to get a little fancy with a conditionally displayed element based on the value the user selects in a select list on the main form(P9_REPORT_TYPE). I converted the select list to a select list with submit and created a new branch (on submit - after processing) to the current page (Page 9) to avoid the "no branch found" error. To avoid the branch being unconditional, I tried to use the 'Request = Expression1' condition with the Expression 1 field set to P9_REPORT_TYPE. The behavior I get is that the page seems to submit but the data on the form is not saved -- even the new value selected in P9_REPORT_TYPE reverts to the old value. I simply need the page data to submit so that the conditionally displayed element will take effect (which it does if you use one of the other button-based branches and then return to the form). Do I have the syntax wrong? It seems like this should be straightforward but I've tried a number of options including using a PL/SQL condition V('REQUEST')='P9_REPORT_TYPE' with no success. I'm guessing that the value of Request is getting cleared before it has a chance to trigger the branch? Any help would be greatly appreciated.

    Exactly so! Thanks Scott for setting me straight. For the benefit of other readers, the value in the Source Used column had been set to "Always, replacing any existing value in session state" and should have been set to "Only when current value in session state is null".

  • SELECT LIST WITH SUBMIT NOT POPULATING

    I have 3 fields; They are ID, Shortname(PRIMARY KEY), Longname. Longname is a select list with submit based on an lov (called system_longname description) that has a return value of ID. I need to select a value (longname) from that list that will populate automatically the ID and Shortname fields. This is the code I'm using for ID and Shortname, which are both text boxes. The view VSYSTEMS is where the lov is getting it's values.
    'SELECT ID FROM VSYSTEMS WHERE ID = :SYSTEM_LONGNAME DESCRIPTION';
    'SELECT SHORTNAME FROM VSYSTEMS WHERE ID = :SYSTEM_LONGNAME DESCRIPTION';
    Can anyone help me? I keep getting these error messages: invalid SQL statement or SQL command not properly ended.

    Matthew,
    Is this a follow-up to Automatic field population by selecting a LOV ?
    What is the purpose of 'DESCRIPTION' at the end of each query?
    Scott

  • Can we have the 'select list with submit' type within a tabular form?

    An item can be the "Select list with submit' type so a form has no problem with it. However, when I built a tabular form manually, I couldn't find this type. There are only three types avaiable: "named", "static", and "dynamic".
    Is it possible to have the "submit" type so columns of the tabular form can be dynamically rendered based on the user inputs?
    Another question I have is how to dynamically build the tabular form with decode func. For example, if the value of col_1 is 'val_1', then build a select list in col_2; otherwise null in col_2.
    I tried to use
    select col1,
    decode (col1, 'val_1', select htmldb_item.select_list_from_lov(2, first, 'lov1') from dual, null)
    from....
    where....
    But it didn't work.
    I'd like to know whether it's feasible to have something like that.
    TIA.
    Message was edited by:
    Luc

    You could use a region of type PL/SQL function
    returning SQL query to dynamically build this kind of
    tabular form. However if you want to use the built-in
    multi-row insert, update and delete processes, all
    items in a column must have the same display type. Marc, thanks for the quick reply. I appreciate it.
    I got your idea. However, I need to have the javascript 'ToggleAll' as the heading so the form works as same as the built-in one. If I put the query definition into a pl/sql procedure, where I can put this html tab attribute? It can not be inside the checkbox function, otherwise the checkbox of any row would act as same as the header.
    I hope I've made this clear.
    To Vikas: It's our clients who want this, not us. :(

  • Item(select list) with LOV and Report with link = changed value item

    Hello,
    On one page I have:
    - Item 'P_name' (select list) with LOV to select name of a person;
    - Items 'factory' and Report 'factory'(standard created with 'Form with Report' on the same page).
    Situation:
    All works fine. I selected first a LOV Item 'P_name' (say 'Jane'). But....
    Only when I select a record (to change the values) from the report 'factory' then LOV Item 'P_name' become empty. Report used a link to the same page to fill the report items 'factory' and make also the LOV item empty.
    Question:
    I have made a process that write the name 'Jane' to table.
    I see two possibilities:
    - LOV Item value => fill the LOV item with 'Jane' from the table before region. Is this possible?
    - Report => What is the buttonname of reportlink? I can use this name in the processes.
    Thanks Walter!

    1) what i meant was for you to test this ridiculously huge LOV outside of htmldb, but it occurred to me last night that you could, in fact, be hitting a limit of ours. after some poking around, i have confirmed that. select list items in htmldb are currently limited to 10,000 rows. this was initially done for performance reasons, but they're now opening up the restriction. if you really need to work with that many rows where the user is allowed to pick from a set of values, consider using a popup item type instead. it'd help your app performance as well (in my test cases, it stank to have to wait for my 10k select list rows to come down to my browser).
    2) sorry to not have been more clear about this, but when you set your item's "Source Type" back to "Database Column", you'd have to specify that column in the "Source or value expression" field. also, you can't put a sql query into that "Post Calculation Computation" field. as i said before, "you can take a look at the attribute-level help for that field to see implementation examples."
    3) stick with "Always..." for now if you're using our auto-dml process(es)
    regards,
    raj

Maybe you are looking for

  • Cannot connect to other computers on network

    We have a small office network with 7 macs on it. 5 wired 2 laptops with Airport Extreme. We have an 8 port switch where the 5 desktops and the airport connect. When I am on a laptop I cannot connect to any of the desktops. It does not even see them

  • How to capture the IP address of the client Machine.

    HI... I want to capture the ip address of the client machine and store it in a field. My client wants to capture the ip address so that he can easily trace out from which client system particular work is done. if there any pre defined function or syn

  • ZEN MICRO: How to save files (to my harddi

    Hi everyone! I would like to install most recent firmware for my ZEN MICRO. Creative strongly recommends, to save all data (here: music files) beforehand. But how? I should let you know, that most of the music (around 350 files) has been filed under"

  • Mail: Proper way to adjust IMAP/SMTP mail server entries?

    Please forgive, but I am still on 10.4 (Tiger) with an iCloud mail account. I believe this is still a widely applicable and helpful question! IMAP (Incoming Mail Server):      MINE IS STILL:      mail.me.com  (Currently still working fine)      Advis

  • I downloaded a movie and its not working

    i was getting the movie rags and it worked till i got to a part where it didnt work can u help me