Paragraphs to Selectable List Script (optimized)

As this script may be of interest to some, I'm posting this version.
This appears to be a troublefree script for converting paragraphs of text to a selectable list while:
1) Getting rid of leading AND trailing white space
2) Preserving punctuation
3) It eliminates a problem where getting rid of trailing white space did not work if there was no leading white space to begin with
4) It is based on submissions by Yvan Koenig and Hiroto with modifications by osimp
It does NOT eliminate blank paragraphs
set myT to "PARAGRAPH 1, and ?!% for punctuation
PARAGRAPH 2
PARAGRAPH 3"
(*Add leading and trailing white space to each paragraph if
it doesn't show up in this post*)
set L to every paragraph of myT
repeat with i from 1 to (count L)
set para to item i of L
repeat while (para starts with space) or (para starts with tab)
set para to (rest of every character of para) as text
end repeat
--IMPORTANT: 1) THE TRY/END TRY BLOCK IS NECESSARY IN THE EVENT OF A BLANK LINE *if* 2) THE 'REPEAT WHILE LAST CHARACTER OF PARA IS " "' BLOCK (below) IS USED (to delete trailing white space). ALSO: positioning of the "end repeats" is crucial; if incorrect, the trailing white space block won't work if no paragraph has leading white space (etc.)! The arrangement shown here appears to be correct.
try
repeat while last character of para is " "
set para to characters 1 thru {(count characters of para) - (1)} of para as text
end repeat
end try
set item i of L to para
end repeat
set _ to choose from list L --with empty selection allowed
if _ is false then error number -128
set mySelection to _ as string
return mySelection
2.7G5 AND OTHERS   Mac OS X (10.4.5)  

It does NOT eliminate blank paragraphs
set item i of L to para
It does NOT eliminate blank paragraphs, because you maintaining the structure of L.
If you want to get rid of blank line, you need to reconstruct L by changing the script a bit:
set myT to " PARAGRAPH 1, and ?!% for punctuation
PARAGRAPH 2
PARAGRAPH 3 "
(*Add leading and trailing white space to each paragraph if
it doesn't show up in this post*)
set L to {}
repeat with para in every paragraph of myT
repeat while (para starts with space) or (para starts with tab)
set para to (rest of every character of para) as text
end repeat
--IMPORTANT: 1) THE TRY/END TRY BLOCK IS NECESSARY IN THE EVENT OF A BLANK LINE *if* 2) THE 'REPEAT WHILE LAST CHARACTER OF PARA IS " "' BLOCK (below) IS USED (to delete trailing white space). ALSO: positioning of the "end repeats" is crucial; if incorrect, the trailing white space block won't work if no paragraph has leading white space (etc.)! The arrangement shown here appears to be correct.
try
repeat while last character of para is " "
set para to characters 1 thru {(count characters of para) - (1)} of para as text
end repeat
end try
if para as string is not "" then copy para to end of L
end repeat
set _ to choose from list L --with empty selection allowed
if _ is false then error number -128
set mySelection to _ as string
return mySelection

