Repopulating a multiselect list with saved values

Hi,
I am new to using HTML DB and have been searching the Internet on information I could find about it.
I found some useful information about multiselect boxes and can get the inserts to work but I am having problems with the repopulating of the multiselect from the underlying table.
I am using the following code to get the information from the table and the process point is On Load - After Header.
DECLARE
l_selected HTMLDB_APPLICATION_GLOBAL.VC_ARR2;
BEGIN
SELECT risk_owner_id BULK COLLECT
INTO l_selected
FROM rmd_risk_risk_owners
WHERE risk_id = :P34_RISK_ID;
:P34_RISK_OWNER_ID := HTMLDB_UTIL.TABLE_TO_STRING( l_selected );
END;
but the multiselect list doesn't seem to repopulate with the values.
Does anyone have an idea I what I could be doing wrong from their previous experience. Any suggestions would be appreciated.
Regards,
Scott.

Lets break the problem statement in multiple steps
1. We need a way to know the selection on all rows.
2. We need the association of the checkBox with the data
The  solution is to use a arrayCollection/array that holds all the instances  created for checkbox.This collection should be a property of component  containing the datagrid. We need to use a custom component  implementation or inline ItemRenderer. The way you have used is called  dropinItemRenderer. Preferaly use custom component implementation and  add the instance to the arrayCollection at CreationComplete. Make sure  you use addItemAt so that you add the instance in the same row as the  data. To get rowIndex the custom Checkbox should implement  IDropInListItemRenderer. You could iterate this collection to check all  the instances that are checked.
Note: This is the approach considering your dataprovider doesnt have a selection field.
Nishant

