Multiselection in a T-list

When I use a T-list, I can select only one item at once.So, how could I do that this T-list let me select more than one at time applying 'Shift' or 'Ctrl' whit mouse or 'key-down'/'key-up' ?

It is possible to use a Pluggable Java Component to do this.
Here's the code for an ehnaced version of the TList that allows MultiSelect and makes a list of the selected values available in a Custom Property called LIST_SELECTION.
You enable Multselect by calling the Custom property ENABLE_LIST_MULTISELECT witht he value 'TRUE' using SET_CUSTOM_PROPERTY().
A fully packaged version of this code will be availble off of the otn.oracle.com/products/forms pages soon, but I thought I'd put the source here for anyone who's brave:
-------- Code for EnhancedTList.java -----
// Copyright (c) 2001 Oracle Corp
package oracle.forms.demos.enhancedwidgets;
import oracle.forms.ui.*;
import oracle.forms.properties.ID;
import java.util.StringTokenizer;
* <H3><FONT COLOR="#002299">Pluggable Java Components for Oracle Forms Server 6<I>i</I></FONT></H3>
* This class is a Pluggable Java Component for Oracle Forms, that implements
* a method for setting UI properties on an instance by instance basis that would
* not normally be allowed
* Also allows multi-select TList for use in Picker controls etc.
* The class implements the following Custom properties for the programmer to
* use on a Tlist:
* <ul><li>INSTANCE_ENABLED</li>
* <li>INSTANCE_DISPLAYED</li>
* <li>ENABLE_LIST_MULTISELECT</li>
* <li>LIST_SELECTION</li>
* <li>CLEAR_LIST_SELECTION</li></ul>
* @version 1.0 24/June/2001 created<br>
* @author Duncan Mills
public class EnhancedTList extends VTList
private boolean debugOn = false;
private String debugClassName = null;
* Constructs a new instance.
public EnhancedTList()
super();
* Implimentation of setProperty in the IView interface
* @param pid property to be set
* @param value new value of the property
* @return true (if the property could be set), false otherwise
* @see IView
public boolean setProperty(ID pid, Object value)
if ( pid == EnhancedWidgets.INSTANCE_ENABLED )
PJCUtil.log(debugOn, debugClassName, "setting INSTANCE_ENABLED to " + PJCUtil.toBoolean(value,true));
this.setEnabled(PJCUtil.toBoolean(value,true));
else if ( pid == EnhancedWidgets.INSTANCE_DISPLAYED )
PJCUtil.log(debugOn, debugClassName, "setting INSTANCE_DISPLAYED to " + PJCUtil.toBoolean(value,true));
this.setVisible(PJCUtil.toBoolean(value,true));
else if (pid == EnhancedWidgets.ENABLE_LIST_MULTISELECT)
PJCUtil.log(debugOn, debugClassName, "setting ENABLE_LIST_MULTISELECT to " + PJCUtil.toBoolean(value,true));
this.setMultipleMode(PJCUtil.toBoolean(value,false));
else if (pid == EnhancedWidgets.LIST_SELECTION)
this.deselectAll();
StringTokenizer tok = new StringTokenizer(value.toString(),",");
while (tok.hasMoreElements())
try
this.select(Integer.parseInt(tok.nextToken())-1);
} catch (NumberFormatException e)
return false;
else if (pid == EnhancedWidgets.CLEAR_LIST_SELECTION)
this.deselectAll();
else if (pid == EnhancedWidgets.DEBUGMESSAGES)
debugOn = PJCUtil.toBoolean(value,false);
if (debugOn)
debugClassName = getClass().getName();
else
return super.setProperty(pid, value);
return true;
* Implimentation of getProperty in the IView interface
* @param pid property to be set
* @return the value of the property
* @see IView
public Object getProperty(ID pid)
if (pid == EnhancedWidgets.LIST_SELECTION)
if (this.getSelectedIndexes().length > 0)
StringBuffer returnList = new StringBuffer();
for (int i = 0; i < this.getSelectedIndexes().length; i++)
returnList.append((this.getSelectedIndexes() + 1) + ",");
return returnList.toString().substring(0,(returnList.length()-1));
else
return new String("");
else
return super.getProperty(pid);
-------- Code for PJCUtil.java -----------
// Copyright ( c) 2001 Oracle Corp
package oracle.forms.demos.enhancedwidgets;
* Utility class for Forms PJCs.
* <P>
* @author Duncan Mills
final class PJCUtil extends Object
* Converts a string value containing TRUE or FALSE
* as a string to the equivilent boolean
* @param value String containing the words True or false in any case or the Forms Constants PROPERTY_TRUE/PROPERTY_FALSE
* @return boolean value of the value
protected final static boolean toBoolean(Object value, boolean defaultValue)
boolean RC = defaultValue;
if (value.toString().equalsIgnoreCase("false")&#0124; &#0124;value.toString().equals("5"))
RC = false;
else if (value.toString().equalsIgnoreCase("true")&#0124; &#0124;value.toString().equals("4"))
RC = true;
return RC;
* Outputs the specified message to the Java Console
* if Debug is enabled
* @param debugOn boolean flag to indicate if debug is on
* @param debugClass Classname of the class being debugged
* @param debugMessage String to display
protected final static void log(boolean debugOn, Object debugClass, String debugMessage)
if(debugOn)
System.out.println(debugClass.getClass().getName() + ": " + debugMessage);

Similar Messages

  • Automatic population of multiselect based on select list

    Hi,
    I have an issue in populating in multiselect from the data in select list.
    Let me take an example and explain.
    I have 3 tables: Employee, Department and a linking table for employee and department.
    The select list contains employee and department is a multiselect. On selection of Employee, all the departments should be displayed and the department to which employee belongs(which is taken from the linking table) should be selected (High-Lighted). How do I do this?

    Hi,
    I am trying this on three tables…DEPT, EMP, DEPT_EMP wit a select list(P1_EMP) and a multiselect (P1_DEPT).
    Dept has two columns (ID and Deptname). It has two rows.
    DEPT
    Id |Deptname
    1. HR
    2. OPERATION
    Emp has two colums (ID and Empname)
    EMP
    Id|Empname
    1. Jason
    2. Pam
    Dept_Emp has three columns (ID, Employee ID which refers to the EMP.ID, DeptID which refers to the DEPT.ID)
    DEPT_EMP
    Id| Employeeid | DeptId
    1. 1 1
    2. 2 2
    As shown , Jason belongs to HR and Pam belongs to OPERATION.
    I have tried the following steps:
    1. OnChange of Employees drop down list(P1_EMP), I have called a javascript function.
    <script type="text/javascript">
    function getDepartments(filter, listName)
    var employee = filter.value;
    var list = document.getElementById(listName);
    var listvalue = list.value;
    var get = new htmldb_Get(null,$v('pFlowId'), 'APPLICATION_PROCESS=GET_DEPARTMENTS_FOR_EMP',0);
    get.add('G_EMPLOYEE', employee);
    ret = get.get('XML');
    if(ret)
    var s = ret.getElementsByTagName("select");
    if(s){
    var o = ret.getElementsByTagName("option");
    var oCount = o.length;
    list.options.length = 0;
    var i=0;
    while(i<oCount)
    var l_Opt_Xml = o [ i ];
    appendToSelect(list, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue);
    i=i+1;
    list.value = listvalue;
    if (list.selectedIndex == -1)
    list.selectedIndex = 0;
    get = null;
    function appendToSelect(pSelect, pValue, pContent) {
    var l_Opt = document.createElement("option");
    l_Opt.value = pValue;
    if(document.all){
    pSelect.options.add(l_Opt);
    l_Opt.innerText = pContent;
    } else {
    l_Opt.appendChild(document.createTextNode(pContent));
    pSelect.appendChild(l_Opt);
    </script>
    2. The Javascipt function calls in a application process(GET_DEPARTMENTS_FOR_EMP) and I have also created an application item(G_EMPLOYEE) for the same.
    declare
    begin
    owa_util.mime_header('text/xml', FALSE );
    htp.p('Cache-Control: no-cache');
    htp.p('Pragma: no-cache');
    owa_util.http_header_close;
    htp.prn('<data>');
    htp.prn('<select>');
    for rec in (
    select distinct "DEPT"."Deptname" d, "DEPT"."ID" r
    from "DEPT","DEPT_EMP "
    where " DEPT_EMP "."DeptID"="DEPT"."ID"
    and " DEPT_EMP "."EmployeeID"=:G_EMPLOYEE
    order by 1
    loop
    htp.prn('<option value="' || rec.r || '">' || rec.d || '</option>');
    end loop;
    htp.prn('</select>');
    htp.prn('</data>');
    end;
    The employee multiselect(P1_EMP), initially has a “Select employee”. Upon selecting Jason, it should show, all departments and highlight HR. The same for Pam.
    But it is showing only the departments for the employee. If I modify the application process query to show all employees in that department, how do I highlight only that employee?
    Edited by: 841762 on Mar 7, 2011 1:50 AM

  • Multiselect (or just select) list limit

    Hi There,
    Does anyone know if there is a limit to the number of items than can be submitted when using a multiselect (or a shuttle).
    I have a query that returns hundreds of values (all valid). The user is going to need to select 1,2,5... all the way to ALL of these items to be used in another query.
    When I select ALL returned items, I get a browser error (Web page cannot be found - Error 400). This is in IE 8 (I know, I know, not my choice!!).
    Thoughts?
    My shuttle is based on a dynamic LOV which seems to be operating correctly.
    Pete

    The problem is in the URL limitation. all the values of the list will be passed in the URL and in this case will exceed the URL length limit... I am trying somethin that may help
    Sam

  • Large Select List fails with ORA-6502

    Creating a large select list with htmldb_item.select_list_from_query_xl causes an ORA-6502 when the resulting select list contents are larger than an arbitrary value.
    For example, if the query for the select list returns a display value of up to 50 characters and a numeric id return value of up to 10 digits, we have to arbitrarily include "where rownum < x" (where x is some arbitrary value) in the query to get results; otherwise when the page is run we get the ORA-6502.
    For regular select lists with long results we can get around the problem using htmldb_item.popup_list_from_query but to generate multiselect lists we have to use the htmldb_item.select_list_from_query_xl an include the attribute "multiple".

    Can we get that added to the API documentation? The spec simply states the function returns a CLOB, implying that it would support the max size of a CLOB supported by the database (4GB in 9iR2 as I recall).
    Granted, one should not expect a 4GB web page to be returned using the function call, but a page larger than 32KB isn't entirely unreasonable, especially since this product is geared towards intranet and departmental apps (ie corporate LAN environment).
    An alternative enhancement would be to implement multiselects via the popup list mechanism, allowing users to select multiple items as they "page" or search thru the values for that field.

  • Apex_item select list to be displayed with multiple default values

    I am using APEX 4.2.
    For one of our requirements , we are displaying a report which uses "apex_item.select_list_from_query" multiselect field.
    The above function accepts a parameter, 'p_value' using which we can specify the default value to be highlighted.
    Is there any way to highlight multiple values on the select list by default, when the page is loaded, based on a sql output.
    Sample Scenario:
    Say colour is a multiselect field. Full list of values available : R, B, G, Y, O
    On day1, for record1 i am choosing R and B. which I am saving in the backend when the page is submitted.
    On day2 : I login again to see the report. When the report is loaded, I should see the values 'R' and 'B' highlighted or in a different font format , differentiated from the rest.
    Thanks in advance for your replies.
    Regards,
    Raasi
    Edited by: 878815 on Mar 11, 2013 10:23 PM

    878815 wrote:
    I am using apex_item.select_list_from query. and then a piece of javascript to concatenate as a colon delimited string. This is the function I am using in the report sql,
    apex_item.hidden(20,null)||apex_item.select_list_from_query(6,null,'<sql>','multiple size = "6" onChange="Multi(this)"','NO' ) as col_1I think 'multiple size' is a custom attribute and APEX have no clue about it.
    javascript code:
    function Multi(p_this)
    var l_selected=html_SelectValue(p_this);
    if (l_selected.constructor == Array) l_selected=l_selected.join(':');
    p_this.parentNode.firstChild.value = l_selected;
    return l_selected;
    };What is this apex_item.hidden used for.. placeholder?
    May be populate the hidden item with default value as colon delimited string and on page load use some JavaScript to read that string and set/highlight the select list.
    It would be easy if you can replicate the issue on apex.oracle.com

  • Saving multiple images at one time to a different folder

    Is there a script available that can save multiple pictures upon completion of editing to a different output folder of my choice other than the source folder all at the same time? Example I open 11 different photos from source folder x, I edit said 11 pictures and now want to save all 11 pictures to output folder xy all at the same time.  What I want to prevent is having to click save as select new folder for each and every picture I have open.

    Does this help?
    /* save open documents to location */
    /* 2013, use it at your own risk */
    if (app.documents.length > 0) {
              var myDocument = app.activeDocument;
    /* create dialog */
              var dlg = new Window('dialog', "select files", [500,300,830,565]);
    /*create list of open files, thanks to paul r */
    dlg.fileList = dlg.add('listbox', [15,15,315,220], 'field', {multiselect: true});
    /* populate the list with the open files’ names */
    for (var o = 0; o < app.documents.length; o++) {
              dlg.fileList.add ("item", app.documents[o].name);
              dlg.fileList.items[o].selected = true
    /* buttons for ok, and cancel */
              dlg.buildBtn = dlg.add('button', [13,230,160,255], 'OK', {name:'ok'});
              dlg.cancelBtn = dlg.add('button', [170,230,317,255], 'Cancel', {name:'cancel'});
              dlg.center();
    /* show the window */
              var myReturn = dlg.show ();
              if (myReturn == true) {
    /* get the selcted ones */
              var theSelected = new Array;
              for (var p = 0; p < dlg.fileList.items.length; p++) {
                        if (dlg.fileList.items[p].selected == true) {
                                  theSelected = theSelected.concat(app.documents[p])
    /* folder selection */
              var theFolder = Folder.selectDialog("select a folder");
              if (theFolder) {
                        var thePath = theFolder.fullName;
                        psdOpts = new PhotoshopSaveOptions();
                        psdOpts.embedColorProfile = true;
                        psdOpts.alphaChannels = true;
                        psdOpts.layers = true;
                        psdOpts.spotColors = true;
    /* save the psds */
                        for (var m = 0; m < theSelected.length; m++) {
                                  app.activeDocument = theSelected[m];
                                  var theDoc = app.activeDocument;
                                  try {var basename = theDoc.name.match(/(.*)\.[^\.]+$/)[1]}
                                  catch (e) {var basename = theDoc.name};
                                  if (File(thePath+'/'+basename+".psd").exists == false) {
                                            theDoc.saveAs((new File(thePath+'/'+basename+".psd")),psdOpts,false);
      theDoc.close()
                                  else {alert ("a file named "+basename+".psd"+" already exists in that folder")}

  • User Report Generation

    Hi,
    I want to generate a user report which lists out the all the Users being assigned to more than one resource(for Eg. LDAP,NT resource).Now with the available User Report we can generate a user report which lists out the users being assigned to only one resource either LDAP or NT etc.
    Hence I am customizing the User Report form by replacing the Mulstiselect component in place of Select (single ) componenet. But here I am getting one exception that "equals operator expects a String Operand" , as the MultiSelect component returns a list object.I am not understanding where exactly I have to do the modification to satisfy My requierement..
    Can any one help me to solve my problem ASAP.it is bit urgent for me.
    Waiting for ur replies.
    Thanks in advance.

    Assuming that all users will be assigned at least one common role, you can use the code segment below.
    This will return the names of all users who are assigned that particular role. In this case it is 'Sample Role'
    You have to make changes under the attibute 'role' in line 70 for it to work. Subsitute the ObjectRef tag attributes with the id and name of the role that u have created.
    I notice that this is not returning the role name properly, only the waveset accountId. If you figure out how to overcome this, let me know.
    Copy the code snippet, make the needed changes as mentioned above and save as .xml file. Import it, and u shld see the 'Custom Report' in your reports tab.
    Tell me if this helps.
    Rgds.
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE TaskTemplate PUBLIC 'waveset.dtd' 'waveset.dtd'>
    <TaskTemplate authType='UserReportTask' name='Custom Report' taskType='Report' visibility='invisible'>
      <TaskDefinitionRef>
        <ObjectRef type='TaskDefinition' id='#ID#TaskDefinition:UserSummary' name='User Report' displayName='UI_REPTS_XML_USER_TITLE'/>
      </TaskDefinitionRef>
      <Variables>
        <Object>
          <Attribute name='attrMapField'>
            <Map>
              <MapEntry key='accountId' value='UI_REPTS_XML_REPORT_ATTR_ACCOUNTID'/>
              <MapEntry key='attributes.firstname' value='UI_ATTR_FIRSTNAME'/>
              <MapEntry key='attributes.fullname' value='UI_ATTR_FULLNAME'/>
              <MapEntry key='attributes.lastname' value='UI_ATTR_LASTNAME'/>
              <MapEntry key='disabled' value='UI_ATTR_DISABLED'/>
              <MapEntry key='email' value='UI_ATTR_EMAIL'/>
              <MapEntry key='organization' value='UI_ATTR_ORGANIZATION'/>
              <MapEntry key='passwordExpiry' value='UI_ATTR_PASSWORDEXPIRY'/>
              <MapEntry key='resources' value='UI_ATTR_USER_RESOURCES'/>
              <MapEntry key='role' value='UI_ATTR_ROLE'/>
            </Map>
          </Attribute>
          <Attribute name='attrsToDisplay'>
            <List>
              <String>accountId</String>
              <String>resources</String>
            </List>
          </Attribute>
          <Attribute name='defType' value='Report'/>
          <Attribute name='definition' value='User Report'/>
          <Attribute name='description'/>
          <Attribute name='id'/>
          <Attribute name='maxRows' value='500'/>
          <Attribute name='organizations'>
            <List>
              <String>Top</String>
            </List>
          </Attribute>
          <Attribute name='queryAttr'>
            <Object>
              <Attribute name='MemberObjectGroups'>
                <Object>
                  <Attribute name='enabled' value='false'/>
                  <Attribute name='operator' value='contains'/>
                  <Attribute name='useId' value='true'/>
                </Object>
              </Attribute>
              <Attribute name='Name'>
                <Object>
                  <Attribute name='enabled' value='false'/>
                  <Attribute name='operator'/>
                  <Attribute name='value'/>
                </Object>
              </Attribute>
              <Attribute name='Name2'>
                <Object>
                  <Attribute name='enabled' value='false'/>
                  <Attribute name='operator'/>
                  <Attribute name='value'/>
                </Object>
              </Attribute>
              <Attribute name='prov'>
                <Object>
                  <Attribute name='enabled' value='false'/>
                  <Attribute name='operator' value='equals'/>
                  <Attribute name='value'/>
                </Object>
              </Attribute>
              <Attribute name='role'>
                <Object>
                  <Attribute name='enabled' value='true'/>
                  <Attribute name='operator' value='contains'/>
                  <Attribute name='useId' value='true'/>
                  <Attribute name='value'>
                    <ObjectRef type='Role' id='#ID#AA5BF1A362ED9128:723321F7:1058AAB9219:-7FDD' name='Sample Role'/>
                  </Attribute>
                </Object>
              </Attribute>
              <Attribute name='user_resources'>
                <Object>
                  <Attribute name='enabled' value='false'/>
                  <Attribute name='operator' value='equals'/>
                  <Attribute name='useId' value='true'/>
                  <Attribute name='value'/>
                </Object>
              </Attribute>
            </Object>
          </Attribute>
          <Attribute name='sendemail' value='false'/>
          <Attribute name='summary' value='Lists all users having more than one resource assigned to them'/>
          <Attribute name='task'>
            <Object>
              <Attribute name='taskName' value='Custom Report'/>
            </Object>
          </Attribute>
          <Attribute name='title' value='Custom Report'/>
        </Object>
      </Variables>
      <Description>Lists all users having more than one resource assigned to them</Description>
      <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
      </MemberObjectGroups>
    </TaskTemplate>

  • Problem in getting selected values from multiselect list

    Hi,
    I have two multiselect listboxes in my page. In List1 the data will be retrieved from DB and listed.I will have buttons to move the values from List1 to List2 and viceversa.
    After selecting the needed values,I can rearrange them in List2 using some buttons. I have coded this moving and reordering using javascript.
    What happens is while submitting the page I want the values from list2 which are rearranged. But im getting the order in which I moved from list1 to list2.
    I am using html:selectfor both lists
    List1
    <html:select name="CustForm" property="custName" multiple="true" size="10">
           <html optionsCollection property="CustomerNames" value="custName" label="id"/>
    </html:select>I am having a customer form which has a arraylist CustomerNames. This arraylist has customer bean which has proeprties custName and id. The custForm also has a String custName.
    List2
    <html:select name="CustForm" property="selectedCustName" multiple="true" size="10">
           <html  option value=""/>
    </html:select> The custForm also has a String[] selectedCustNames from where I get the selected values in list2
    Please let me know what am I doing wrong here.

    use a treeSelectionListener, that will give you all the selection changes you need.
    thomas

  • How to get the selected values from multiselected list

    Hi,
    I have a multiselect list displaying all the years from 2003 to 2008 (used dynamic LOV). The user can choose one or more years as per his needs, and then when user clicks on the link the selected values of the list are to be captured and a pop up page of a Discoveror report needs to be opened where these years get passed as a parameter. I tried several methods to capture the value, but either one or all are getting passed but not exactly what the user has chosen.
    This is how it looks:
    P2_FISCAL_YEAR is a multiselect list containing values from 2003,2004... 2008
    If user chooses 2004 and 2007
    then I want the url to capture these values and pass as parameters for my discoveror reports. as '&qp_fiscal_year=2004,2007'
    Any help is appreciated!
    Thanks in advance,
    Sapna.

    Hi,
    I have a multiselect list displaying all the years from 2003 to 2008 (used dynamic LOV). The user can choose one or more years as per his needs, and then when user clicks on the link the selected values of the list are to be captured and a pop up page of a Discoveror report needs to be opened where these years get passed as a parameter. I tried several methods to capture the value, but either one or all are getting passed but not exactly what the user has chosen.
    This is how it looks:
    P2_FISCAL_YEAR is a multiselect list containing values from 2003,2004... 2008
    If user chooses 2004 and 2007
    then I want the url to capture these values and pass as parameters for my discoveror reports. as '&qp_fiscal_year=2004,2007'
    Any help is appreciated!
    Thanks in advance,
    Sapna.

  • Multiselect list in APEX 3.2.1.00.12

    Hello,
    I'm having troubles with a multiselect list that could potentially return a very large result set. I have a function called 'GET_LIST' that basically calls the apex_util.STRING_TO_TABLE(p_string,p_delimiter); function since the multiselect list returns a colon delimited string. If I try to select all of the values on the list I get the following message:
    Bad Request
    The request could not be understood by server due to malformed syntax.Are there any known workarounds to this issue?
    Thanks in advance!
    ~Jake

    Do any pros out there have a suggestion for this? My multiselect list has over 35,000 entries in it for certain owners. It is doubtful that anyone would ever select them all but if they should happen to they would receive an error.
    The list of values (P10_ACCTS) is simply
    select a.account_name d, a.account_id v
               from accounts a
             where a.owner = :P10_OWNERI then display a report that uses the results of the select list in the where clause:
    and (account.id in (select column_value from table (GET_LIST(nvl(:P10_ACCTS,'::'))))GET_LIST is defined as:
    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;I believe that my limitation is the 'l_string varchar2(32000);' I need (in some cases) to be able to pass over 100,000 characters. I've tried converting GET_LIST to use a clob instead of varchar2 but have yet to be successful in implementing that approach.
    THanks in advance!
    Edited by: jhammer on Oct 15, 2010 3:13 PM

  • 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

  • Delete in database based on multiselect list values

    Hi,
    I have a selectlist in Apex and a function in the database to do some delete based on the selected value from the select list.
    FUNCTION delete_batch (v_batch VARCHAR2) RETURN VARCHAR2
    IS
    BEGIN
    IF v_batch like 'M%'
    THEN
       RETURN ('A monthrun cannot be deleted');
    ELSE
       DELETE FROM so_disco_pa
       WHERE  batch = v_batch
       DELETE FROM so_batch_pa
       WHERE  batch = v_batch
       COMMIT;
       RETURN ('Batch '||v_batch||' has been deleted');
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
        RETURN ('Batch could not be deleted');
    END delete_batch;The package function is called when the delete button is clicked with following process:
    BEGIN
    DECLARE
    x   varchar2(100);
    BEGIN
    x := pa_control.delete_batch (:P3_BATCH);
    :F105_MESSAGE := x;
    END;
    END;Now I want to change the selectlist to a multiselect list so that multiple batches can be deleted.
    How do I change my procedure and process to delete batches based on the selected values?
    Thanks,
    Diana

    I got this so far, but only the first batch selected in the list is being deleted. The other selected batch values are not deleted.
    Some help please.
    FUNCTION delete_batch (v_batch VARCHAR2) RETURN varchar2
    IS
    T Apex_application_global.vc_arr2;
    BEGIN
    T := apex_util.string_to_table(v_batch);
    For I in 1..t.count loop
    IF  t(i) like 'M%'
    THEN
       RETURN ('A monthrun cannot be deleted');
    ELSE
       DELETE FROM so_disco_pa
       WHERE  batch = t(i)
       DELETE FROM so_batch_pa
       WHERE  batch = t(i)
       COMMIT;
       RETURN ('Batch '||v_batch||' has been deleted');
    END IF;
    end loop;
    EXCEPTION
    WHEN OTHERS THEN
        RETURN ('Batch could not be deleted');
    END delete_batch;

  • Need to create an edit Page from a Multiselect List

    I make one or more selections of values from a Multiselect List; I need to branch to another page in which I display all of the selected List items and two other columns (per item) that can be edited; i.e., this second page will look like one or more rows consisting of (1) List item, (2) value1 from a Table, (3) value2 from a Table. I need to be able to change value1 and/or value2 for any or all of the rows and have those changes reflected in the Database. (The List item is display only).
    My question is: which construction wizard can I use for this second page? I can collect my List items in a PL/SQL Table, but how can I display them and their related columns so the column values are editable?

    Thanks for the reply. I understand how to create Collections with the values I need to display and modify; however, I'm unsure which construction Wizard to employ to launch the Page ("Form based upon a Procedure", etc.)
    I looked in the Tutorials for a "collection demo" and found these potential candidates: "Build an Issue Tracking System", "Create a Simple Survey Application", and "Serving Application Express Reports". Is it one of these? If not, please tell me where I can find the "collection demo". Thanks.

  • 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

Maybe you are looking for