Populate HTML LIST ITEM with a query

Hello,
I've a problem,
I'm building a portlet based on an html form.
In this forms there are several list items,
How can I populate an html list item with a dynamic query based on a db table?

I hope you are looking for something like this
declare
v_ret_string varchar2(32767);
begin
v_ret_string := ' <TABLE BORDER="1" bordercolor="#0000FF" bgcolor="#FFFFF0">
               <TR><TD><TABLE BORDER="0" CELLSPACING="3" CELLPADDING="0">
               <BR>
                    <TR><TD ALIGN=middle><SELECT SIZE="1" NAME="emp_list">
                         <OPTION VALUE="">';
For get_emp_list In (Select ENAME,EMPNO
From SCOTT.EMP
          Order by ENAME) Loop
v_ret_string := v_ret_string || '<OPTION VALUE="'||get_emp_list.EMPNO||'">'||get_emp_list.ENAME;
End Loop;
v_ret_string := '</SELECT></TD></TR><TABLE></TABLE>';
End;
which uses PL/SQL code to generate the html page.
Thanks
-Krishnamurthy

Similar Messages

  • How to Populate a List item with LOV'S

    How to Populate a list of items with Lov's
    and then how to dynamically change the Values of one LIST Item
    Based on the Value of anothe List item

    976798 wrote:
    --Hello..I want to ask that How to bind a list item with  table values? this below code does not populate items from database to list item.Pls any body give me solution.
    declare
         group_id RecordGroup;
         list_id Item:=Find_Item('LST_CLASS');
         status number;
    begin
         group_id:=Create_Group_From_Query('Answer_List','select CLASS_ID,CLASS_NM from CLASS_MSTR');
         status:=Populate_Group('Answer_List');
         message(to_char(status));
         Populate_List(list_id,group_id);
         end;Welcome to the Oracle Forums. Please take a few minutes to review the following:
    <ul>
    <li>Oracle Forums FAQ
    <li>Before posting on this forum please read
    <li>10 Commandments for the OTN Forums Member
    <li>How to ask questions the smart way
    </ul>
    Following these simple guidelines will ensure you have a positive experience in any forum; not just this one!
    Check this link: How to Dynamically Populate a Pop List ?
    Hope this helps
    Hamid
    If someone's response is helpful or correct, please mark it accordingly.

  • Populate list Item with a recordgroup?

    Hi Friend
    I want to populate a list Item with a "Recordgroup". Does it possible without using the add_eliment function?
    I did it through the Loop to read the item from record group. If the database changes the record does not change in my list item. because the list containing the added items which was delivered in the load time. But like Pressing F9, we can easily see the last changed data of the database.
    If possible please send me the detail code to me. Here I delivered the detail procedure which i did for that purpose.
    Farhad
    ==========================================================
    PROCEDURE Populate_Item_In_List (     List_name VARCHAR2,
                                                                                         QUERY_Text VARCHAR2,
                                                                                         rg_Level_Col_name VARCHAR2,
                                                                                         rg_Value_Col_name VARCHAR2) IS
         HERE THE PROCEDURE POPULATE THE LIST WITH THE REQUIRED DATA UNDER A CORRCET SQL (SELECT) COMMAND
         List_name                     THE LIST ITEM WHICH HAS TO BE LOADED BY THIS PROCEDURE
         QUERY_Text                     THIS CONTAINS THE QUERY TEXT BY WHICH THE LIST ITEM WILL LOAD
         rg_Level_Col_name THIS IS THE LEVEL OF THE REQUIRED ITEM THAT OBVIUSLY A CHAR DATA TO BE RETRIVE
         rg_Value_Col_name THIS IS THE VALUE OF THE REQUIRED ITEM THAT OBVIUSLY A NUMBER DATA TO BE RETRIVE
                   R_Group          RecordGroup;
                   Rowcount      NUMBER;
                   rg_name      VARCHAR2(40) := 'DefaultRG';
                   rg_id      RecordGroup;
                   errcode      NUMBER;
                   Lid                    Item;
    BEGIN
         --+++++++++++++++++++++THIS IS USED TO POPULATE THE RECORD GROUP+++++++++++++++++++++++++++++++++
                   rg_id := Find_Group(rg_name);                                             Find the record group                                                   +
                                                      --+
                   IF Id_Null(rg_id) THEN                                                                                                                                                                          --+
                             rg_id := Create_Group_From_Query(rg_name,Query_Text);                                                                                     --+
                             errcode := Populate_Group(rg_id);                                                                                                                                       --+
                   else                                                                                                                                                                                                                       --+
                             errcode := Populate_Group_With_Query(rg_id,Query_Text);                                                                            --+
                   END IF;                                                                                                                                                                                                                  --+
         --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     
              If errcode = 1403 then
                   Message('There is no data to be retrive......');
              else
         --+++++++++++++++++++++THIS IS USED FOR LOADING DATA TO THE LIST ITEM++++++++++++++++++++++++++++
                   Rowcount      :=      Get_Group_Row_Count(rg_id);                              Counting the total rows in RGroup          +
                   Lid                    :=     Find_Item(List_name);                                                                                                                                            --+
                   Clear_list(Lid);                                                                                          Clear the list which is loaded now     +
                   FOR J IN 1..Rowcount LOOP                                                                                                                                                                     --+
         Add_List_Element(List_name,                                                            the name of the list item                              +
                                                      J,                                                                                index of the list                                                  +
                                                      Get_Group_Char_Cell('DefaultRG.'||rg_Level_Col_name,j),     Level of item+
                                                      Get_Group_Number_Cell('DefaultRG.'||rg_Value_Col_name,j) value of item+
                                                      );                                                                                                                                                                               --+
                   END LOOP;                                                                                                                                                                                                             --+
         --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
              end if;
    END;
    ===============================================================

    Hi Farhad,
    You can make use of Populate_List built-in.
    Populate_List(list_id, 'RECGRP');
    You can find more information in online documentation of forms.
    Cheers
    Zakiy

  • How to populate a list item...

    Hi Guys,
    i have created one of the field on my form as List Item. Now i want to populate this Item with some values in a table.
    I have a base table with
    Country_ID and Country_Name fields.
    I want to populate my List Item on the form in such a style that it just display Country_name in the list, while Country_ID is saved in the database.
    The datatype of the field on my form is NUMBER.
    How can i populate my list item with a values selected from a database table, description is displyed while code is to be save?
    Pliz help,
    Imran Baig

    >
    Hi Guys,
    i have created one of the field on my form as List
    Item. Now i want to populate this Item with some
    values in a table.
    I have a base table with
    Country_ID and Country_Name fields.
    I want to populate my List Item on the form in such a
    style that it just display Country_name in the list,
    while Country_ID is saved in the database.
    The datatype of the field on my form is NUMBER.
    How can i populate my list item with a values
    selected from a database table, description is
    displyed while code is to be save?
    Pliz help,
    Imran Baighi
    my question is how is the county id value assigned hidden field to be saved to the database.
    secondly the reply states populate list(lstitem,grp_county) my question is which field are you populating here - the display value the country name or the county id to be saved in the database.
    most of the notes says you have to create a value twice. one for label and one for value, how is this applicable to be above case.
    i have a record group -
    SELECT site_abbrev,TO_CHAR(site_code)
    FROM sgr_site_list with 2 fields x_site not displayed but receives the site code and save to the database, the other x_site_abbrev displayed and receives site_abbrev but not saved to the database. this is the trigger i have written
    declare
    site_grp recordgroup := find_group('site_grp');
    i_list_item item := find_item('control.x_site_abbrev');
    status varchar2(80);
    begin
    status := populate_group(site_grp);
    CLEAR_LIST(i_list_item);
    POPULATE_LIST(i_list_item,site_grp);
    but i get the form error 40176 cannot create list ...
    can someone help please, the whole concepr is a bit confusing
    thanks

  • Populating list item with a record group

    I'm trying to populate a list item (TList) with a Record group with a simple query: SELECT FRM_NAME FROM FORM
    In the forms WHEN_VALIDATE_NEW_FORM trigger, I use POPULATE_LIST('FORM_LIST', 'RG_FORM_LIST');
    Am I missing something? I get the error FRM-41334: Invalid record group for list population.

    thanks, i've tried that, but still nothing. I must be doing something simple, but very wrong. I tried with oracle's default scott/tiger schema, created a simple form with a record group with 2 columns, and populating a manually made poplist (populate_list('LIST4', 'RG1'); Still get errors:
    FRM-30191: No list items defined for required poplist.
    List LIST4
    Item: LIST4
    Block: EMP
    Form: MODULE5
    FRM-30085: Unable to adjust form for output.

  • Deleting a List Item with Very Huge Amount of Versions

    A faulty workflow flooded list items with 50K+ versions on SharePoint List. Attempts to open the list item/delete/edit via SharePoint UI/PowerShell failed! Programmatic iterations to delete versions/items trys to consume complete server memory and
    fails.
    Deleting the complete list is successful, but that results in SharePoint timer jobs fail and places Lots of Block in the database, which stops SharePoint sites from loading.
    Any help please?

    SP 2010 and 2013 support a max of 50,000 versions. Accessing more than 5000 items at a time causes SQL Server to escalate from row locks to table locks, which will generally bring SharePoint to a stop. You will need to write code that can bring back subsets
    of the data, and the only approach I can think of is a CAML query. But, I can't find any examples of working with versions using CAML.
    You could just change the Throttling settings in Central Admin from the default of 5000 to 50000 and then run your code during off hours.
    Mike Smith TechTrainingNotes.blogspot.com
    Books:
    SharePoint 2007 2010 Customization for the Site Owner,
    SharePoint 2010 Security for the Site Owner

  • How to create list items with multiple attachment files using rest api javascript

    In one of user form I am using javascript rest api to create a list item with multiple attachment files. So far I am able to create list item and once created uploading an attachment file. But this is two step process first create an item and then upload
    a file.
    It create an additional version of the item which is not desired. Also I am not able find a way to attach multiple files in a go. Following is the code I am using.
    createitem.executeAsync({
                    url: "/_api/web/lists/GetByTitle('UserForm')/items(1)/AttachmentFiles/add(FileName='" + aFile.name + "')",
                    method: "POST",
                    contentType: "application/json;odata=verbose",
                    headers: {
                        "Accept": "application/json;odata=verbose",
                        "X-RequestDigest": $("#__REQUESTDIGEST").val()
                    binaryStringRequestBody: true,
                    body: fileContent,
                    success: fnsuccess,
                    error: fnerror
    So somehow I need to combine item attributes along with attachment files in body: param. I visited https://msdn.microsoft.com/en-us/library/office/dn531433.aspx#bk_ListItem but no success.
    Appreciate any help.

    Thanks Mahesh for the reply and post you share it was useful.
    But this does not solve the core of the issue. You are uploading attachments after creation of item and multiple files are being attached in loop. This is kind of iterative update to an existing item with attachments. This will end up creating multiple versions. 
    What I am trying to achieve is to create an item along with multiple attachments in a go. No item updates further to attach a file.
    Please suggest how this can be done in one go. SharePoint does it when one creates an item with multiple attachment.
    Thanks for your reply.

  • SharePoint Designer 2013 (2010 Platform Workflow) - How can I create a new list item with a SPECIFIC content type?

    In SharePoint 2010 I created workflows that used the 'Create list Item' Action, which then set the Content Type ID (so I could create documents of various types in a document library). 
    We just switched to the SharePoint 2013 platform, and now the drop down for Content Type ID is blank in all of the workflows that are still using the SharePoint 2010 platform.  Is there any way to create a list item with specific content
    type?  Even if I could just input a string into that field instead of using this blank drop-down.  Please help! 

    Hi Sarah,
    According to your description, my understanding is that you cannot create a new list item with a specific content type using SharePoint 2010 Platform Workflow.
    I tested the same scenario in my environment, and the Create List Item worked fine with the specific content type.
    How did you create the content type?
    Please check if the content type is added to the list/library the workflow associated with.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Customising a SharePoint list content type form - "Manage multiple list items with this form"

    I have designed a form for a content type on an existing SharePoint list.  When I ran the initial wizard, I selected
    Manage multiple list items with this form which is great, exactly what I want.
    But, there are some columns in this content type that I do not want repeating and have them moved them outside of the Repeating Section but I am getting the below error.  I can't seem to find a way to create a new non-repeating group though.  Any
    advice on how to do this?

    *Bump*

  • Unable to populate list items with criteria

    Hi
    I want to populate some values based on condition in a text field.
    I tried the code wihtout condition in new form instance and its working fine but when i tried with an condition on when mouse click on list item and its working for first action.If list having more than 1 values in list its became blank and not working
    DECLARE
    group_name varchar2(40) :='LSTCUR';
    group_id RecordGroup;
    list_id item := Find_item('TB.LSTCUR');
    status NUMBER;
    begin
    IF Id_null(group_id) THEN
    group_id := Create_Group_From_Query('LSTCUR','select distinct curr,curr from REC_CURR_V where br =:TB.PSRCH');
    END IF;
    Clear_list(list_id);
    status := Populate_Group('LSTCUR');
    Populate_list(list_id,group_id);
    end;
    rgds
    soumya

    soumya,
    Try this code.
    DECLARE
         RG_Group_ID RECORDGROUP;
         Num_Status NUMBER;
    BEGIN
         RG_Group_ID := FIND_GROUP('LSTCUR');
      IF NOT Id_Null(RG_Group_ID) THEN
              DELETE_GROUP(RG_Group_ID);
      END IF;
         RG_Group_ID := CREATE_GROUP_FROM_QUERY('LSTCUR', 'SELECT DISTINCT CURR, CURR FROM REC_CURR_V WHERE BR = ''' || :TB.PSRCH || '''');
         CLEAR_LIST('TB.LSTCUR');
         Num_Status := POPULATE_GROUP('LSTCUR');
         POPULATE_LIST('TB.LSTCUR', RG_Group_ID);
    END;Regards,
    Manu.
    If my response or the response of another was helpful, please mark it accordingly

  • Filling a multi-column list box with a query

    Hi folks!
    I'm really very unexperienced with Oracle Forms so I wasn't able to implement the following problem. I have got a database table called 'employees' with the columns 'id', 'firstname', 'lastname'. In my form I would like to have a listbox containing all the entries of this table (based on a select ... from employee) but with only 2 visible columns (firstname and lastname).
    My first question is, how to fill the list with the values from the query. The second question is, when the user selects an entry of the list (an employee), how can I get the ID of this employee?
    I hope you can help me!
    Thanx in advice
    Ingo

    A list item can have only two columns - one shown to the user and one invisible one which actually populates the item. In order to display your names you need to concatenate them into one.
    Create a record group with the query:
    select firstname||' '||lastname, id from employees
    then in a suitable trigger (eg when-new-form-instance)
    call POPULATE_LIST(list, recordgroup)

  • Increase value of Select List Item with a Button

    Hi all,
    I've got an apex appli which is working well.
    In one report page I use a select list with a LOV, but I want to "enhance" this functionality:
    I need a kind of button which increments the item-value of the select list by 1,
    so that the user can easily skip to the next value of the LOV without scrolling thru the select list.
    Unfortunately I dont't get it working. Has anyone an idea how to realize that?
    thanks in advance
    Frank

    Hello Frank,
    Assuming your select list item is called P1_SELECT, you can define an HTML button, next to the item, that will do the trick.
    In the Post Element Text field of P1_SELECT, you can have similar code to the following:
      <input type="button" value="Next Value" onclick="$x('P1_SELECT').selectedIndex+=1;" />Hope this helps,
    Arie.

  • Populate non database items with lov

    Hi,
    Let's say that I have one database block with 2 columns ID and NAME.
    Only ID it is a not displayed database column, and NAME it is a displayed text item with an lov which retrieve data for both columns.
    How can I do, to populate the non database item NAME after querying the block, without using POST-QUERY trigger and select into statement.
    Thanks.

    Hi Gabriel
    How can I do, to populate the non database item NAME after querying the block, without using POST-QUERY trigger and select into statement.u can't do that but with using POST-QUERY trigger and select into statement.
    This Trigger fires the action of populating the non-db item block Level after executing query...
    Regards,
    Amatu Allah

  • How to make a automatic list (item) with request

    Hello,
    In first i'm french so i'm sorry for my bad english!
    I want to make a list (Item i think) where data are comming from my DB.
    So when i will clic on the list i will see all the employe
    I don't want to put each employe one by one with the option values
    It will be a request
    thanks for your help and if you have any question ask me
    I want insert this code in my list after correction
    <?php
    $username="hr";
    $paswd="hr";
    $dbstring="//localhost/XE";
    $db_conn= ocilogon($username,$paswd,$dbstring);
    $query = "select * from cat";
    $stmt=OCIParse($db_conn,$query);
    OCIExecute($stmt,OCI_DEFAULT);
    print'<table border="1" cellspacing="0" cellpadding="3">';
    print'<tr>';
    for($i=1;$i<=ocinumcols($stmt);$i++)
    print '<td class="e">'. ocicolumnname($stmt,$i).'</td>';
    print'</tr>';
    while (OCIfetch($stmt)) {
    print'<tr>';
    for ($i=1;$i<=ocinumcols($stmt);$i++)
    print '<td class="v">'. ociresult($stmt,$i).'</td>';
    print '</tr>';
    print'</table>';
    OCIFreeStatement($stmt);
    OCILogoff($db_conn);
    ?>

    Something has to print out a basic list of choices one by one (unless, perhaps, you use Smarty).
      $conn = oci_connect("hr", "hr", "//localhost/XE");
      $stmt = "SELECT employee_id, last_name from employees order by last_name";
      $stid = oci_parse($conn, $stmt);
      oci_execute($stid);
      $num = oci_fetch_all($stid, $res);
      if ($num) {
        echo "<form method=\"POST\" action=\"{$_SERVER['PHP_SELF']}\">\n";
        echo "<select name=\"EmployeeName\">\n";
        for ($i = 0; $i < $num; $i++ ) {
          echo "<option value=\"{$res['EMPLOYEE_ID'][$i]}\">";
          echo htmlentities($res['LAST_NAME'][$i]);
          echo "</option>\n";
        echo "<input type=\"submit\" value=\"OK\">\n";
        echo "</select></form>\n";
      }Also check out utilities like http://pear.php.net/package/HTML_QuickForm
    If you want to use XMLHttpRequest, look for AJAX toolkits.
    -- cj

  • List item - Record Group Query - Alignment improper Order

    Dear All,
    When am trying to concatenate two columns using record group query and displaying in the list item, the alignment is not in proper order.
    E.g; Below is the columns and data's used in process:
    CODE_VALUE     SHORT_DESC     DESCRIPTION
    ROLL1     Customer - Non accidental     Production, booking with other carrier, bad projection.
    ROLL2     Customer - Accidental     L/C, B/L draft, Customs, Samples, AMS, LAR.
    ROLL3     ABC - Lack of empty     Lack of empty units.
    ROLL4     ABC CDE - Roll over     AGR RRR decision.
    ROLL5     ABC XXX - Accidental     IMO or OOG refused, operational problems, Cut & Run.
    ROLL6     ABC YYY - Fictive booking     Equipment buffer, dummy booking.
    Below is the record group query used in forms:
    PROCEDURE p_when_new_form_instance
    IS
    GROUP_ID recordgroup;
    list_id item := FIND_ITEM ('BLK_CONTROL.LI_ROLL_REASON');
    rg_name VARCHAR2 (20) := 'LI_ROLL_REASONS';
    status NUMBER;
    l_query VARCHAR2 (4000);
    BEGIN
    l_query :=
    'SELECT rpad(short_desc,50,'' '')||'' | ''||description description, code_value code_value FROM codes WHERE code_value IN (''ROLL1'', ''ROLL2'', ''ROLL3'',''ROLL4'',''ROLL5'',''ROLL6'')';
    GROUP_ID := CREATE_GROUP_FROM_QUERY (rg_name, l_query);
    status := POPULATE_GROUP (GROUP_ID);
    POPULATE_LIST (list_id, GROUP_ID);
    EXCEPTION
    WHEN OTHERS
    THEN
    pl_common.when_others;
    END;
    Moreover i have my list item font property by default as ""MS SANS SERIF" and when i run in Forms Builder am getting the alignment as below.
    Result:
    ====
    DESCRIPTION     CODE_VALUE
    Customer - Non accidental | Production, booking with other carrier, bad projection.     ROLL1
    Customer - Accidental | L/C, B/L draft, Customs, Samples, AMS, LAR.     ROLL2
    ABC - Lack of empty | Lack of empty units.     ROLL3
    ABC CDE - Roll over | AGR RRR decision.     ROLL4
    ABC XXX - Accidental | IMO or OOG refused, operational problems, Cut & Run.     ROLL5
    ABC YYY - Fictive booking | Equipment buffer, dummy booking.      ROLL6
    Above order is not the expected result as all the |(pipe) symbol should display in proper order as below.
    Expected Result:
    ==========
    DESCRIPTION     CODE_VALUE
    Customer - Non accidental | Production, booking with other carrier, bad projection.     ROLL1
    Customer - Accidental | L/C, B/L draft, Customs, Samples, AMS, LAR.     ROLL2
    ABC - Lack of empty | Lack of empty units.     ROLL3
    ABC CDE - Roll over | AGR RRR decision.     ROLL4
    ABC XXX - Accidental | IMO or OOG refused, operational problems, Cut & Run.     ROLL5
    ABC YYY - Fictive booking | Equipment buffer, dummy booking.      ROLL6
    I tried with RPAD and LPAD still the alignment issue is there; i know the issue is because of invariable length of the font.
    But is there any solution to override this it will be of great help.
    So please help!!!!!!!!!!!!!!!!!
    Thanks..................
    Regards,
    Sunil.G

    Hi Francois,
    Thanks for your reply. I have tried changing the font to "Courier(Western)" it is working fine.
    But as per the standards defined, it should be "Ms Sans Serif" nothing apart from that.So that is where the problem lies. :(
    Regards,
    Sunil.G

Maybe you are looking for

  • Audio not working / Video flashes to black every ~5 seconds

    Hi. For some reason, when we turn on our TV as of late, every channel is having this issue where upon turning on, the video will flash to black every 5 seconds or so, and there is no audio. The only thing that solves the problem is unplugging and rep

  • HTMLDB_APPLICATION_FILES and .docx

    Hello All,     I have a program that uses htmldb_application_files to upload documents to a database. It works fine with .doc documents, but does not work with .docx documents. Any input would be greatly appreciated. Thanks in advance! Sharon

  • Batch Selection in Tcode LP12

    hello experts we are using release order parts to stage the material Tcode LP12 for Production in the LP12 screen the batch tab is deactivated ,can anyone tell me how to activate the batch field in LP12 tcode so that we can pick the batches in that s

  • Oracle 10.2.0.4 Index on timestamp column not used when SYSTIMESTAMP Used.

    Hi, I have a table A with a column B timestamp(6). The tables contains around 300000 rows.. I have created index 'idx' on the column B. When i compare column 'B' with systimestamp, it does not use the index, whereas if i compare 'B' with sysdate it u

  • Does QT Pro edit soundtracks simply?

    A really basic question before I spend $30.... QT plays videos recorded with my camera in movie mode fine. I just can't do much editing. If I upgrade to QT Pro will I be able to edit the soundtracks separately from the video? (Specifically, can I eli