Similar Messages

  • Help on passing multiselect list as in values to function in database

    I am having problemn passing multiselect list as in values to function in database
    I have a static multiselect list :P1_SELECT_LIST
    10
    11
    12
    13
    14
    15
    I am passing to another item :P2_SELECTED_LIST
    ('10','11','12','13')
    I have to send :P2_SELECTED_LIST to a DATABASE PACKAGE(P_DATABASE).FUNCTION(PASS_LIST)
    P_DATABASE.PASS_LIST(P2_SELECTED_LIST)
    IN MY PASS_LIST(FUNCTION)
    function PASS_LIST(P_STRING IN VARCHAR2) IS
    type T_EMPNO is table of VARCHAR2(10) index by binary_integer;
              type T_ENAME is table of VARCHAR2(6) index by binary_integer;
              v_EMPNO T_EMPNO;
              v_ENAME T_ENAME;
    CURSOR C1 IS SELECT EMPNO,ENAME FROM EMP
    WHERE DEPTNO IN P_STRING/* ('10','11','12','13')*/;
    BEGIN
    OPEN c1(P_STRING);
    FETCH c1_axl bulk collect
    into v_EMPNO, v_ENAME limit 40000;
    CLOSE c1;
    FOR I IN 1 .. V_EMPNO.COUNT LOOP
    DBMS_OUTPUT.PUT_LINE('V_EMPNO.COUNT :'||V_EMPNO.COUNT);
    END LOOP;
    END;
    any help

    This link may help:
    Re: Date Time field
    Denes Kubicek

  • Creating a databound JSP pop-list (with dependent values)

    I was able to create a databound JSP pop-list from the "How To Create a Databound Pop-list with Oracle JDeveloper 10g" article. Where would I have to modify the code so that I can define a WHERE clause to the DepartmentView object so that only a subset of values are displayed? My goal is to try to create pop-lists so that the values of pop-list #2 is dependent on the current value in pop-list #1.

    You can create both static values and also
    values based on record group .
    I think you know how to create static values.
    (for static just give the values in "Element List" property of list item)
    Using Record group. see this example.
    Declare
    Rg_Id RecordGroup;
    Rg_Name varchar2(20) := 'Type';
    List_Id Item;
    Temp Number;
    Rowcount Number;
    Begin
    Rg_Id := Find_Group('Type');
    If Not Id_Null(Rg_Id) Then
    Delete_Group(Rg_Id);
    End If;
    Rg_Id := Create_Group_From_Query('Type','select empno,'
    | |'empno'
    | |' from emp ');
    List_Id := Find_Item('CTRL_BLOCK.IT_LIST');
    Temp := populate_Group(Rg_Id);
    Populate_List(List_Id,Rg_Id);
    End;
    In the selection you must give two columns one for label and another one for value.
    Try this and let me know if you have any problem.
    Regards,
    viji.
    null

  • How to delete a Selected row from datagrid and how to create a datagrid popup with saved values

    hi friends,
                  I am new to flex.i am doing a flex4 application,i need help for this.
                i am having a data grid with columns.i have two questions.
               Ques 1: when i selected a partiuclar row from a datagrid and click delete button means that record will delete from the datagrid and DTO from the cloud tables also.
                Ques 2: when i save the data grid values using save button means that data will store in respective cloud DTO which is related to the datagrid,
                    My requirement is i am using a search button when i click the search button it will show a datagrid that datagrid will contain the previous datagrid datas which is saved in the cloud.
    REQUIREMENT example: first screen: i am using with data grid 3 columns (Student Roll number ,Student Name,Student pecentage)---->save--->data will store in cloud DTO.
    Second screen: search button ----> it need show  datagrid popup.it will have data which we saved in the first screen with same columns(Student Roll number ,Student Name,Student pecentage).
    This is my requirement.
    Any suggession welcome.
    Thanks in advance.
    B.Venkatesan

    Lets break the problem statement in multiple steps
    1. We need a way to know the selection on all rows.
    2. We need the association of the checkBox with the data
    The  solution is to use a arrayCollection/array that holds all the instances  created for checkbox.This collection should be a property of component  containing the datagrid. We need to use a custom component  implementation or inline ItemRenderer. The way you have used is called  dropinItemRenderer. Preferaly use custom component implementation and  add the instance to the arrayCollection at CreationComplete. Make sure  you use addItemAt so that you add the instance in the same row as the  data. To get rowIndex the custom Checkbox should implement  IDropInListItemRenderer. You could iterate this collection to check all  the instances that are checked.
    Note: This is the approach considering your dataprovider doesnt have a selection field.
    Nishant

  • How to use array list with fixed values to insert record in trigger

    I have a list  of number 1,30,40,45,60 . These numbers are not being changed so I  don't need to keep in a table. So have to create a  after insert trigger   for 
    As
    Begin
    @list =  1,30,40,45,60 // Array value 
    for i=1 to @list.count
    Insert into mappingtable(arrayvalue,itemcode) values (list[i],Inserted.Itemcode)
    Next
    End
    Please can you help with a code 
    Regards
    Pol
    polachan

    Be careful what you assume - rarely are lists of values like this truly static.  One thing to keep in mind that arrays in sql server are tables.  So, one example is:
    set nocount on;
    /* represents the virtual inserted table in your trigger */
    declare @inserted table (itemcode char(4));
    insert @inserted (itemcode) values ('ABCD'), ('JJKL');
    select * from @inserted;
    select * from @inserted cross join (values (1), (30), (40), (45), (60)) as arrayx(value);

  • REGEXP_SUBSTR for comma delimited list with null values

    Hi,
    I have a column which stores a comma delimited list of values. Some of these values in the list may be null. I'm having some issues trying to extract the values using the REGEXP_SUBSTR function when null values are present. Here are two things that I've tried:
    SELECT
       REGEXP_SUBSTR (val, '[^,]*', 1, 1) pos1
      ,REGEXP_SUBSTR (val, '[^,]*', 1, 2) pos2
      ,REGEXP_SUBSTR (val, '[^,]*', 1, 3) pos3
      ,REGEXP_SUBSTR (val, '[^,]*', 1, 4) pos4
      ,REGEXP_SUBSTR (val, '[^,]*', 1, 5) pos5
    FROM (SELECT 'AAA,BBB,,DDD,,FFF' val FROM dual);
    POS P POS P P
    AAA   BBB
    SELECT
       REGEXP_SUBSTR (val, '[^,]+', 1, 1) pos1
      ,REGEXP_SUBSTR (val, '[^,]+', 1, 2) pos2
      ,REGEXP_SUBSTR (val, '[^,]+', 1, 3) pos3
      ,REGEXP_SUBSTR (val, '[^,]+', 1, 4) pos4
      ,REGEXP_SUBSTR (val, '[^,]+', 1, 5) pos5
    FROM (SELECT 'AAA,BBB,,DDD,,FFF' val FROM dual);
    POS POS POS POS P
    AAA BBB DDD FFFAs you can see neither of the calls works correctly. Does anyone know how to modify the regular expression pattern to handle null values? I've tried various other patterns but was unable to get anyone to work for all cases.
    Thanks,
    Martin
    http://www.ClariFit.com
    http://www.TalkApex.com

    Hi, Martin,
    This does what you want:
    SELECT
       RTRIM (REGEXP_SUBSTR (val, '[^,]*,', 1, 1), ',') pos1
      ,RTRIM (REGEXP_SUBSTR (val, '[^,]*,', 1, 2), ',') pos2
      ,RTRIM (REGEXP_SUBSTR (val, '[^,]*,', 1, 3), ',') pos3
      ,RTRIM (REGEXP_SUBSTR (val, '[^,]*,', 1, 4), ',') pos4
      ,RTRIM (REGEXP_SUBSTR (val || ','
                          , '[^,]*,', 1, 5), ',') pos5
    FROM (SELECT 'AAA,BBB,,DDD,,FFF' val FROM dual);The query above works in Oracle 10 or 11, but in Oracle 11, you can also do it with just REGEXP_SUBSTR, without using RTRIM:
    SELECT
       REGEXP_SUBSTR (val, '([^,]*),|$', 1, 1, NULL, 1) pos1
      ,REGEXP_SUBSTR (val, '([^,]*),|$', 1, 2, NULL, 1) pos2
      ,REGEXP_SUBSTR (val, '([^,]*),|$', 1, 3, NULL, 1) pos3
      ,REGEXP_SUBSTR (val, '([^,]*),|$', 1, 4, NULL, 1) pos4
      ,REGEXP_SUBSTR (val, '([^,]*),|$', 1, 5, NULL, 1) pos5
    FROM (SELECT 'AAA,BBB,,DDD,,FFF' val FROM dual);The problem with your first query was that it was looking for sub-strings of 0 or more non-commas. There was such as sub-string. consisting of 3 characters, starting at position 1, so it returned 'AAA', as expected. Then there was another sub-string, of 0 characters, starting at position 4, so it returned NULL. Then there was a sub-string of 3 characters starting at position 5, so it returned 'BBB'.
    The problem with your 2nd query was that it was looking for 1 or more non-commas. 'DDD' is the 3rd such sub-string.
    Edited by: Frank Kulash on Feb 16, 2012 11:36 AM
    Added Oracle 11 example

  • Get Managed Metadata (Taxonomy) ALL Lists with Columns and ALL Choice Lists with Columns VALUES programmatically

    Hi there,
    How to get Managed Metadata Lists  ALL Columns and ALL Choice Lists Columns that are used in the Site Collection programmatically please.
    Regards

    Hi sharepointaju,
    Managed Metadata list is a hidden list, that you can access it through
    http://siteurl/Lists/TaxonomyHiddenList/AllItems.aspx, then it is similar to other lists, you can use server or client code to interate each field in the list, show the the value for each item.
    For all choice list columns, I'm not clear what you mean in this situation, do you mean to get all choice columns in the site collection, if so, iterate site columns, and lists to get list fields, check whether it is a choice type field.
    This may be not your requirement, please provide more information how you want to get which value.
    Thanks,
    Qiao Wei
    TechNet Community Support

  • Passing Multiple Selected List Items to a "New Item" Form in Another List with Multiselect Lookup Field

    Hi!
    Version Info:  SharePoint 2013 Server Standard (*BTW...I do not have access to Visual Studio*)
    I have two lists, let's call them
    -Assets
    -Asset Checkouts
    "Assets" is the parent list, and "Asset Checkouts" has a lookup column (multiselect) which is tied to the serial # column in the "Assets" list.
    Basically, what I need to accomplish is this:  I would like to be able to select multiple list items in the "Assets" list, and create a new item in "Asset Checkouts", and pre-fill the multiselect lookup column in the NewItem form
    for "Asset Checkouts" with the values from the selected items in "Assets".
    Any ideas or suggestions on how to do this would be most appreciated!
    Thanks!

    Hi,     
    According your description, you might want to add new item in "Asset Checkouts" list when selecting items in "Assets" list.
    If so, we can achieve it with SharePoint Client Object Model.
    We can add a button in the "Assets" list form page, when selecting items, we can take down the values of columns of the selected items, then click this button which will create
    new item in "Asset Checkouts" list with the values needed.
    Here are some links will provide more information about how to achieve it:
    Use
    SP.ListOperation.Selection.getSelectedItems() Method to get the list items being selected
    http://msdn.microsoft.com/en-us/library/ff409526(v=office.14).aspx
    How to: Create, Update, and Delete List Items Using JavaScript
    http://msdn.microsoft.com/en-us/library/office/hh185011(v=office.14).aspx
    Add ListItem with Lookup Field using Client Object Model (ECMA)
    http://notuserfriendly.wordpress.com/2013/03/14/add-listitem-with-lookup-field-using-client-object-model-ecma/
    Or if you just want to refer to the other columns in "Assets" list when add new item in "Asset Checkouts" list, we can insert the "Assets" list web part into the NewForm page
    of the "Asset Checkouts" list, then when we add new item in the "Asset Checkouts" list, we will be able to look through the "Assets" list before we select values for the Lookup column.
    To add web part into the NewForm.aspx, we need to find the button "Default New Form" from ribbon under "List" tab, then we can add web part in the NewForm.aspx.
    In the ribbon, click the button “Default New Form”:
    Then we can add web part into NewForm.aspx:
    Best regards
    Patrick Liang
    TechNet Community Support

  • Help with Multiselect List Item

    Assuming one employee can work for multiple departments, I want to display the departments employee 7844 works for preselected in a multiselect list.
    I am using the following query statement in a report region.
    select htmldb_item.select_list_from_query_xl(1, deptno ,'select DEPTNO,DNAME from scott.dept ','MULTIPLE HEIGHT=25', 'Y',null,null,null,'Department',null) a from scott.emp where empno = 7844
    The result I am seeing is a multiple multiselect lists with one department selected in each list.
    How should I modify the query to get what I want?
    Thanks
    Mina

    Hi Carlos,
    I set up a test case in exactly the same way and it worked fine for me. I created a page item called P1_DA_DEMO and added some static select list values then added some help text. The settings I used are below, I suggest you try again but also make sure you have no other Javascript errors on the page. Use a tool like firebug to check.
    Name : Dynamic Action Demo
    Sequence: 10
    Even: Click
    Selection type: Item(s)
    Item(s): P1_DA_DEMO <- a selection list item
    Condtion: - No Condition -
    True Actions
    Sequence: 10
    Action : Execute JavaScript Code
    Fire when event result is :True
    Fire on page load: Not Ticked
    Code: javascript:popupFieldHelp('277938589795252851','1545903379570909')
    Event Scope set a s Bind.
    Thanks
    Paul

  • Populating select list in a JSP with enumeration values

    I'm working on a JSP in which I need to populate a select list with enumeration values.
    Everytime I'm trying to insert these values (using enum.nextElement()) in a select box only the first enumerated value gets inserted correctly, the rest of the values shows up outside the select list. I would appreciated any help...thanks!!!

    I'm not exactly sure how your generating your list to begin with, however the following code will work:
    <form>
    <select>
    <%
         java.util.Vector v = new java.util.Vector();
         for(int i=0;i<12;i++){
              v.addElement(new Integer(i));
         java.util.Enumeration enum = v.elements();
         while(enum.hasMoreElements()){
         Object obj = enum.nextElement();
         out.println("<option name='"+obj+"'>"+obj+"</option>");
    %>
    </select>
    </form>Anthony
    BTW does anyone know why the greater than symbol never renders properly in these forums when text is encapsulated in the code tag?
    pre:
    >code:
    >

  • Initialising a list, with values - how to?

    Hi
    I want to create a list with some values already in it - how do you do this? I know the constructor is
    List<Integer> = new ArrayList<Integer>();
    but how would I create a new list already containing the following values at construction time?:
    [244753217,613613369,415120695,355142652,134856040,478060706,331972076, 532347366,600207262]
    Many thanks, Ron

    Hi
    Yes, but could you add all the numbers at once, and
    my question is really in regard to initialising the
    list in the first place!No it isn't. You think it is but it isn't.
    There is a constructor whereby you can feed ArrayList another Collection and it will add the items of that collection to it's own list when it is constructed.
    Of course you still have to initialize A collection at some point to do that. Which means in the end that you have to add items to a collection. So it all comes back to you really needing to do this at intialization and the answer is in the end you can't. But as I said you don't HAVE to do this and if you think you must you are mistaken.
    If you continue to insist that you MUST do this then please post some formatted code that explains why and we can point out the flaws in your thinking.

  • How to unselect an item in a multiselect list?

    Hi all,
    I am displaying a static lov as a multiselect list. And when I select the item in the list, the item is highlighted and I am displaying a region. Now I need to unselect that item and hide the corresponding region. No database transaction is involved. Can anyone please give me some hints?
    Rgds,
    Suma.

    When you use a select list that allows for multiple selections, the "value" attribute is only the first one selected.
    For example, if you had 3 options on the list with their "value" attributes set as "A", "B" and "C" and selected A and C, alert(document.getElementById("xxx").value) would display "A" not "A;C".
    What you need to do is to loop through each of the options and see if its "selected" value is "true". Something like:
    function testForSelected()
    var i;
    var x = document.getElementById("X");
    var o;
    for (i = 0; i < x.options.length; i++)
    o = x.options;
    if (o.value == "A" && o.selected == true)
    alert("A is selected");
    Where "X" is the multiselect list and "A" is the value of the option item you want to test for. Replace alert(...) with your show/hide function call.
    Regards
    Andy

  • Pre-populating a date/time column with the value entered in the last added item

    I have a list with a column called "expected finish date". Whenever the user adds the very first item in a list, he/she should have to enter a value for this column.
    I want to make all new item entries to pre-poplate this field with the value entered in the previously added item. This way, he/she wont have to re-enter the date every time (which rarely changes). How can this be done?

    could create a second list ("state") with column ("default finish date")...
    create a workflow on main list... if column is blank/empty, pull from second list... otherwise, update second list with the value that was entered.
    Or, customize the form (InfoPath or JavaScript)
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • How to make a select list to return value to numeric column?

    I do have a select list with static values (STATIC:01;0,02;1,03;2,04;3,05;4,06;5,07;6,08;7,09;8,10;9). The problem is that I am returning a value to a numeric column. Therefore I have set 'Post Calculation Computation' as "to_number(:P73_MRGRATING, 9);" however I am getting ORA-01722: invalid number. How, (or when and where) to properly convert a character from a select list representing a numeric value into column of NUMBER data type?
    Thank you for your time.
    DanieD

    Sergio,
    It is because I am not able convert a value in a page item (:P73_ID) to number. On a page before, I have assigned a value to an application item (APPL_ID). On page 73, I want to assign the value in APPL_ID to the page item P73_ID . The value assigned to APP_ID is numeric. On a page 73 I also have a computation in Page processing section. It is an 'After Submit' processing of a static assignment of application item APPL_ID to page item P73_ID. Unfortunately it does not work. (ORA-01722: invalid number). I have tested this also with a 'Post Calculation Computation' on page item P73_ID (to_number(:P73_ID, 9999999999);) and I am still getting ORA... error. Only way I can make it work is to create a page item P73_ID as a text field, then when I run page 73 and enter a value into P73_ID manually - then it works and I can save the values from the form into database...
    The strange thing is that I am using application item APPL_ID on a couple of pages, in where clauses and it always works, even when I am comparing APPL_ID against a numeric value like select * from a_table where some_number = :APPL_ID, this works. But when I would like to create an entry form and assign application item APPL_ID to the page item P73_ID that is referencing a numeric table column – then I am getting ORA-01722…
    Is there any application (sample application) that is doing this and it works so I can check it and learn how to create this process appropriately?
    Thank you for your time.
    DanielD

  • ApEx How 2  turn a multiselect list value (eg. 1:2:3:4 ) into (1,2,3,4)

    ApEx newbie here,
    I'm trying to get the output of a multi select list into an in list of a sql query for a report. The error message I'm getting is report error:
    ORA-01722: invalid number. (The inlist is a list of id numbers, and the data type for this column in the database is NUMBER)
    I've got a page item called P3_x which is populated from a MultiSelect list. I learned that these come out as colon delimited strings. (found a reference to hidden items in a blog that helped me figure this out)
    So I created a hidden item called P3_x_in_list which does this:
    Select '('|| regexp(:p3_x,':',',')||')' from dual which turns this into a comma separated list, like so: (1,2,3,4)
    I put this hidden item, P3_X_IN_LIST into the sql in my report region
    So in the report my sql looks like:
    select a, b, c
    from t1
    where id in: P3_x_in_list
    and some_date between :P1_X and :P2_X
    For some reason it throws an invalid number error when it runs. I haven't been able to find anything in the documentation or on the web that sheds any light on this. I'm hoping that there is a benevolent, experienced developer that can point me in the right direction. The debuging information from the page is below:
    Here is the debugging information
    0.24: ...Session State: Save "P3_X" - saving same value: "1:2:3:4:5"
    0.24: ...Session State: Save "P1_X" - saving same value: "01-DEC-2008"
    0.24: ...Session State: Save "P2_X" - saving same value: "04-DEC-2008"
    0.30: ...Session State: Save Item "P3_X_IN_LIST" newValue="(1,2,3,4,5)" "escape_on_input="N"
    0.30: Processing point: ON_SUBMIT_BEFORE_COMPUTATION
    0.46: show report
    0.46: determine column headings
    0.46: parse query as: my_schema
    1.76: binding: ":P3_X_IN_LIST"="P3_X_IN_LIST" value="(1,2,3,4,5)"
    2.64: binding: ":P2_X"="P2_X" value="04-DEC-2008"
    report error:
    ORA-01722: invalid number
    ORA-02063: preceding line from my_schema
    3.23: Computation point: AFTER_BOX_BODY
    3.23: Processing point: AFTER_BOX_BODY
    3.23: Computation point: BEFORE_FOOTER
    3.23: Processing point: BEFORE_FOOTER
    3.23: Show page tempate footer

    Well, let's say you had a SQL statement like
    select * from obj where object_id in 12345
    where object_id is defined to be a number type.
    Now, if you replace the literal '12345' with a bind variable and then bind "(1,2,3,4,5)" to this bind variable it will be clear why the SQL fails.
    As for using pipeline functions it is pretty straightforwad
    Here's an example
    CREATE OR REPLACE TYPE vc_array_1 AS TABLE OF VARCHAR2 (50);
    CREATE OR REPLACE FUNCTION get_list (
       p_string      IN   VARCHAR2,
       p_delimiter   IN   VARCHAR2 DEFAULT ':'
       RETURN vc_array_1 PIPELINED
    IS
        l_string     varchar2(32000);
        l_array     wwv_flow_global.vc_arr2;
    BEGIN
       l_array := apex_util.STRING_TO_TABLE(p_string,p_delimiter);
       for i in l_array.first..l_array.last loop
          pipe row (trim(l_array(i)));
       end loop;
       return;
    end;
    select column_value from table (get_list('1:2:3:4:5'));Your query can now be
    select a, b, c
    from t1
    where id in (select column_value from table get_list(: P3_x_in_list)) )   
    and some_date between :P1_X and :P2_XVarad

Maybe you are looking for

  • Hyperlinks in PDF, WORD, PPT not working in Safari on iPad

    We have an intranet we are serving up for use on the iPad. The links to other documents in PDF, WORD, PPT work on my pc and laptop but not in the iPad. I have looked to see of there is a setting but the only thing I found was to allow pop ups which o

  • Itunes wont load and i'm getting a conflict with my PC it has knocked my dvdrw out

    hi i have bought a new pc with windows 7 on it 64bit version and i tried to connet my ipods and install itunes i keep getting there is a confilcting issuse with itunes and windows 7 so it will not let me install it if i do it knocks my dvdrw out and

  • AirBrowser - How to clear existing session value?

    Hi, We face the below mentioned problem. Would be great if someone could help us. Due to problems with uploading the attachment here, please send a email to the following email-id ([email protected]) and I shall send the attachment in response. WEBKi

  • NAT holes in Solaris 10 x86

    I am using the bundled IPFILTER software on Solaris 10 x86. I find quite a few random requests going out on the external interface with an internal IP address (those requests are not being NAT-ed). This does not happen with all requests though.. only

  • Formating string inside email body

    Hi All How can I format the text that it will be placed in lines at the same level regardless of their length I have several lines with several length ,that will be sent per mail. for example cost per shirt                    100 cost per trousers