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

Similar Messages

  • Multiple Select List does not Refresh with Dynamic Action

    All,
    Scenario:
    Using APEX 4.2.2, I have a Select List page item (P4_SPONSOR) set to allow multiple values which has a dynamic LOV to populate the list.  What I would like to do is highlight the display values based on another page item's value (P4_DRIVER_ID).  When I set the source of P4_SPONSOR to static text, such as a delimited string of 1:2:3:4, any display values where the return values are equal to the static text are highlighted when the page loads.
    Problem:
    The problem lies in trying to use a query as a source for P4_SPONSOR which is filtered based on the other page item, P4_DRIVER_ID.  For instance, my SQL Query (returning colon separated values) returns the same as the static text noted above.  In the query's WHERE clause, I specify that the driver's ID is equal to P4_DRIVER_ID:
    SELECT sponsor_id
    FROM sponsors_drivers_xref
    WHERE driver_id = :P4_DRIVER_ID;
    This, as I understand it, would necessitate a refresh of P4_SPONSOR whenever the value of P4_DRIVER_ID changes.  So, I have a Dynamic Action that does just that.  When executed on the page, I can see the P4_SPONSOR multiple select list actually refresh, but none of the display values become highlighted.
    Thoughts?
    Thanks,
    -Seth.

    Seth,
    A dynamic action refresh of your select list will refresh the list of values (this is what you are seeing), it will not refresh the value of the item itself.  In fact, it will remove any values that you had already selected.  To refresh the value you will need to add additional dynamic actions.
    Create another dynamic action with:
    Event: After Refresh
    Selection Type: Item(s)
    Item(s): P4_SPONSOR
    If this was a normal select list you could just create a Set Value action and use your query to set the value of the select list.  Since this is a multiple select list your will need to get your colon delimited value first and then use some javascript to set the values of your select list.
    Create an hidden page item name P4_SPONSOR_TEMP.
    Add a true action to your new dynamic action:
    Action: Set Value
    Set Type: SQL Statement
    SQL Statement:
    SELECT sponsor_id
    FROM sponsors_drivers_xref
    WHERE driver_id = :P4_DRIVER_ID;
    Page Items to Submit: P4_DRIVER_ID
    Selection Type: Item(s)
    Item(s): P4_SPONSOR_TEMP
    Add another true action to your new dynamic action:
    Action: Set Value
    Set Type: JavaScript Expression
    JavaScript Expression:
    $("#P4_SPONSOR_TEMP").val().split(":")
    Selection Type: Item(s)
    Item(s): P4_SPONSOR
    --Jeff

  • Select MULTIPLE default values for a multiple selection list box based on another field in Infopath 2010

    Hello there - Before I explain my issue, I would like to point out that I have reviewed some other discussions on selecting default values for multiple selection listbox. But my issue is specific and different, and not answered by any of the discussions
    I visited.
    I have a multiple selection list box (say for example all countries in the world as values), and I would like to pre-select or setup multiple default values (say five countries) based on some criteria that I query from MS SQL database table.
    I know we can go to Data | Default Values option to setup one or many default values for multiple selection list box. When I enter the default values manually this works. I also right click the field under the Multiple-Selection List Box group, then select
    Add another Value Below and set the Default Value for this field to setup multiple default values.
    However, if I reference a field (either an infopath field or a field from SQL database) I am not able to setup multiple default values. Infopath automatically selects the last field I selected for all instances and in the end I am able to see only one
    default value selected instead of many. How to fix this problem? Why would infopath allow multiple default values when we enter it manually but not when we reference some fields?
    Please let me know if you need more info. Appreciate your help.
    Thanks!

    Hi redhotc,
    According to your description, my understanding is that you want to set multiple default values for a multiple checkbox list in InfoPath form.
    I did a test with SQL database table. I set three default values for the checkbox list by adding three values field under the group field(Data->Default values), each value field is for a default value. Then publish it to my SharePoint site, everything
    was fine.Please have a try as the below link:
    http://www.bizsupportonline.net/infopath2010/pre-select-items-multiple-selection-list-box-infopath-2010.htm
    Note: if you are using SQL databse table, you may need to enable ‘Allow cross-domain data access for user form templates that use connection settings in a data connection file’ in CA. More information, please refer to:
    http://answers.flyppdevportal.com/categories/sharepoint2010/sharepoint2010customization.aspx?ID=418b9423-a96c-4e5e-91f9-6a1b010ebb69
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • ALV Hierarichal display with multiple line headings

    Hi,
          I have designed an ALV report with Hierarichal display with multiple line headings...
    When i change the layout of this report,the headings which we enter manually will not take effect.The column we can hide in the report using the layout management.But the heading remains the same since it was written manually in top of page.
    Is there any possiblity to work out the Manual headings based on the layout fields.

    Hi,
    Do you use REUSE_ALV_HIERSEQ_LIST_DISPLAY? Why do you write heading manually? You can use IT_FIELDCAT parameter for defining a field catalog.

  • Multiple Default Values in a Multi-Select LOV Parameter?

    Hi,
    I have a report in BI Publisher standalone version 10.1.3.4. The report has a list of values called org_lov. This lov is attached to a multi-selection p_org_code parameter from which it is desirable to also have multiple default values.
    For example, if org_lov has the following values:
    100
    101
    102
    103
    104
    105
    106
    I would like to have 3 default values and have 100, 101,105 as the defaults if the user doesn't specifically select anything from the LOV. So far my testing has only allowed a single default value.
    Here are my settings:
    Data type = string
    Multiple Selection = checked
    Can select All = checked (all values passed)
    On the Default Value field, I have tried the following:
    1. 100, 101,105
    2. [100, 101,105]
    3. '100', '101','105'
    4. (100, 101,105)
    5. ['100', '101','105']
    6. ('100', '101','105')
    I don't need these default values highlighted in the LOV, I just need it passed correctly to the query (a data template).
    Thank you in advance for any input.

    Hi,
    Sorry for the delayed reply. I tried what you suggested but the problem is that by having the "Multiple Selection" property of the parameter unchecked, the result is that it allows the user to only have a single value passed. The user wants the option to select multiple values AND also have the multiple default values.
    Thanks anyway.

  • Multiple default values for Selection type variable

    Hi all,
    I am using Bex 3.5. I have a fundamental doubt while creating a User Entry, Selection Option, Optional type variable.  I am trying to include multiple single variables in the default section, but it accepts only one. Is it possible to add multiple default values to the variable so that they show up in the selection screen when we run the report via Bex Analyzer ?
    Thanks for the inputs !
    Regards
    Snehith.

    Hi,
    In one of my bi7 reports, i remember i have given multiple default values in a single variable. For example i wanted to have multiple material types in my selection screen.
    But i have to check out the type of that user entry variable.
    Hope the above reply was helpful.
    Kind regards,
    Ashutosh singh

  • XML FORM  -  How to save read-only controls with a default value

    Hello everybody,
    I have a 3 xml forms, each one to create one type of news. I need to use 3 because each of this forms has their own controls. But the control which indicates the type of news (asociated with a KM Predefined Property) must be common in the 3 forms, in order to use it on searches.
    The question is, how can I include in this forms a control:
      - Visible for the user
      - With a default value defined in the control properties (each form has a different value, corresponding with the type of news)
      - Read-only mode
      - The value showed in the control must be saved in the associated KM Predefined Property when the user clicks the Save button. 
    Anyone knows how to do this?
    What control can I use?
    I was thinking of trying with text boxes, but I don't find the way to make them unwritable (Read only mode).
    It is posible using labels?
    Thanks.
    Kind regards

    Hello Jose,
    I know you responded with a question... I see it in the email, but I don't see it here!  Very odd... but in response:
    The first thing I do when I open the Edit.xsl file is do a 'find' for the name of the text field that I want to be read-only (in my test case, it's 'location').  Repeat the find until you see something like:
    [code]<!--
    field location
    -->[/code]
    Below there is where I put the new code.  Mine looks like this:
    [code]- <xsl:choose>
    - <xsl:when test="location='' and ($editmode='create')">
    - <xsl:choose>
    - <xsl:when test="./xf:ValidationError/@tagname='location'">
    - <input name="location" size="30" type="text" class="urEdfiTxtEnbl" id="field_1157467268006">
    - <xsl:attribute name="tabindex">
    - <xsl:choose>
      <xsl:when test="$accessibilitymode='true'">21</xsl:when>
      <xsl:otherwise>3792</xsl:otherwise>
      </xsl:choose>
      </xsl:attribute>
    - <xsl:attribute name="value">
      <xsl:value-of select="''" />
      </xsl:attribute>
    - <xsl:attribute name="readonly">true</xsl:attribute>
      </input>
      </xsl:when>
    - <xsl:otherwise>
    - <input name="location" size="30" type="text" tabindex="3792" class="urEdfTxtEnbl" id="field_1157467268006">
    - <xsl:attribute name="value">
      <xsl:value-of select="''" />
      </xsl:attribute>
    - <xsl:attribute name="readonly">true</xsl:attribute>
      </input>
      </xsl:otherwise>
      </xsl:choose>[/code]
    I put the <xsl:attribute name="readonly"> in both places (when test, and when not test).  I'm not entirely sure if that's necessary, but that worked for me.
    Hope this helps,
    Fallon

  • Conditional colour formatting in apex_item select list

    Hello all,
    I am having a select list in my tabular report created using apex_item.
    What user want is the colour formatting of this select list according to the condition.
    Say eg: A select list for departments, I want the departments with employees in different colour as compared to departments with no employees.
    Please help.
    Thanks
    Tauceef

    I've got a function in my package for this issue. Maybe it will gives you an idea how to solve this topic. The function is very similar to apex_item.select_list function, but there is a significant different. Displays values and returns values that are separated by two semicolons!
      FUNCTION get_select_list(p_idx NUMBER,
        p_value VARCHAR2 DEFAULT '',
        p_list_value VARCHAR2,
        p_attributes VARCHAR2 DEFAULT '',
        p_show_null VARCHAR2 DEFAULT '',
        p_null_value VARCHAR2 DEFAULT '',
        p_null_text VARCHAR2 DEFAULT '',
        p_item_id VARCHAR2 DEFAULT '') RETURN VARCHAR2 AS
        v_null VARCHAR2(4000);
        v_output VARCHAR2(4000);
        v_value VARCHAR2(4000);
        l_vc_fields htmldb_application_global.vc_arr2;
        l_vc_return_fields htmldb_application_global.vc_arr2;
      BEGIN
        l_vc_fields := HTMLDB_UTIL.string_to_table (p_list_value, ',');
        v_output := '<select name="f' || TRIM(TO_CHAR(p_idx, '09')) || '" ' || p_attributes;
        IF LENGTH(p_item_id) IS NOT NULL THEN
          v_output := v_output || ' id="' || p_item_id || '"';
        END IF;
        v_output := v_output || '>';
        v_null := '<option';
        IF LENGTH(p_null_value) IS NULL THEN
          v_null := v_null || ' value="%null%"';
        ELSE
          v_null := v_null || ' value="' || p_null_value || '"';
        END IF;
        v_null := v_null || '>';
        IF LENGTH(p_null_text) IS NULL THEN
          v_null := v_null || '%';
        ELSE
          v_null := v_null || p_null_text;
        END IF;
        v_null := v_null || '</option>';
        IF UPPER(p_show_null) != 'NO' THEN
          v_output := v_output || v_null;
        END IF;
        FOR i IN 1 .. l_vc_fields.COUNT LOOP
          l_vc_return_fields := HTMLDB_UTIL.string_to_table (l_vc_fields(i), ';;');
          v_output := v_output || '<option';
          IF l_vc_return_fields.COUNT = 2 THEN
            v_value := l_vc_return_fields(2);
          ELSE
            v_value := l_vc_return_fields(1);
          END IF;
          v_output := v_output || ' value="' || v_value || '"';
          IF v_value = p_value THEN
            v_output := v_output || ' selected="selected"';
          END IF;
          IF l_vc_return_fields.COUNT = 3 THEN
            v_output := v_output || ' ' || l_vc_return_fields(3);
          END IF;
          v_output := v_output || '>' || l_vc_return_fields(1) || '</option>';
        END LOOP;
        RETURN v_output || '</select>';
      END get_select_list;You can define three values for p_list_value instead of 2. The third value will be used as option attribute:
    SELECT
    my_package.get_select_list(
    1,
    '20',
    'ACCOUNTING;;10,RESEARCH;;20,SALES;;30;;style="background-color: red;",OPERATIONS;;40'
    ) liste FROM dual;function returns
    <select name="f01" >
    <option value="10">ACCOUNTING</option>
    <option value="20" selected="selected">RESEARCH</option>
    <option value="SALES" style="background-color: red;">SALES</option>
    <option value="40">OPERATIONS</option>
    </select>The next step is just to create a function, which provide the string for p_list_value.

  • Creating a Month dropdown list for a report with multiple datasets

    I am currently working on a report that contains many charts that rely on multiple datasets. Currently, I have parameters @StartDate and @EndDate to display the information of the previous month across all the charts as my default value. Now, I would like
    to create a dropdown list so that the user can pick any month, and have the report display the data across all the charts for that particular month, while keeping the display of the previous month as the default value. Can anyone help as to how I can approach
    this. Would I have to use an expression when I specify my available values, or would I have to create a dataset to get the value of all 12 months? Any help would be greatly appreciated.

    This is essentially where I am having some trouble, as in creating the dataset that returns the individual months of the year as I am relatively to the use of SSRS. Could you possibly elaborate on how I can do so? Thank you in advance!
    Create a dataset in SSRS
    Inside dataset properties map datasource and then inside give command like
    DECLARE @Month int = 5 --example value
    SELECT ...
    FROM Table
    WHERE datefield >= DATEADD(mm,DATEDIFF(yy,0,GETDATE())*12 +(@Month-2),0)
    AND datefield < DATEADD(mm,DATEDIFF(yy,0,GETDATE())*12 +(@Month-1),0)
    then on refresh it will take field information and parameter information by itself.
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Select list and hidden display issue

    Hi all,
    I am using a dynamic value select list, which when a button is pressed sets the value of a hidden display item. The next page then uses the hidden display item as part of an SQL query.
    It strangely sometimes works and sometimes doesn't - it often struggles with the values in the select list which are over 30 characters.
    Does anybody have any idea what's going on?
    Many thanks,
    Tom

    Hi
    I just re-ran the debug feature and have found an issue which could be the cause of the problem:
    Som of the data items in the dynamic select list have and ampersand (&) symbol. If I run the page once the hidden item displays the value properly:
    0.22: binding: ":HIDDENREGION"="HIDDENREGION" value="Tech Comms Media Utilities & Hi-tech" if I re-run the page after navigating around the application for a bit is displays this value:
    0.22: binding: ":HIDDENREGION"="HIDDENREGION" value="Tech Comms Media Utilities &amp; Hi-tech"Please notice the "& amp;" bit which has been added... Is there any way of getting rid of this? as it is interfering with the query on the next page.
    Many thanks,
    Tom
    Edited by: new_to_apex on Mar 2, 2009 3:13 AM
    Edited by: new_to_apex on Mar 2, 2009 3:14 AM

  • Reqd. T-code in which list of customers display with CIN Details

    Dear All,
    Is there any t-code in which the List of Customers with cin details Display?Like the MKVZ,
    this is the t-code for List of Vendors Display.
    Thanks,
    Sumit.

    Dear Sir,
    I have found another t-code VCUST  for customer detail but in this CIN DETAILS are not there.
    so pls. suggest something...
    Thanks,
    Sumit.

  • Error in select list w/submit proccessing with IE

    I have encountered a problem that is only IE specific. The page is a basic page with an Automated Row Processing to insert the form to a table.
    Once the form has been filled out and you press create there are seven total fields including a hidden field (p173_model_id) that is populated by a database trigger and sequence. All of the fields in essence save to session state to the field following that field. So for instance the vendor_id saves to the model_number field. The model_number field saves to the status field and so on! This only occurs with IE though not with FF. In FF everything works as planned.
    Also if you change the container Type field from select list with submit to just select list the form handles fine now in IE.
    Attached are pictures trying both IE and FF:
    FF
    IE
    You can view the backend @
    workspace:epic
    guest/guest
    http://apex.oracle.com/pls/otn/f?p=9579:173
    Thanks
    Justin

    Here is an update in case anyone else experiences the problems I had...
    The SR request I filed was given bug # 5716829 I am not sure if this is published or not....
    Anyway here is what the development staff reported back:
    I have narrowed this problem down to the Read Only Condition on the P173_CONTAINER_TYPE_ID select list.
    If you remove "DISABLED" from the Read Only Element Table Cell(s) Attributes, it works fine in IE also. So, the problem seems to be
    with the way IE handles Select Lists that are DISABLED.
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    You may use that as a workaround until the fix is available...

  • 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:
    >

  • Security Attributes with Multiple/NULL values

    I have a couple of situations where I can't seem to get the authorization component working as I need it to work for a database source.
    1) In the first case, I have two attributes set for "grant security attributes" in the data source, one of which has a single attribute value, and the other which has multiple values, e.g.
    I want to set "grant security attributes" to something like "client_id role_id" where for my dataset, client_id will always be a single numeric value, but I might have multiple role_ids that can view this record. How do I specify in my data source query those multiple attribute values? I tried separating them with spaces, e.g.
    SELECT ...
    'A B' role_id
    FROM
    where "A" and "B" represent unique values (looking to match A OR B). I also tried delimiting them with commas, but neither spaces nor commas seems to work consistently.
    On the authorization end, using oracle.search.plugin.security.auth.db.DBAuthManager as the authorization plug-in, I have the authorization query set as
    SELECT client_id, security_lvl as role_id from test_user_id where user_id = ?
    Each user may have more than one role, so in the above query, security_lvl could be something like "B C"; I'm assuming from the documentation that the delimiter for attribute values in this case should be a space.
    The crawler logs make it appear that everything is getting indexed, so I suspect the issue is on the authorization front.
    2) In the second case, one of my security attributes for the data source may be NULL, meaning that there's no particular authorization restriction on a particular record, so to use the same example as in #1,
    role_id might be NULL for some records, in which case, I want those records returned in the search if the client_id matches, but I can't get the records with the NULL role_id to be returned at all. Again, the crawler logs indicate that everything is being indexed, and I'm not sure if there's a log where I can further troubleshooting authorization issues.
    Any guidance would be appreciated.
    Thanks

    1) The security attributes are OR'd together so if the user has any ONE of the attributes (either client ID or role ID), the document can be seen by the user. What I would try is to create a view to call rather than directly against the table. The view can then leverage a PL/SQL function and encapsulate the logic behind the security tokens to return.
    So the view would look like this...
    CREATE OR REPLACE VIEW USER_SECURITY_V AS
    SELECT
    USER_T.ID,
    MY_SECURITY_FUNCTION(USER_T.ID) AS AUTH_ID
    FROM
    USER_T
    The PL/SQL function would look something like this...
    CREATE OR REPLACE FUNCTION MY_SECURITY_FUNCTION(USER_ID NUMBER) RETURN VARCHAR2 IS
    -- Do whatever you need to do to build a single space-deliminted list of tokens for both Client and Role ID "CLIENTID4 ROLEID5 ROLEID9" then return
    END;
    The data source authorization query then would look like this...
    SELECT AUTH_ID FROM USER_SECURITY_V A WHERE A.ID = ?
    Using a PL/SQL Function to control the tokens gives you the flexibility of modifying security without having to touch the data source directly
    2) I don't quite follow. If any ONE of the tokens match, the document is returned. If the role ID is null, you might try stamping each document a "master" security token indicating it's open to everyone such as "ALL". Then in the PL/SQL Function, return "ALL" in front of the actual values.
    The crawler logs will only tell you what is indexed at crawl time, not how searching is actually working. Try checking the server logs. These should be under something like oracle/ses/seshome/search/base_domain/servers/AdminServer/logs
    Hope this helps!

  • Field in the selection screen as a select option with two default values

    Hi All,
    can anybody tell me how to put field in the selection screen with two defaul values.
    for ex:  selection screen the Account Group KNA1-KTOKD as a select option. The defeault value should be Y001 and Y005.
    please reply ASAP. Its urgent.
    Thanks in advance,
    Madhu

    Hi Madhu,
    Since Select options are nothing but ranges, you can use the following code to add two distinct values to the select options by default.
    s_ktokd-sign = 'I'.
    s_ktokd-option = 'EQ'.
    s_ktokd-low = 'Y001'.
    append s_ktokd.
    s_ktokd-low = 'Y005'.
    append s_ktokd.
    clear s_ktokd.
    However, if you want to mention a range like all the values between these given two values to be considered then u may use,
    select-options : s_ktokd for KNA1-KTOKD default 'Y001' to 'Y005'.
    or
    s_ktokd-sign = 'I'.
    s_ktokd-option = 'BT'.
    s_ktokd-low = 'Y001'.
    s_ktokd-high = 'Y005'.
    append s_ktokd.
    Reward if helpful.

Maybe you are looking for

  • Connecting to Oracle9i through ADO

    Hi, I have an visual basic 6.0 application .It connects to the Database using ADO .The application works fine with Oracle7.x and Oracle 8i.However there are issues when the Database is Oracle 9i.The problem is Stored Procedures using ADO do not get e

  • AppleAV Cable

    I've recently baught an Apple AV Cable for iPod and I want to Mirror my iPod Touch 4th Gen to the TV. Is there a way without jailbreak (I would NEVER try Jailbreaking)

  • 101 & 541 in one step, SC vendor indicator

    we have 2 plants in same company code, and using STO (stock transport order, order type UB) to transfer goods from plant A to plant B, now there is one case, plant B ask for a material from plant A, but need it shipped directly to a external vendor,

  • SUR Peru and SUR Venezuela

    Please add Sur Peru and Sur Venezuela to the Channel line up. Thank you

  • Can we Install Peoplsoft on WIndows 7 Home Premium

    Hi, Just want to know can we install Peoplesoft on Windows 7 Home Premium. if yes then is there any version restriction like only peopletool 8.49 or 50 or HRMS 9 or 9.0; or any drivers or other solution requires to install it.