Set Character Width of Select List

Hi All,
I have a select list on my apex page. It is a dynamic select list generated from a sql query. Does anyone know how to set the max character length of the list item, as some of my entries are enourmous and the select list takes up the width of my page.
Thanks in advance!

User,
What is your name?
You would do this with the LOV query. Here's an example:
SELECT
   CASE
      WHEN LENGTH(display_col) > 50 THEN SUBSTR(display_col,1,47) || '...'
      ELSE display_col
   END display,
   return_col AS return
FROM my_tableRegards,
Dan
http://danielmcghan.us
http://www.skillbuilders.com
You can reward this reply by marking it as either Helpful or Correct ;-)

Similar Messages

  • Align width of select lists

    Hi
    is there a way to set the same width for several select lists located vertically in one column ?
    Thanks

    Hi Edward,
    does the following link solve what you are looking for?
    http://inside-apex.blogspot.com/2007/01/sergios-blog-and-some-old-postings.html
    Patrick
    Check out my APEX-blog: http://inside-apex.blogspot.com
    Check out the ApexLib Framework: http://apexlib.sourceforge.net

  • How to fix the length of select list box?

    Halo, i am doing the research. I need to find out what is the method to fix the length of select list box. This is b'cos i can set the length of select list due to different length of record(s)/data(s).
    Another question to select list box. What is the maximum length of the select list box?? Can i enter the character with 255 lenght??
    Thank you very much..... a prompt reply will be appreciate!!

    Thanks for ur reply! actually that answer that you gave is right, but i also need to know what is the maximum lenght of character in the select list box?? any idea to that??
    Meanwhile, i also need to know how can i make the character display in select list box dynamically?? that means i can change the font style or font size??
    Anyway, thanks for ur answer.
    bscs.

  • 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

  • Update select list with dynamic LOV

    How exactly do you do this?
    Currently I have a text field which the user may enter a product type and a button when click. It would populate the select list with the product names that associate with that product type...
    My lov would retrieve the product type value text field(:P1_t_prod_type) and get products names by type
    select t_prod_name A , t_prod_name B
    from t_prod_items
    where t_prod_type = :P1_t_prod_type
    order by 1Im kind of stump on is setting up my dynamic action to "set value" to the select list. As nothing seems to be appearing.

    product type is a numeric value that can be a wide numeric range. (I don't know why the column is named like that. Sorry for forgetting to mention that)
    Well I don't think i should submit the page? because after the list box is filled with product names. the user can then select one of those names from the list box and continue completing the rest of the form. After all that the page would then be submited. (Well that's how i imagine it to work...)
    Wouldn't i run into problems if i were to submit the page twice... like lost entry in other text fields if the user were to skip that part at the start.

  • $x_Hide/Show/Toggle works on a button, how about select list or tabs

    ** After looking at the issue for days I think everyone must know what I am trying to do and a Carl pointed out they don't so here is the Readers Digest Condensed version.
    I want have a single page that displays or hides regions depending on what the user want to do. So there is a single region that provides summary data and multiple regions for updates or reports that only show when that option is selected. I have got it working with buttons, thanks to Carl for his examples and numerous posts.
    Now the powers that be see that as too much clutter on the screen and want a select list for the options, as there may be 10 or 12 options on a single "page." Hopefully this clarifies what I am trying to do.
    I don't see anyway for it to work on tabs, at least not the tab sets in ApEx but select list have a "Display As" option for "Select List Returning URL redirect."
    This sounds like the button "Optional URL Redirect" property. I have the code working on buttons on the same page so I added a select list and tried it.
    The #REGION_STATIC_ID# is set up on the template of the region type being used and the regions hide and show as expected with the buttons.
    So I set up an item on the page as a "Select List Returning URL redirect"
    I created a static select list as:
    STATIC2:Option1;javascript:$x_Hide('REGION1');$x_Hide('REGION2');$x_Show('REGION3')
    I tried it with single quotes around the returning URL, and got
    mod_plsql: /pls/htmldb/'javascript:$x_Hide('COBORROWER');$x_Hide('PROPERTY');$x_Show('BORROWER')' HTTP-400 Name "'javascript:$x_Hide('COBORROWER');$x_Hide('PROPERTY');$x_Show('BORROWER')'" is longer than 30 chars
    without single quotes and got
    New, blank screen with REGION3
    mod_plsql: /pls/htmldb/'javascript:$x_Hide('REGION1');$x_Hide('REGION2');$x_Show('REGION3')' HTTP-400 Name "'javascript:$x_Hide('REGION1');$x_Hide('REGION2');$x_Show('REGION3')'" is longer than 30 chars
    I took out the java stuff and put www.yahoo.com and got
    Not Found
    The requested URL /pls/htmldb/WWW.YAHOO.COM was not found on this server.
    So the URL is being appended to the /pls/htmldb...
    Hmm... I also removed "javascript:" and tried with and without single quotes... no luck... still appending the returning URL to /pls/htmldb/.
    Tabs would be best but a drop down list is cleaner than 8 buttons.
    Ideas? Spare change?
    I may need it :)
    Sam
    Message was edited by:
    slavanaway
    Message clarified by:
    slavanaway

    What a difference a day and a pointer make.
    I created a test function in the page html header
    <script type="text/javascript">
    function test(){
    window.alert('Function test');
    </script>
    Changed the static list to
    static2:Option1;javascript:test(),Option2;javascript:test()
    and the function worked. I then changed the function to
    <script type="text/javascript">
    function test(){
    $x_Toggle('REGION1');
    </script>
    and the region toggled on and off.
    I then changed the select list to
    static2:Option1;javascript:test(),Option2;javascript:$x_Toggle('REGION2')
    and region1 toggled while Option 2 produced a blank browser page with the "REGION2" in the upper left hand corner.
    I made functions for Option1, 2 and 3 with the appropriate $x_Hide/Show for each region and the select list now acts like the buttons.
    Thanks for the help. I guess the call has an issue with the functions that are not on the page or ???. Maybe Carl can help, but since I needed more complex functions anyway this does not represent any more work while allowing me the option of a single page with multiple forms and reducing the complexity of the UI.
    Score...

  • Need help with Hierarchical Select List

    I'm trying to left-pad the entries in a select list to indicate organizational hierarchy. Here's the query:
    SELECT
    LPAD(' ',2*(LEVEL-1)) || ORG_NM d,
    ORG_ID r
    FROM
    ORG_ENTITIES
    START WITH ORG_ID = 901
    CONNECT BY PRIOR ORG_ID = MNG_ORG_ID
    ORDER BY 2;
    (there are two spaces between the single quotes)
    It seems to work fine from a standard SQL prompt, but it looks as if either Apex or the browser is stripping off the spaces in the padding. Can someone point out a reason? I'm using Application Express 3.0.0.00.20. Thanks.

    I've used the concatenation of two items to create space between them before, and that works fine. This is an LPAD situation, however, as there is only one item.
    I did try the & nbsp; in place of the literal space character. The select list strips out the & and I get some variation of the literal characters. I even tried using periods in place of spaces for the padding and that didn't work either.
    Don't know what is going on.

  • Trying to use Spry with Select List

    I have a dataset that is static xml. .In the xml file I have
    a node called categoreis and then repeating node of store name,
    phone and address in that category. There are around 15 categories
    and a total of 100 stores with address and phone. I can create the
    select list and add the onchange event to tell Spry which row of
    data was selected in the drop down. I do not understand how to
    generate the detail region that shows the stores for that
    particular category. Any help would be appreciated.

    Always include the following information when asking a question:
    <ul>
    <li>Full APEX version</li>
    <li>Full DB/version/edition/host OS</li>
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)</li>
    <li>Browser(s) and version(s) used</li>
    <li>Theme</li>
    <li>Template(s)</li>
    <li>Region/item type(s)</li>
    </ul>
    taepodong wrote:
    Hi All,
    Bit at loss what i am doing wrong here. Trying to change a field (previously in textfield) to a drop down select list. All works except one. It looks like Multi-selector even though I set the type as Select List
    http://i.imgur.com/Hz7tP.png
    Got no idea what I have to do to change it to drop down. Many Thanks.If you are on apex 4.x, you might have set the Allow Multiple Selection to Yes
    Edit the select list item > Settings > set Allow Multi Selection to No
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/item_types001.htm#HTMDB28627

  • How to set width of a select list?

    Hi,
    another newbie question from me :-)
    When I create a select list the default width is 30, no matter what I set this value to the width of the select list stays the same, it gets as wide as the widest element in the list. This messes the design of the page. I f I have three select lists in a column I want them to have the same width. How do I accomplish that?
    /Magnus

    Edit the item and in the HTML Form Elements Attributes field type the following:
    style="width:120px";adjust the 120 to whatever width you like
    Shunt

  • Setting current values in Multiple Select List in SQL Query based Report

    Hi,
    I have a report based on a sql query that contains a multiple select list. Unfortunately I cannot get the multiple select list to display the current values (p_value) correctly. I have created a page item, :p311_current_versions, that is set using a pre-header process and it returns a value with a colon delimited format e.g. '10.1.2.1.0:10.1.2.2.0'. Then this item is used in the sql query to set the current value (p_value) of the apex_item.select_list_from_query function. However when the table is displayed, instead of having two entries, 10.1.2.1.0 and 10.1.2.2.0 selected, it has an extra entry '10.1.2.1.0:10.1.2.2.0' selected.
    Here is my code:
    select distinct a.product, a.version from (
    select distinct
    apex_item.display_and_save(2,product)||apex_item.hidden(1,env_product_id) PRODUCT,
    APEX_ITEM.SELECT_LIST_FROM_QUERY(3,decode(product, 'HTTP Server' , :p311_current_versions, version), 'SELECT distinct version d, version r FROM ebs_tech_stack where
    product ='''||PRODUCT||'''',
    decode(PRODUCT, 'HTTP Server' ,'multiple="multiple" style="width:170px"','style="width:170px"'),
    'NO') as version
    from ebs_environment_tech_stack
    where environment_id = :p311_umgebung_id) a order by a.product
    If anyone can help me figure out how to set the current values correctly I'd be really grateful!!
    Thanks in advance,
    Jean

    Jean,
    I don't think this is possible using the apex_item package. The select_list_from_query function accepts only a single value for the second parameter.
    Scott

  • Select list width and printing output

    Hi,
    Can anyone tell me how to set the width of a SELECT LIST control? I have tried to set but it is always dynamic and depends on the width of the data items of the list which are supposed to be displayed. Can i fix the width, jsut like simple text field.
    I want to print a text from my pl/sql procedure on the web page from where i am caling the procedure. I tried using DBMS_OUTPUT, but vain. I actually want to print a customized error message on my web page at the occurrence of any exception.
    Thanks
    Salman

    Unfortunately it is not working. I have following exception block in my procedure. control will transferred to the exception block if my query to remote database failed over the database link which this procedure just created.
    WHEN OTHERS THEN
    BEGIN
    htp.p ('Database connect information incorrect, please provide correct database connection information');
    EXECUTE IMMEDIATE 'DROP database link '||p_db_name;
    END;
    But, i don't see this message printed on my web page. Instaed, i see exception thrown by the the calling procedure of this procedure which also queried over the same database link.
    Thanks

  • Select list width

    Hi,
    how can I make 'select list' width smaller (strings in list are long)? Setting 'width' and 'maxWidth' properties doesn't show any result?
    thanx
    alek_mil

    Go to HTML Form Element Attributes of the select list and try to enter something like:
    style="width:190px"
    This will control the width as you want.
    Denes Kubicek

  • Set Default Value of Multi-select list item

    I have a multi-select list item I want to default the value of to '%' (which is really '%null%') and have it selected. I tried setting default value of item, but it doesn't take '%null%'. I also tried a computation with a static of
    :P507_ITEM := '%null%'; How do you get the default value set and selected?

    Hi
    Shijesh is right, you need to change your null return value and use that return value as your default. Try and use something of the same datatype as your real return values if you plan to use '%' to display all as it will make your queries simpler. eg.
    Company A returns 1
    Company B return 2
    % returns 0
    Then your query would be...
    SELECT ...
    FROM ...
    WHERE company_id = DECODE(:P_COMPANY,1,1,2,2,0,company_id)
    Hope this makes sense.
    Cheers
    Ben

  • Set Radio Group Default Value Based on a Select List Change Event

    Apex 4.2
    I have a radio group that is source is below. It returns 3 radio group item All,Miv,Courier
    SELECT type d, code r FROM vw_lov_depot
      WHERE svc_name = :P320_DEPOT
      ORDER BY 1
    The radio group is only populated when :P320_DEPOT gets a value, this is a select list.
    I am trying to set the radio group to  default to this value Miv it would use the statement
    SELECT type d, code r FROM vw_lov_depot
      WHERE svc_name = :P320_DEPOT
      and type ='Miv'
      ORDER BY 1
    I have tried creating a dynamic action on Select list change to populate the default value of the radio group...no joy I also tried a computation. how can I set this default value on when list changed.
    Thanks
    I have got the default Radio Group Selection working by doing a computation before region on the radio group and calling its select statement and setting the value. But the problem is now I cannot change the radtio group as I do it fire the before region trigger and sets it back to the default value....any help?

    Hi,
    Could you please create example to apex.oracle.com?
    Regards,
    Jari

  • Spry select list code to wire it to html data table SET column?

    I am making a page based on Figure 15-14, Pg 878, in David Power's book, "Dw CS4 with CSS, Ajax and PHP. I have two separate html data tables hidden in the page, one for the specialties drop down select list and the other for the teachers master/detail regions. These are populated with php and working well. The spry select list and master/detail regions are working great except for one issue. The column in my html data table that is being filtered ("Specialty" in my code = 'Category' in the book's example code) is a SET column (with possible value of 1, 2, 3, 4, and/or 5). Clicking on the drop down menu brings up the records with a single value beautifully. The result for records with multiple values is a spry error "Invalid row number: 0". After four different versionings and methods of messing with this, I still haven't a clue. Please help me with how to rewire the Spry select list code so that it will read the records that have multiple items in that column. I have included the code below.
    var data_set_teachers = new Spry.Data.HTMLDataSet(null, "teacher_data");
    data_set_teachers.gallery = '1';
    function chooseSet(dataSet, row, rowNumber)
    if (row["Specialty"] == data_set_teachers.gallery) {
       return row;
    return null;
    data_set_teachers.filter(chooseSet);
    function changeSet(set)
    data_set_teachers.gallery = set;
    data_set_teachers.filter(chooseSet);
    data_set_teachers.setCurrentRowNumber(0);
    var rows = data_set_teachers.getData();
    for (var i = 0; i < rows.length; i++) {
       if (rows[i]["Specialty"] == set) {
         data_set_teachers.setCurrentRowNumber(i);
         break;
    var data_set_specialties = new Spry.Data.HTMLDataSet(null, "specialty_data");

    Well I'll be damned!
    What's done in the sample app is, of course, the intuitively obvious choice and is exactly what I started out trying to do the first time round.
    But as I mentioned before, when I first tried it (yes: I'm pretty sure I set the "for" attribute on the inlineMessage components), I got the non-unique component id exception for the inlineMessage component(s) after adding the second (but not the first) row to the page.
    Anyway, after dragging my inlineMessages to the exact same position as those in the AppModel example, now things work fine (except I think I'd like a line break before the message and to change the row/column styles so the values and messages line up properly...the look is rather ugly in the AppModel example when there are validation messages displayed).
    Not sure, but I'm thinking maybe there was an issue with where the inline message markup was placed, my first time through, relative to the data table value bound component and the column header facet?
    I was using the application view drag 'n drop feature the first time round and dragged the inlineMessage component to the spot just below the data table value bound component and hence just above the column header facet. In the AppModel example, OTOH, the inline messages are placed just after the column header facet.
    Of course, I will now try to duplicate the original exception.
    If I can (and it is an issue with placement), I will post back some sort of bug report or RFE. Otherwise, I'll post back declaring what a bone head I've been...;-)
    Anyway, thanks for the quick response, v.
    Campbell

Maybe you are looking for