Similar Messages

  • Oracle apex popup using java script in tabular form select list(Am new to apex help me out... )

    Hi ...
      i have a tabular form
      have two columns in that form, kept as a select list by selecting that 1st select list data the related datas has to be popup after selecting that it has to be displayed in the  2nd column by using
    java script
    eg:
    1st column empno-----by selecting the empno the related empname has to be popup
                     dept no....by selecting the deptno the related deptname has to be popup 
    thanks in advance,
    kishore

    This is a very common question, see
    https://forums.oracle.com/thread/2359498

  • How to get the value from select list to text box

    Hi,
    I have a select list i want to retrieve the value from select list to text box.
    How can i do that???
    Regards,
    Sakthi.

    Hi Sakthi,
    Yo can use the Java script for that..
    Dynamically the value will come into text box.
    Use the below script.
    <script type="text/javascript">
    function disFormItems()
    var lReturn = $v(here your select list name)
    alert(lReturn);
    document.getElementById(here your text box name).value =lReturn; }
    </script>Cheers,
    Shan

  • Report with select list and link to call another report

    Hi,
    I am trying to do 2 reports (REPORT1 and REPORT2).
    The first is a summary report (REPORT1).
    This report will display sales figures for the year. Now, I need to have a select list in the result set that will have 2 options, depending on which option is chosen, I want to call REPORT2 with the select list as a parameter. How can I do this ?
    Let me try to explain what I did.
    I created REPORT1 on Page 100
    SELECT YEAR, sum(YTD_SALES), APEX_ITEM.SELECT_LIST(1,'DEPARTMENT','Department;DEPARTMENT,Division;DIVISION') Drilldown FROM SALES_ANALYSIS WHERE YEAR > 2000
    GROUP BY YEAR ORDER BY YEAR
    I created 2 hidden items namely P100_YEAR and P100_DRILLDOWN
    I also made the column YEAR as a link and specified both P100_YEAR and P100_DRILLDOWN as parameters to be passed.
    Next, I created REPORT2
    SELECT YEAR, DECODE(:P100_DRILLDOWN, 'Department', department, 'Division', Division) dept_div, sum(YTD_SALES) ytd_sales
    FROM SALES_ANALYSIS
    WHERE YEAR = :P100_YEAR
    When I run Report 1, it's fine, when I choose either Department or Division from the Select List and click on the link to call Report 2, report 2 is displayed, but the value being passed for P100_DRILLDOWN is not correct and as a result, I am unable to get correct results for Report 2
    Am I missing something ? Are there any alternate ways to do what I'm doing ?
    Thanks,
    Ashok

    Hi Ashok,
    The link definition will not know the value selected in the list as it is constructed only when the page is being rendered. You would need to create some javascript to handle this. I've done that here: [http://apex.oracle.com/pls/otn/f?p=267:182]
    The link on the EMPNO column has been defined in the HTML Expression setting for the column instead of the Link section. The HTML Expression that I have used is:
    &lt;a href="#" onclick="javascript:doDrilldown('#EMPNO#',this);"&gt;#EMPNO#&lt;/a&gt;And, in the page's HTML Header setting, I have added in:
    &lt;script type="text/javascript"&gt;
    function doDrilldown(empno,group)
    var g;
    var p = group.parentNode;
    while (p.tagName != "TR")
      p = p.parentNode;
    var x = p.getElementsByTagName("SELECT");
    if (x.length &gt; 0)
      g = x[0].value;
    var url = "f?p=&APP_ID.:183:&SESSION.::::P183_EMPNO,P183_GROUP:" + empno + "," + g;
    document.location.href = url;
    &lt;/script&gt;When a link is clicked, the doDrilldown function is called passing in the EMPNO value and the "this" object (which identifies the object triggering the call). The function starts from that object and goes up in the HTML tag tree to the nearest TR tag (the row tag that the link is on) and then finds the first SELECT list item on the row and gets its value. It then constructs a URL using this and the EMPNO value and performs a redirect to the second page (page 183 in this example).
    Andy

  • How to select the contents in a select list box....

    I want to look into a select list box and check whether something is existing if exists print that or add a new one...I want to count the number in the select list box....the selected lsit consists of string of names....i have to choose my favourite name ...if present....
    Please help me...

    Akrisha wrote:
    HTML List box ....in java script....This is Java forum.
    In JavaScript you should use select.options[index] blah blah ...

  • Apex 3.2 group select list

    Hi,
    I just want share this if you are still in older version of Apex and you use jQuery.
    I did made "plugin" for grouped select list
    See sample here
    http://actionet.homelinux.net/htmldb/f?p=100:86
    Plugin source
    ;(function(){
    jQuery.fn.htmldbLovOptGrp=function(o){
    var t=jQuery(this);
    o=jQuery.extend({
      sessionValue:t.val(),
      nullShow:false,
      nullValue:'%null%',
      nullDisplay:'%',
      lovProcess:undefined,
      lovGrpLabel:'GRP',
      lovDisValue:'DIS',
      lovRetValue:'RET',
      loadingTxt:'Loading ...',
      loadingCss:{'width':'80px'}
    },o);
    return lCreSelect(t,o);
    jQuery.htmldbAjax=jQuery.fn.htmldbAjax=function(opt){
    jQuery.ajaxSetup({
      url:'wwv_flow.show',
      dataType:'HTML',
      traditional:true,
      cache:false,
      type:'POST',
      data:{
       p_flow_id:jQuery('#pFlowId').val(),
       p_flow_step_id:jQuery('#pFlowStepId').val(),
       p_instance:jQuery('#pInstance').val()
    return jQuery.ajax(opt);
    jQuery.htmldbJSON=jQuery.fn.htmldbJSON=function(opt,callfn){
    return jQuery.htmldbAjax({dataType:'json',data:opt,success:callfn});
    function lCreSelect(t,o,j){
    t.empty().hide().parent().append(jQuery('<div/>').html(o.loadingTxt).addClass('ui-autocomplete-loading').css(o.loadingCss));
    jQuery.htmldbJSON(jQuery.extend(j,{p_request:'APPLICATION_PROCESS='+o.lovProcess}),function(jd){
      if(o.nullShow){lAppendOpt(t,null,o.nullDisplay,o.nullValue);}
      jQuery.each(jd.row,function(i,d){lAppendOpt(t,d[o.lovGrpLabel],d[o.lovDisValue],d[o.lovRetValue]);});
      t.val(o.sessionValue).trigger('change').show().parent().find('div.ui-autocomplete-loading').remove();
      return t;
    function lAppendOpt(t,l,d,r){
    var o=lCreateOpt(d,r);
    if(l){
      var g=lGetOptGrp(t,l);
      if(g){g.append(o);}
      else{t.append(lCreOptGrp(l).append(o));}
    }else{t.append(o);}return true;
    function lExists(p){return(p.length==1);}
    function lCreateOpt(d,r){return jQuery('<option/>').val(r).html(d);}
    function lCreOptGrp(l){return jQuery('<optgroup/>').attr({'label':l});}
    function lGetOptGrp(t,l){var g=t.find('optgroup[label="'+l+'"]');if(lExists(g)){return g;}else{return false;}}
    })();Copy code and save it to file e.g called jquery.htmldbQuery.js and upload it to workspace Static Files.
    Create new page and blank HTML region.
    Create select list with LOV query
    SELECT null d, null r FROM dualCreate On Demand application process called GET_GRP_LOV like
    DECLARE
    l_sql VARCHAR2(32700);
    BEGIN
    l_sql :='
      SELECT mgr AS grp,
       ename AS dis,
       empno AS ret
      FROM emp
    APEX_UTIL.JSON_FROM_SQL(l_sql);
    END;Place to page HTML header
    <script type="text/javascript" src="#WORKSPACE_IMAGES#jquery.htmldbQuery.js"></script>
    <script type="text/javascript">
    $(function(){
    $('#Px_MY_SELECT').htmldbLovOptGrp({lovProcess:'GET_GRP_LOV'});
    </script>Where Px_MY_SELECT is your select list name.
    As I did say this need you also load jQuery. Apex 4 have jQuery , but if you are on later version see e.g. this blog post
    http://www.oracleapplicationexpress.com/tutorials/66
    I hope this helps someone
    Br,Jari
    Edited by: jarola on Aug 17, 2010 8:44 PM
    Same thing seems to be work also with Apex 4.0
    http://apex.oracle.com/pls/otn/f?p=40323:50
    But if I have understand correctly Apex 4.0 have some build in or better thing to get same result
    Edited by: jarola on Aug 17, 2010 10:54 PM
    copy&paste mistake corrected
    Edited by: jarola on Aug 18, 2010 12:57 AM
    I hope editing post all the time is ok =).
    I have not test this on any other browser than Fire Fox, so all comments are welcome.
    Also I have try create similar plugin for cascading lov. Sample here
    http://actionet.homelinux.net/htmldb/f?p=100:85
    Maybe there is this kind plugins already for Apex 3.x, I have not just seen.
    Also I'm beginner with jQuery so all help and comments is needed
    Edited by: jarola on Aug 18, 2010 2:01 AM
    mistake in guide corrected.

    Hi Matt,
    which version of APEX are you currently on?
    With ApexLib Framework you can have cascading select lists in normal forms, but not in a Report or Tabular Form. Also refreshing a Report when changing a select list doesn't work out of the box. You would need to add some javascript. But i think this isn't what you wanted.
    brgds,
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    BuilderPlugin: http://builderplugin.oracleapex.info
    Work: http://www.click-click.at

  • Unable to create a dynamic action ALERT to be generated on a Select List when particular value is selected.

    Hi everyone, this should be so easy, yet I am stuck.
    I have a form region with an item P110_VESSEL_ID.   This item is a select list.   It is based on the query: 
    select distinct v.vessel_name, v.vessel_id
    from vessels vessels v, frequent_fishermen ff
    where ff.dea_permit_id = :G_PERMIT_ID and
    ff:vessel_id = v.vessel_id
    UNION
    select v.vessel_name, v.vessel_id
    from apex_collections a, vessels v
    where collection_name = 'SUPVES_COLLECTION' and
    a.c002 = v.vessel_id
    If the user decides against the values in the select list query, they may opt to SELECT ALL VALUES.  This SELECT ALL VALUES is a POST ELEMENT TEXT on P110_VESSEL_ID.
    <a id="popVessels" href="#"><font color=blue>Select from ALL Vessels</a>
    This all works fine.
    The issue is that when the user selects a vessel name = 'UNKNOWN' and it's corresponding vessel_id value, I would like an ALERT to appear indicating that they should double check that the vessel is UNKNOWN and not that the is no vessel. 
    I created a dynamic action
    event= change
    select type = item
    item = P110_VESSEL_ID
    True ACtion #1 is the ALERT.
    I currently have no other logic, but cannot even get this to work.  Any thoughts.   I have also tried the SELECT TYPE = jQuery Selector = select[name='P110_VESSEL_ID'] but that does not work either (though I am not certain if the value should be P110_VESSEL_ID or the static name of VESSEL_ID).
    Any help is appreciated.
    ps.  the page is not submitted when the vessel is changed.  There is other data that needs to be entered both in this region and others and many validations run when submit, so the submit would not be an option.
    thanks again,
    Karen

    KarenH,
    KarenH wrote:
    I created a dynamic action
    event= change
    select type = item
    item = P110_VESSEL_ID
    True ACtion #1 is the ALERT.
    This should work.  Sometimes I've see where there is other javascript on the page that may have some errors and is causing the dynamic action code to not be executed.  Use your favorite browser script console to try and determine if this may be the case.
    --Jeff
    P.S. Your jQuery selector can be: select#P110_VESSEL_ID

  • Cascading Select Lists - Not Working for me

    I am trying to implement Denes Kubicek's Ajax Cascading Select List solution.
    http://apex.oracle.com/pls/otn/f?p=31517:119
    But it is not working for me.
    I'm a newbie to APEX and checked the forum for advice on cascading select lists. I saw the thread for
    "Cascading Select Lists - Not Working" posted by sue and the replies by Varad Acharya, but I'm still
    having issues of not seeing the alerts, not able to run the pl/sql process in SQL Workshop, and not
    getting the expected results.
    I have a list of countries (US - USA, CA - CANADA, etc.) and a list of states for each country. When a
    user selects a country I would like to show the list of states within that country.
    This is what I've done so far:
    Defined an application process:
    Process Point: On Demand: Run ... by a page process.
    Name: CASCADING_SELECT_LIST1
    Process Text:
    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 ('<select>');
    HTP.prn ('<option value="' || 99 || '">' || '- All States -'
    || '</option>'
    FOR c IN (SELECT state_code || ' - ' || state_desc d, state_code r
    FROM tbk_state
    WHERE country_code = :cascading_selectlist_item_1)
    LOOP
    HTP.prn ('<option value="' || c.r || '">' || c.d || '</option>');
    END LOOP;
    HTP.prn ('</select>');
    END;
    defined and application item:
    Name: CASCADING_SELECTLIST_ITEM_1
    Build Option: - No Build Option -
    Created a 'Form on a table with report' as follows:
    Page 5: Report on TBK_HARDWARE_LOCATION
    Page 6: Form on TBK_HARDWARE_LOCATION
    in HTML Header of the page attributes for 'Form on TBK_HARDWARE_LOCATION' I have:
    <script language="JavaScript" type="text/javascript">
    <!--
    htmldb_delete_message='"DELETE_CONFIRM_MSG"';
    //-->
    </script>
    <script>
    function get_select_list_xml1(pThis,pSelect){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    alert ('Dept no=' + pThis.value);
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=CASCADING_SELECT_LIST1',0);
    get.add('CASCADING_SELECTLIST_ITEM_1',pThis.value);
    gReturn = get.get('XML');
    // gReturn = get.get();
    alert('Enames=' + gReturn);
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option");
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue)
    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>
    On Page 6: 'Form on TBK_HARDWARE_LOCATION' I have the following items (plus some others):
    Name: P6_COUNTRY_CODE
    Display as: Select List
    HTML Form Element Attributes: onchange="get_select_list_xml1(this,'P6_STATE_CODE');"
    Source Used: Only when current value in session state is null
    Source Type: Database Column
    maintain session state: Per session
    Source value or expression: COUNTRY_CODE
    Named LOV: LIST OF COUNTRIES
    Name: P6_STATE_CODE
    Display as: Select List
    Source Used: Only when current value in session state is null
    Source Type: Database Column
    maintain session state: Per session
    Source value or expression: STATE_CODE
    Named LOV: - Select named LOV -
    List of Values definition:
         select state_code || ' - ' || state_desc d, state_code r
         from tbk_state
         where country_code = :P6_COUNTRY_CODE
         order by 1
    LIST OF COUNTRIES is defined as:
    select country_code || ' - ' || country_desc d, country_code r
    from tbk_country
    order by 1
    Now to the problem:
    I run page 5 (the report) to see the list of locations and then I try to edit a record (page 6). When I
    try to select a different country I get the following error (on IE):
    "Problems with this web page might prevent it from being displayed properly or functioning properly.
    In the future, you can display this message by double-clicking the warning icon displayed in the status
    bar.
    Line: 17
    Char: 5
    Error: Object expected
    Code: 0
    URL: http//cmrac4.cm.timeinc.com:7777/pls/htmldb/f?
    p=114:6:1413254636072443110::::P6_HARDWARE_LOCATION_ID:2
    I don't see any of the alert messages.
    I also tried to run the application process code in the SQL - Command Processor (I replaced
    :cascading_selectlist_item_1 with 'CA' or 'US') and got the following:
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh
    button, or try again later.
    Only one top level element is allowed in an XML document. Error processing resource
    'http://cmrac4.cm.timeinc.com:7777/pls/...
    <select><option value="99">- All States -</option><option value="X1">X1 - X1</option><optio...
    Can someone help me please?

    Varad,
    First, thank you for taking the time to try to help me with this problem.
    When I view the page's source code (here are the first few lines):
    <html lang="en-us">
    <head>
    <script src="/i/javascript/core.js" type="text/javascript"></script>
    <link rel="stylesheet" href="/i/css/core.css" type="text/css" />
    <script language="JavaScript" type="text/javascript">
    <!--
    htmldb_delete_message='Would you like to perform this delete action?';
    //-->
    </script>
    <script>
    function get_select_list_xml1(pThis,pSelect){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    //alert ('Dept no=' + pThis.value);
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=CASCADING_SELECT_LIST1',0);
    get.add('CASCADING_SELECTLIST_ITEM_1',pThis.value);
    gReturn = get.get('XML');
    // gReturn = get.get();
    //alert('Enames=' + gReturn);
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option");
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue);
    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>
    It looks like line 17 is:
    var l_Select = html_GetElement(pSelect);
    I'm still not sure why I'm getting this error and why it's not working?
    Thanks,
    Eti

  • How to populate another page item based on cascading select lists?

    Oracle 10gXE
    APEX 3.2
    I've created cascading select lists based on the examples (using Javascript and AJAX) that i've seen on this forum. Thanks for help on that!
    Now that I have these LOV's being populated without needing to submit the page, how do I take the value that is presently in each LOV and concatenate them together to populate another page item? I'm trying to build the URL string that will execute an Oracle Report once the user clicks a button.
    Previously, when I had multiple Select Lists with a submit, the URL was being put together using an After Submit Computation that would set the value for an item (P26_REPORT_URL) on the page. Notice that a report parameter (i.e. parameter name and Select List value) is only included if the user has provided a value. The page item that holds these values is then referenced by a button for URL redirect. The URL Target for the button currently is: javascript:popupURL('&P26_REPORT_URL.'), but will not work at the moment because P26_REPORT_URL page item is not changing based on what is selected in the LOVs. Since I'm not submitting anything (do I need to?), how do I put together the values needed?
    Computation for P26_REPORT_URL:
    DECLARE
    l_param VARCHAR2(2000);
    BEGIN
    l_param := '&REPORTS_URL.&report=&P26_RPT_VIEW..rdf&desformat=&P26_DESFORMAT.&destype=cache';
    IF REPLACE(:P26_OLO_CODE,'%'||'null%',NULL) IS NOT NULL THEN
    l_param := l_param||'&p_olo_code=&P26_OLO_CODE.';
    END IF;
    IF REPLACE(:P26_BEG_DATE,'%'||'null%',NULL) IS NOT NULL THEN
    l_param := l_param||'&p_start_dt=&P26_BEG_DATE.';
    END IF;
    IF REPLACE(:P26_END_DATE,'%'||'null%',NULL) IS NOT NULL THEN
    l_param := l_param||'&p_end_dt=&P26_END_DATE.';
    END IF;
    IF REPLACE(:P26_ORG_CODE_2,'%'||'null%',NULL) IS NOT NULL THEN
    l_param := l_param||'&p_org_code=&P26_ORG_CODE_2.';
    END IF;
    IF REPLACE(:P26_FLAIR_ORG_2,'%'||'null%',NULL) IS NOT NULL THEN
    l_param := l_param||'&p_flair_org_code=&P26_FLAIR_ORG_2.';
    END IF;
    IF REPLACE(:P26_BUDGET_ENTITY_2,'%'||'null%',NULL) IS NOT NULL THEN
    l_param := l_param||'&p_agy_code=&P26_BUDGET_ENTITY_2.';
    END IF;
    RETURN l_param;
    END;

    Andy,
    This is a great suggestion! After I posted, I started looking at a Javascript solution and figured it's probably what I had to do.
    However, now the cascading select list no longer working for some reason after I added the function to concatenate the item values. When I remove the showReport() function the select list works again.
    Here is what I have in the HTML Header portion of the page:
    <script language="JavaScript" type="text/javascript">
    function popupURL (url) {
      w = open(url,"winLov","resizable=1,width=800,height=600");
      if (w.opener == null)
      w.opener = self;
      w.focus();
    function showReport()
      var l_param = '&REPORTS_URL.&report=' + $v('P26_RPT_VIEW') + '.rdf&desformat=' + $v('P26_DESFORMAT') + '&destype=cache';
      if ($v('P26_OLO_CODE' != '')
       l_param += '&p_olo_code=' + $v('P26_OLO_CODE');
      if ($v('P26_ORG_CODE_3' != '')
       l_param += '&p_org_code=' + $v('P26_ORG_CODE_3');
      popupURL(l_param);
      function get_AJAX_SELECT_XML(pThis,pSelect){  
         var l_Return = null; 
         var l_Select = $x(pSelect); 
         var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=ORG_SELECT_LIST',0); 
         get.add('TEMPORARY_ITEM',pThis.value); 
         gReturn = get.get('XML'); 
         if(gReturn && l_Select){ 
             var l_Count = gReturn.getElementsByTagName("option").length; 
             l_Select.length = 0;
             for(var i=0;i<l_Count;i++){ 
                 var l_Opt_Xml = gReturn.getElementsByTagName("option");
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue)
    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>

  • Select list from query in report

    Hello everybody,
    I want to include a select list from a query in a report's colomn, but the select list should only be displayed conditionally. I wanted to do this with the help of "case when" in the corresponding SQL statement.
    The select list itsself works, but when I combine it with "case when" I always get the error message:
    ORA-01427: single-row subquery returns more than one row
    The select statement is as following:
    select
    htmldb_item.checkbox(1,rownum) " ",
    x.idee,
    x.stunden_ilp,
    x.stunden_ild,
    x.stunden_ilm,
    x.stunden_ief,
    x.stunden_ir,
    x.pe_id,
    x.l_art_id,
    x.version_id
    from (
    select
    (select case
    when (select name from cn_pl_projektidee s01
    where s01.idee_id = '2') IS NULL then
    (select distinct htmldb_item.select_list_from_query(5,name,'select distinct name from cn_pl_projektidee') name from cn_pl_projektidee s01
    where s01.idee_id = t1.idee_id)
    else
    (select distinct htmldb_item.text(5,name) name from cn_pl_projektidee s01
    where  s01.idee_id = t1.idee_id)
    END from cn_pl_std_peplanung t1) Idee,
    from cn_pl_std_peplanung t1, cn_pl_projektelemente z1, cn_pl_version u1, cn_pl_projektidee s1
    where t1.version_id = '&P6_VERSION_WAHL.'
    and t1.pe_id ='&P6_HELP_PRODET.' 
    and t1.l_art_id ='&P6_L_ART_ID.'
    group by t1.pe_id, t1.version_id, t1.idee_id, t1.l_art_id) x
    order by x.ideeDoes anybody know what could be the problem or what other solutions I could try??
    Greetings!
    Patrick

    Found 2 ways to solve it:
    *1. dynamic action (JQuery)*
    $("#f20_1234 option[value=13]").attr('selected', 'selected');
    *2. process*
    BEGIN
    HTP.p('<script type="text/javascript">');
    --HTP.p('problem()');
    HTP.p('html_SetSelectValue(''f20_903'',188)');
    HTP.p('html_SetSelectValue(''f20_903'',189)');
    HTP.p('</script>');
    END;

  • Dynamic Select List not displaying correct value

    Hi there!
    I have a page with a dynamic repeat region.
    As I press one record I get up all the details based on id on an edit page.
    The problem is that the info that is inserted via a Select List is not displaying correct on edit page.
    All the other values are correct, also the values in the repeat region on index page,
    but the value from the Select List on edit page is just displaying the initially selected item.
    Have tried using SELECT DISTINCT in the SQL statement, but no luck.
    Any other ideas?
    Cut and paste from form:
    <select name="Vegtype" class="ProvDet" id="Vegtype" title="<%=(rsAs.Fields.Item("VegType").Value)%>">
                        <option value="Ev" selected="selected">Ev</option>
                        <option value="Fv">Fv</option>
                        <option value="Rv">Rv</option>
                        <option value="Kv">Kv</option>
                      </select>
    Recordset
    <%
    Dim rsAs
    Dim rsAs_cmd
    Dim rsAs_numRows
    Set rsAs_cmd = Server.CreateObject ("ADODB.Command")
    rsAs_cmd.ActiveConnection = MM_LabCon_STRING
    rsAs_cmd.CommandText = "SELECT DISTINCT DatoM, DatoR, DatoU, Distr, FagFelt, Felt, IntNr, Km, KontrNr, Kontrollor, Masse, MasseBK, Punkt, Resept, TestID, UserID, VegHp, VegNavn, VegNr, VegType FROM tblTest WHERE TestID = ?"
    rsAs_cmd.Prepared = true
    rsAs_cmd.Parameters.Append rsAs_cmd.CreateParameter("param1", 5, 1, -1, rsAs__MMColParam) ' adDouble
    Set rsAs = rsAs_cmd.Execute
    rsAs_numRows = 0
    %>
    Regards,
    Christian
    DWCS5 | .Asp | MS Access

    Ok, here goes the top down approach...
    In the HTML header of my page, i have this reference to a js file containing the javascript - <script src="#WORKSPACE_IMAGES#108.js" type="text/javascript"></script>
    Then in an HTML Region I have the following code to create the divs that will be shown and hidden - <div id="divREGION" class="divs">Select region to get list of countries.</div>
    <div id="divCOUNTRY" class="divs">Select country to get list of cities.</div>
    <div id="divCITY" class="divs">Select city and then press "Get Employees". </div>
    Note that these divs contain static content. You may be able to create dynamic content for these divs by creating dynamic query regions and putting div tags around the region (i havent tried this, it may require template modification).
    The select boxes have this code in the "HTML form elements attributes" - onFocus="javascript:showHideDiv(this,true)" onBlur="javascript:showHideDiv(this,false)"
    This onFocus and onBlur call the showHideDiv() function, passing in the object reference of the select box and a true/false to show/hide the related div.
    The actual javascript function that is contained in the 108.js file is:
    function showHideDiv(objThis, inBool){
         var divid = "div" + objThis.id.substring(3);
         if (inBool) {
         ShowDiv(divid);
         else {
    HideDiv(divid);
    That function in turn calls either the ShowDiv() or HideDiv() functions, depending on the true or false, passing in the ID of the div to be changed...
    function ShowDiv(divid){
         eval('document.all'+ '["' + divid + '"]' + '.style' +'.display = "inline"');
    function HideDiv(divid){
         eval('document.all'+ '["' + divid + '"]' + '.style' +'.display = "none"');
    Hope this helps.

  • How do i change the size of a select list?

    Hello everyone,
    I know this is probably a newbie questiopn but i spent some time trying and already browsed for the forum to look and found nothing related to it.
    I m using apex 3.1, and i would like to know in what part of the item i define it's size, in the case of a select list where do i put it's size?
    In html i would do it like this:
    -----------------HTML CODE--------------------------
              <select size="18" class="bigselect">
                   <option>Mapa 1</option>
                   <option>Mapa 2</option>
                   <option>Mapa 3</option>
                   <option>Mapa 4</option>
              </select>
    -----------------HTML CODE--------------------------
    i already tried these and nothing:
    HTML Table Cell Attributes
    HTML Form Element Attributes <--- this one says i can t define id and size in it
    Form Element Option Attributes
    thanks and best regards

    Hi,
    I misunderstood you the first time :)
    It seems like APEX is automatically setting the SIZE attribute to 1 when you create a Select List. I'm not sure if you'll manage to change this value before the page is rendered. But if it is really important to you, maybe you can change this attribute after the page is rendered using javascript.
    Add this function to the page header section:
    <script type="text/javascript">
    function setLovSize(){
        var x=document.getElementById("PX_MY_SELECTLIST")
        x.size="18"
    </script>Then on the same page, put the following code into Page HTML Body Attribute:
    onLoad="setLovSize();"Hope this helps.
    Paulo Vale
    http://apex-notes.blogspot.com

  • Can a Link be attached to a select list option?

    Here is some code for a select list that pulls its data from a database:
    <select name = "sid" height = "1"class="dropit" >
    <?PHP while ($row = $result ->fetch_assoc())  {   ;
        echo '<option value='. ($row['id']);
        if (!(strcmp($row['id'], $row['id']))) {echo "selected=\"selected\" ";}
         ?>><?php echo $row['type']?>
    <?PHP } ?>   
    </select>
    This works fine with a form. It is fast, and you can jump to an option just by typing its first letter.
    I would like to code it so that the options have a link to another page attached to them without the need for a form.
    It would show the selected item, and next to it would be a link attached to the word "Update"
    The link would be similar to this: <a href="update.php?id=<?php echo $row['id']; ?>">Update</a>
    It is quite easy to do in a table, with the <a ref in one td and the name field in another like so:
    <table>
    <?php while($row = $result->fetch_assoc()) { ?>
      <tr>
        <td><?php echo $row['id']; ?></td>
        <td><?php echo $row['type']; ?></td>
        <td><a href="update.php?id=<?php echo $row['id']; ?>">EDIT</a></td>
       </tr>
      <?php } ?>
    </table>
    but it does not allow key navigation, and as I have a growing list of over 6000 items,it is becoming painfully slow to use.
    Is it possible to include a URL within the option,
    Or allow the option to be selected with the URL alongside it within the select list?
    Its part of a management system that I am updating.
    For searches on the live web I am able to filter the results in a better way, using a word search system..
    All help appreciated.
    Howard Walker

    Thanks Bregent. I never studied Jump Menus before today.
    A jump menu works to a degree, but unless I have made a coding error, it is not possible to jump to an item in the list by hitting a letter key while the list is active.
    Here is my code using a database table with an id and a single field:
    <script type="text/javascript">
    function MM_jumpMenuGo(objId,targ,restore){ //v9.0
      var selObj = null;  with (document) {
      if (getElementById) selObj = getElementById(objId);
      if (selObj) eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
      if (restore) selObj.selectedIndex=0; }
    </script>
    <form name="form" id="form">
      <select name="jumpMenu" id="jumpMenu">
                 <?PHP while ($row = $result ->fetch_assoc())  { ;?>
                  <option value=<?PHP echo"update2.php?id=".$row['id'] ?> ><?PHP echo $row["id"]." - ";?><?PHP echo $row["field_value"];?></option>
               <?PHP }   ?>
      </select>
      <input type="button" name="go_button" id= "go_button" value="Go" onClick="MM_jumpMenuGo('jumpMenu','parent',1)">
       </form>
    Unless every option has a different link, I can see little use for it.
    Seems little different to a standard form with a drop down menu and a GO button, and that does not need any javascript!
    It does give a workable example of how to populate a jump menu from a database, which I was unable to find on the web.
    Comments welcome.
    Howard

  • Apply distinct to all the columns in a select list

    Select distinct name, date , venue , duration from tableA
    the above query distinct onlu the first column in the select list but is it possible to distinct all the columns.
    current out put is
    1 , raj, 25-may-2009, uk , 10
    1 , raj, 25-may-2009, usa , 10
    1 , raj, 25-may-2009, uk , 20
    requried output....
    1 , raj, 25-may-2009, uk , 10
    the first found row is enogh...
    thanks in advance :)
    raj

    But all these tree rows are distinct. Doesn't it? Why you want to take only first row? What's the logic?
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • Cascading Select List Doesn't work properly

    I am trying to use Cascading Select List in My Application. It works for the first time when I run the page afterwards when I try to open the same page in a different window it doesn't work afterwards it doesn't work at all.My code is as follows.
    1) Application Process with name getDet
    DECLARE
    lv_os_List varchar2(32000) := '';
    platform varchar2(50);
    err_code number;
    err_msg varchar2(200);
    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('<select>');
    HTP.prn ('<option value="' || 1 || '">' || '- All OS -' || '</option>');
    select platform into platform from platform where platformid =:P139_PLATFORM;
    if platform = 'Sun SPARC' then
    for i in (select os , osid from ostype where os like '%Sola%' order by os) loop
    htp.prn('<option value="' || i.osid || '">' || i.os || '</option>');
    end loop;
    ELSIF (platform ='Linux (x86 & x86-64)') then
    for i in (select os ,osid from ostype where os like '%Linux%' or os like '%RH%' or os like '%SLES%' or os like '%OEL%' order by os) loop
    htp.prn('<option value="' || i.osid || '">' || i.os || '</option>');
    end loop;
    ELSIF (platform ='TRU64') then
    for i in (select os ,osid from ostype where os like '%Tru64%' order by os) loop
    htp.prn('<option value="' || i.osid || '">' || i.os || '</option>');
    end loop;
    ELSIF (platform ='Windows') then
    for i in (select os ,osid from ostype where os like '%Windows%' order by os) loop
    htp.prn('<option value="' || i.osid || '">' || i.os || '</option>');
    end loop;
    ELSIF (platform ='IBM Linux on Power') then
    for i in (select os ,osid from ostype where os like '%Linux%' or os like '%RH%' or os like '%SLES%' or os like '%OEL%' order by os) loop
    htp.prn('<option value="' || i.osid || '">' || i.os || '</option>');
    end loop;
    ELSIF (platform ='IBM System z') then
    for i in (select os ,osid from ostype where os like '%Linux%' or os like '%RH%' or os like '%SLES%' or os like '%OEL%' order by os) loop
    htp.prn('<option value="' || i.osid || '">' || i.os || '</option>');
    end loop;
    ELSIF (platform like 'HP%') then
    for i in (select os ,osid from ostype where os like '%HP%' order by os) loop
    htp.prn('<option value="' || i.osid || '">' || i.os || '</option>');
    end loop;
    ELSIF (platform ='Itanium') then
    for i in (select os ,osid from ostype where os like '%HP%' or (os like '%Windows%' and osid <> 201) or os like '%Linux%64%' or os like '%RH%64%'
    order by os) loop
    htp.prn('<option value="' || i.osid || '">' || i.os || '</option>');
    end loop;
    ELSIF (platform ='AIX') then
    for i in (select os ,osid from ostype where os like '%AIX%' order by os) loop
    htp.prn('<option value="' || i.osid || '">' || i.os || '</option>');
    end loop;
    ELSE
    for i in (select os ,osid from ostype order by os) loop
    htp.prn('<option value="' || i.osid || '">' || i.os || '</option>');
    end loop;
    END IF;
    htp.prn('</select>');
    EXCEPTION
    WHEN OTHERS THEN
    err_code := SQLCODE;
    err_msg := substr(SQLERRM, 1, 200);
    INSERT INTO ERROR_TABLE (error_number, error_message)
    VALUES (err_code, err_msg);
    END;
    2) Application Item
    CASCADING_SELECTLIST_ITEM_1
    3) In the Footer of the region which contains the items the following Java Script
    <script>
    function get_select_list_xml(pThis,pSelect){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=getDet',0);
    get.add('CASCADING_SELECTLIST_ITEM_1',pThis.value);
    gReturn = get.get('XML');
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option");
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue)
    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>
    <script>
    get_select_list_xml($x('P139_PLATFORM'),'P139_OS');
    </script>
    For the first Select list form element properties
    onchange="get_select_list_xml(this,'P139_OS')"
    Please let me know what change I need to make in the code.

    Vikas,
    Is your page 0 a public page or it requires authentication? I remember having the same
    problem a while ago.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/apex/f?p=107:7
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

Maybe you are looking for

  • Generate DDL formatting data incorrectly

    Greetings all, So I appear to have found the issue with my Generated DDL File. It is formatting the lines incorrectly and I have to manually go in and clean it up. For example: ALTER TRIGGER  "BI_MIMPBM_CA_GROUP_LKP" ENABLE;CREATE OR REPLACE TRIGGER 

  • I use IncrediMail and it keeps crashing and giving me a Runtime Error what can I do about this?

    The message is as follows: X Runtime Error! Program:c\Program Files (x86\Incred.Mail\Bin\ImApp.exe This application has requested the Runtime to terminte it in an unusual way. Please contact the application's support team for more information.

  • Verizon Wireless changed my EDGE start date +3 months w/o permission!!

    I signed up for the Verizon Wireless EDGE plan back on April 27, 2014 and received my letter of confirmation that I was now enrolled in the program. When I received my very next bill I noticed 2 things: 1) I was charged for my phone, 2) I did not rec

  • Limit of Rows in ResultSet

    Exactly how many rows can you actually handle in a result set. I have a database in which some table have over 10000 entries and some tables have only 1200. How many rows can I read in at one time without causing a problem with the application? Right

  • Problem with Jabber Telepresence Bridge

    I have a Jabber Video Telepresence account that I cannot access my personal bridge.  When I try to connect, it tells me "Call denied".  I can connect to other personal video bridges just fine. Can anyone tell me who I can open a support case through?