Referring to dynamically created form items

I have a requirement where I do not know how many rows are going to be added into a table from a form. What I have done is used javascript to dynamically create form fields. This is along the same lines as a tabular form, however it should not save any of the data until the whole page is submitted.
My problem is, how do I then refer to these form items within a PL/SQL procedure?
Below is the piece of javascript that creates new rows on the form (the options for the select item are fed in using ajax). And following that, the pl/sql loop that I have attempted to use which doesn't work.
NOTE: The onchange attribute on each of the form elements was to try to set a session state variable for each of the items. I got this from the following blog post.
http://deneskubicek.blogspot.com/2009/01/ajax-setting-item-session-state.html
Javascript
     var objectFormCount = 0
     function addObjectForm() {
          var newFormHTML = '<tr>';
          newFormHTML = newFormHTML + '';
          newFormHTML = newFormHTML + '<td><select onchange="f_setItem(this.id)" name="f01" id="f01_' + objectFormCount + '"></select></td>';
          newFormHTML = newFormHTML + '<td><input onchange="f_setItem(this.id)" type="text" name="f02" id="f02_' + objectFormCount + '"/></td>';
          newFormHTML = newFormHTML + '<td><input onchange="f_setItem(this.id)" type="text" name="f03" id="f03_' + objectFormCount + '"/></td>';
          newFormHTML = newFormHTML + '<td><input onchange="f_setItem(this.id)" type="text" name="f04" id="f04_' + objectFormCount + '"/></td>';
          newFormHTML = newFormHTML + '</tr>';
          $('#BackEndObjectTable').append(newFormHTML);
          objectFormCount++;
PL/SQL
FOR i IN 0..l_oracle_script_count
LOOP
--DEBUGGING VARS
l_test1 := v('f01_' || i);
l_test2 := v('f02_' || i);
l_test3 := v('f03_' || i);
l_test4 := v('f04_' || i);
l_test5 := i+1;
INSERT INTO MIGRATION_B_OBJECT (MIGRATION_B_ID,TARGET,SCHEMA,SCRIPT_LOCATION,SCRIPT_NAME,RUN_ORDER)
VALUES (l_mig_seq,v('f01_' || i),v('f02_' || i),v('f03_' || i),v('f04_' || i),i+1);
END LOOP;
Edited by: Dopple on 28-Jul-2011 01:59 - text was stripped from the body of the post.

For anyone with the same requirements. What I had to do was add the value of each form element into a temp table which was basically held key/value pair (form item/value) along with the username, the table that is to be updated and the row number.
Once the actual page was saved, the procedure built up an insert sql string from the values in the temp table and inserted each row.
Works a charm, although spitting the data back out into the dynamic forms is going to be a chore!!!!

Similar Messages

  • Is it possible to dynamically create form fields in PDF form?

    Hi all,
    I would like to dynamically create object like textbox, dropdown list from xml data. For example:
    When I receive following xml data:
    <field name="Check Box" type="selectbox"/>
    <field name="Text Field" type="textbox"/>
    I want to generate 2 form fields check box and text field with title "Check Box" and "Text Field" accordingly.
    Is it possible to do it in javascript for PDF form?
    Thank you and regards,
    Anh

    You cannot dynamically create objects on the fly like that but you can create interpret the XML and create an XDP file (which is the language of the template file) then bring that into Designer and create a PDF from that.
    Paul

  • Dynamically adding form items

    Hi All,
    I am facing problem while adding the form items to the form
    dynamically it get distorted and form items not in proper
    alignment.This issues is resolve when i revisit the same page
    again.
    Thanks, in advance.

    Notice that using array index "i" screws up the formatting of your post. It makes the font switch to italics! Anyway...I think what you want to be doing is this:
    String[] s={"a","b","c"};
    for(int j=0 ; j<s.length ; j++) {
        JButton b = new JButton(s[j]);
        this.getcontentPane().add(b);

  • Dynamically create Form Guide

    Is it possible to dynamically create a form guide using a data model? We want to be able to control what fields are hidden and visible based on the data. Can this be done through XML?
    Aditya

    I need to create dynamic form guides which can be controlled by data or schema . Don't know if Form Guides can interpret XFA/XML data or even XSD.
    We store information in a database, which varies by user. When a user accesses the guide, I need to create an XML/XFA, from the database, and pass it to the guide. This should determine which fields appear.... 
    The company wants to refrain from JS which is another challenge... 
    - Is there a way to dynamically change the appearance of the guide based ONLY on data? For example, hide or display fields
    - Similarly, is it possible to control access to certain fields base ONLY on data? For example, Read Only vs Editable.
    Aditya

  • How to Access the Dynamically created form element

    Hi friends,
    I have generated a dynamic form in flex using xml and i want to save the all the elements of the form with there label and entered data in the formItem.
    so i m getting how to save the data.
    anybody have idea about this?????
    Thanking you
    Gajanan

    Thanks for your reply.
    as u said i have done this
    for each(var formItem:FormItem in form.getChildren()){
                            formItem.label //The FormItem's label's text
                            formItem.getChildAt(0) //The first child - TextInput, ComboBox or whatever you got
                            Alert.show(formItem.getChildAt(0).toString());
                            return;
    my first child formitem is TextInput and i entered some value in tat textInput but i m printing this i m getting the "dynamicform.ApplicationSkin3._ApplicationSkin_Group1.contentGroup.grp.Form0.FormItem15.txt studentfname"  i m getting this output
    i want to access the entered value of in the textInput.
    Thanks,
    gajanan

  • Referencing runtime created form items

    How do I reference a ComboBox created at runtime in actionscript?
    itemCheckbox =
    new CheckBox();myForm.addChild(itemCheckbox);
    The name property does not seem to work.

    Refer to above post, You need to set the name property of your child explicitly then only you can be able to access this child by using getChildByName method.
    By saying:
    var myCheckBox:CheckBox = new CheckBox();
    and accessing by using myClass.getChildByName("myCheckBox").visible = false; this will not work coz myCheckBox is a reference to the child not a name assigned to the child.
    Also you can refer to this link earlier posted in forum :
    http://forums.adobe.com/message/2708552#2708552
    Further you may achieve your task by
    var myCheckBox:CheckBox = new CheckBox();
    myCheckBox.name = "myCheckBox" ;
    now try to access your checkbox by saying :
    myClass.getChildByName("myCheckBox").visible = false;
    Hope this helps you
    Cheers
    -Vikash

  • Dynamically create and remove TEXT items in forms

    Hi Guys,
    Is there a way to dynamically create and remove TEXT items in form. For example I have the EMP and DEPT table and when
    I select the EMP table name from the LOV, rows of the EMP table with column name and data should get displayed on the screen and likewise a similar action for DEPT table and
    so on. I have about 90 tables from where data could be required to view and edit. They all have varying number of columns.
    Any suggestions ?
    Thanks
    KMD
    null

    Use OLE concept of developer and map Excel as an object
    Nadeem
    null

  • Dynamically create document type Item Attribute using WF_ENGINE.AddItem API

    Hi
    Is WF_ENGINE.AddItem API , supported to create document type Item attributes dynamically ? If yes how do we set the display name of the attribute. If no then is there is any other method to dynamically create document tyoe item attribute?
    Thanks

    Hi,
    If the document is stored on a file system, then I would replace the message body with a PL/SQL document which includes links to the files as straightforward URLs. There would be no need to include them in the Workflow in any way. For example, I recently worked with a client where all the (file) attachments made within eBusiness Suite were then migrated into Oracle Universal Content Management and the attachment was replaced with a URL to the new document. Any notifications now just reference the URL link to the document within the document management system in an HTML notification. While the processing is going on, the user is given the list of files that exist as attachments, but no links because the document is being processed by the management system.
    If the attachments are going to be stored in Workflow as documents, you won't be able to change the display name though - display name is set for the attribute on the message, not for each specific notification. Changing the value of the display name for the message would impact all notifications that use that message, which isn't what you want.
    What you need is to dynamically build the notification (either using PL/SQL or OA Framework) and include a list of attachments in the notification. This may be a direct link to the document (either in a document management system or on a file system somewhere) that you can render as a URL, or a link to code that can retrieve the document from the database and serve that to the user. This is not a straightforward piece of work.
    If this is purely internal, you might be better off having a custom form / screen which displays the different documents, and link to that from the notification. Or you could link to a standard form for the transaction and have the users pick up the attachments directly from the transaction.
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://www.workflowfaq.com/blog ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • Add Item In Dynamic List form ...

    Hello ,
    I have created a dynamic list form using C# webpart in SharePoint 2013 .. Now it is creating List new Item form based on list view selected items ...
    I want to create functionality to add the list item .. how can I achieve this.?
    I am confused because list is creating dynamic controls and having dynamic id's ..then how can i get reference of all controls from dynamic form ..
    Thanks in Advance..

    Hi,
    I’m not quite sure about what your requirement is, please provide more detailed information such
    as screen capture or code, it will be easier for others to find a solution for you.
    Best regards
    Patrick Liang
    TechNet Community Support

  • Creating Region & Items Dynamically based on SQL Result

    Hi,
    I need to create regions dynamically during runtime based on SQL.
    So the number of regions and title will depends on the SQL result.
    I came accross the PLSQL Dynamic Content region type. I searched in the internet, I could not find a matching example.
    I looked at the APEX book, it mentions about 'Creating a Matrix of Fields Programmatically' but It's not very descriptive and it's using www_flow_api which i couldn't find documentation about it.
    So I am turning into this forum for help.
    Can you guys guide me to dynamically create region in a page?
    for e.g
    If my sql returns 5 records, I need to create 5 regions. Each region will contain a dynamically created tabular form as well depending on another SQL (from table function).
    Please let me know if I am not being clear about my question.
    Thanks a lot in advance.

    hello,
    I have the following SQL statement in my region.
    SELECT APEX_ITEM.DISPLAY_AND_SAVE(1,rectype) rectype,
           APEX_ITEM.DISPLAY_AND_SAVE(2,class_id) class_id,
           APEX_ITEM.DISPLAY_AND_SAVE(3,attribute_id) attribute_id,
           decode(rectype,1,'<p style="font-size:17px;color:white;background-color:#383838">'||title||'</p>',
                          2,'<p><b><i><big>'||title||'</b></i></big></p>',
                          3,replace(title,chr(13)||chr(10),'</br>'),
                          apex_item.textarea(4,title,5,200)) title,
           decode(rectype,1,'<p style="font-size:17px;color:white;background-color:#383838">'||review1st||'</p>',
                          2,apex_item.text(5,review1st,3,3),
                          3,APEX_ITEM.SELECT_LIST_FROM_LOV(5,review1st,'ARTIST_RANK',null,'NO'),
                          apex_item.hidden(5,review1st)) review1st,
           decode(rectype,1,'<p style="font-size:17px;color:white;background-color:#383838">'||review2nd||'</p>',
                          2,apex_item.text(6,review2nd,3,3),
                          3,APEX_ITEM.SELECT_LIST_FROM_LOV(6,review2nd,'ARTIST_RANK',null,'NO'),
                          apex_item.hidden(6,review2nd)) review2nd
      FROM TABLE (pkg_artist_review.f_artist_review (:P21_ARTIST_SEQ, :P21_ARTIST_DISCIPLINE,:P21_REVIEW_YEAR))as you can see I use DECODE because I need to do HTML formatting on the value and create ITEM according to the value of 'rectype'
    decode(rectype,1,'<p style="font-size:17px;color:white;background-color:#383838">'||title||'</p>',
                          2,'<p><b><i><big>'||title||'</b></i></big></p>',
                          3,replace(title,chr(13)||chr(10),'</br>'),
                          apex_item.textarea(4,title,5,200)) title, so the report result would look like
    rectype                  title
    [display f01]          title
    [display f01]          title
    [display f01]          title
    [display f01]          [text area f04]My question is :
    I would think my array list f01 and f04 will have different number of values inside.
    f01 will have 4 value, whereas f04 will only have 1.
    I tried to use
    decode(rectype,1,APEX_ITEM.DISPLAY_AND_SAVE(4,'<p style="font-size:17px;color:white;background-color:#383838">'||title||'</p>'),
                          2,APEX_ITEM.DISPLAY_AND_SAVE(4,'<p><b><i><big>'||title||'</b></i></big></p>'),
                          3,APEX_ITEM.DISPLAY_AND_SAVE(4,replace(title,chr(13)||chr(10),'</br>')),
                          apex_item.textarea(4,title,5,200)) title, I only ended up having the HTML code written to the report.
    How can I handle such situation?
    I need my array list to have the same number of records thus i could just use one index to iterate through the value.
    Thanks in advance.
    Edited by: joel2 on Mar 18, 2009 3:40 PM

  • Dynamic Actions on tabular form items

    Has anyone had success with using dynamic actions on a tabular form item?
    When I create a dynamic action for the selection type I believe I want to use DOM Object, I am just not sure what ID I then need to put into the DOM Object field.
    Any help would be greatly appreciated
    Regards
    Mark

    If you wish to use JavaScript with tabular forms, I suggest looking at APEX_ITEM column types. They allow you to specify the JavaScript array number of any given column in your tabular form and rely on it. Then as you loop through your rows you can positively identify the element.
    Example:
    Original query:
    select colA, colB from myTable;
    select apex_item.text(1, colA, 20,20) as myText,
      apex_item.select_list_from_lov(2, colB, 'LOV_MYLOV', 0, 'NO') myLookup
      from myTable;I also highly recommend Firebug for Firefox. It will allow you to drill down into the DOM on any page to see the element identifications as the browser sees them. Definitely the best browser plugin for web development.

  • Dynamic Creating item

    How can I create an item in the canvas when the form is running?
    The data items on the canvas is columns of a table. Now an
    column of the table is added. How can i dynamicly add the item
    in the forms writing some form's language? The columns of the
    table is often been added. I don't want always to rebuild
    the .fmb.
    Thanks!

    Hi ,
    Take a look at the following:
    Building a dynamic block at run-time
    Regards,
    Simon

  • Dynamically creating a database block in forms 10g

    hi guys ,
    i got a new requirement ,that is dynamically create a database blocks and items...
    how it is possible..?
    thanks...

    Hello,
    It is not possible. You cannot create blocks or items at runtime. What you can do is to have them created but hidden, then you set them visible as soon as you need them.
    Francois

  • Does Ipad adobe reader allow to fill a  dynamic xml form created on LiveCycle?

    The form was created using LiveCycle Designer ES3 for the purpose of being filled out on the spot at the client and then submitted as email attachment. However, Adobe reader does not seem to be able to open it giving the following error:
    "Please wait... If this message is not eventually replaced by the proper contents of the document, your PDF viewer may not be able to display this type of document..."
    The form is dynamic XML, and in the description of the Adobe Reader for the Ipad, it mentions that it is capable of opening forms under the Livecycle rights.
    However, if the Reader can not open dynamic XML's, how can I convert the form into a compatible fillable form for the Ipad?
    Thanks.

    LiveCycle Dynamic XML Forms are not supported in the Mobile versions of Adobe Reader.

  • How we create dynamic add form field in web form

    How we create dynamic add form field in web form?

    Hi,
    Thanks for reply.
    I need to create a form in which "add more" input field dynamically. For
    example sometime we need field on or more. Please look at the demo, I need
    to create form as per demo in business catalyst:
    http://www.openjs.com/scripts/examples/addfield.php

Maybe you are looking for