Add element in dropdown list dynamically

Hi All,
I am facing a problem in adding item in a dropdown list dynamically.
When i get dropdown list through IgetElementById get null.
var list = document.getElementById("targetgroupname");
here list comes as null. Now I've to fill this list. I am using below code -
for(var j=0;j< com.length;j++){
iist.options[j]= new Option(com[j],com[j]);
But it is not working. My list is not getting filled with these values.
I doubt due to var list -> null it does not allow to add element.
But I am not getting any clue, how to initialize it.
Please suggest, I am new to javascript.
Thanks & Regards,
Sneha.

Hi,
Thanks for the reply, yes the select box has that id - targetgroupname.
actually there are 2 dropdown lists, Based on the selection of first dropdown list another list shd be filled.
So I've written a script at "onchange" of first dropdown list. It works fine when a value gets changed at first dropdown list.
In some cases I've to display a preselected value at first list ( which comes from previous page as parameter), in that cases there will be no onchange on first list, so I've called the script function manually after creating the first list,like below :
<SCRIPT> checkSource();</SCRIPT>
and in this case it does not work & I get a null when i try to read the 2nd list.
But I am not sure why it is happening.. may be it is not loaded /created on page when i am calling it.
If yes, what shd I do ?
Thanks for your time.
Regards,
Sneha

Similar Messages

  • How to add Gap between dropdown List Items - ComboBox in MFC VC++

    How to add Gap between dropdown List Items - ComboBox in MFC VC++

    Did you tried SetItemHeight() inside your App .
    Thanks
    Rupesh Shukla

  • Add values in Dropdown list

    Hi,
    My reqiurement is to add values in Dropdown list which is standard one. Already threre some values are there, like
    hourly,daily,wekly.
    Now I need to add montly value to the above dropdown list.How this can be done.
    Suggest me.
    Thanks,
    Brahmaji

    Hi,
    Expand the Attribute Period_type and double click on its GET_V method.
    You will find following code line :
    lr_ddlb->set_selection_table( me->job_wizard ).
    Double click on the Set_selection_table method to open the method code.
    You will find a LOOP.. ENDLOOP there. Here,to remove the values, comment out this LOOP- ENDLOOP.
    and  add following lines
             ls_ddlb-key   = 'Y'.
            ls_ddlb-value = 'Yearly'.
            APPEND ls_ddlb TO me->ddlb.
    Thats All .
    Hope it Helps.
    Regards,
    Suchita

  • Is it possible to add elements to the lov dynamically?

    Hi,
    I'm using forms6i.
    I've one record group which fetches data from the table, and based on that recordgroup i have one lov.
    But based on the values entered by the user at runtime,(which wont be there in table till it is saved),
    I want to add those items to the already exisitng lov. Is it possible?
    Say i have one column pack_serial, for which i've attached thie above said lov.
    And in the table pack_serial have values 1,2
    In runtime, user entered one more value say 3 to the pack_serial, which is not saved to the table yet
    and the for the next record, user wants to view the elements in the lov. 1,2 is already there since it is saved in the table.
    In addition to that i want to show 3 also(just entered value) in the lov.
    So i may have to add this value,3, to the list dynamically, may be in when-validate-record trigger or something.
    Is the above said possible? if yes please help me do it
    Thanks

    Hi Francois,
    As i explained above, the item should be added to lov for the next record irrespective of whether it is saved to the table or not.
    Like the form looks like this
    PACKSERIAL SERIAL  PACK TYPE  WEIGHT VOLUME.....
    1                1          Type1          4           5
    1                2           ......
    2                1           ....
    3                1           ...Now suppose the first three records are already there in the database, (with packserial 1 and 2)
    and when user try to view the lov from the 4th record, the lov will contain 1 and 2 , as per the recordgroup query which fetches from the table
    But instead he is entering new packserial 3, so serial becomes 1, and then he fills all the other details.
    Now agian user wants to add another record in same packserial 3 with serial 2.
    So this time we should show the lov with values 1,2 (which is already available ) + 3.
    So everytime user tries key-listval may be i need to retrieve all the additionally entered pack serials in the form and add to the lov, before showing the lov.
    Hope it is clear, Please suggest the best way, i'm not v much aware of the multi user environment
    I referred the below thread,
    Dynamically generting LOV's in Forms 6i based on the values entered
    Though the value is getting added to the lov(from the groupcount i understood), it is not displayed!
    Please go through my code in W-V-I (when user enters new pack serial)
    Declare
         rg_name  VARCHAR2(20) := 'RG_PACK_GROUP_SERIAL';
         rg_id    RecordGroup;
         res boolean;
         num number;
         i number := 2;
         errcode number;
         no_of_rows number;
    Begin
    rg_id := Find_Group( rg_name );
         IF NOT Id_Null(rg_id) THEN
              errcode := Populate_Group(rg_id);
              no_of_rows := Get_Group_Row_Count(rg_name);
              Add_Group_Row( rg_id, no_of_rows+1 );
              Set_Group_Number_Cell( 'RG_PACK_GROUP_SERIAL.SPM_PACK_GROUP_SERIAL',no_of_rows+1,:SPM_PACK_GROUP_SERIAL);
              no_of_rows:=Get_Group_Row_Count(rg_name);
         message('value added '||no_of_rows||','||Get_Group_Number_Cell('RG_PACK_GROUP_SERIAL.SPM_PACK_GROUP_SERIAL', no_of_rows));
         message(' ');
         END IF;
         errcode := Populate_Group(rg_id);
         End if;
    End;Note : I already have the record group,'RG_PACK_GROUP_SERIAL', with select query in it.
    Thanks

  • Unable to add items to dropdown list using javascript

    Hi,
    I'm trying to add additional items to a dropdown list at runtime using javascript.
    I'm doing this by invoking the addItem method on the dropdown list field during its initialize event.
    However when I run the generated pdf in Acrobat Pro, I get the following error in the console -
    GeneralError: Operation failed.
    XFAObject.addItem:3:XFA:form1[0]:#subform[0]:field0[0]:initialize
    Method: 'addItem' cannot be called because doing so would violate this document's permissions settings.
    The pdf form has no signatures or any other stuff in it.
    What additional permissions do I need to add and how ?
    You can view the pdf here -
    https://dl.dropboxusercontent.com/u/8022836/xfa3_test.pdf
    Thanks,
    Joel

    Is there a reason to use the code you did? It looks like the problem is with the variable's permissions when going through the template.
    This code works just fine in that same event:
    this.addItem("new item");
    As does:
    var f = xfa.resolveNode("form1.#subform1[0].field0");
    f.additem("new item");

  • How to Add values to dropdown list in runtime

    Hi All
    I wanted to add the items to the dropdown list in the plugin.
    The SDK Example WriteFishPrice shows the items are hard coded in the .fr file.
    i am looking for a similar concept, but not adding the items in the .fr file, i wanted to add the items in the .cpp or .h files and add the items to the dropdownlist.
    DECLARE_PMID(kWidgetIDSpace, kWFPDropDownListWidgetID, kWFPPrefix + 2)
    The declaration is done in WFPID.h file
    #define kWFPDropDownItem_1Key kWFPStringPrefix "kWFPDropDownItem_1Key"
    defining the string is done in WFPID.h
    I wanted to add the items in the same header file, is there any way that i can add the items in the header files instead of adding in .fr file
    Please guide me
    Thank you
    -Srinivas

    Hope this will help you a bit with both threads ; )<br />I'm not sure what you are trying to accomplish with defining the strings in an header or cpp file and not in the fr file(s). Usually you sort of predefine strings in the main fr file and then give a "final" translation definition for each string in the corrosponding language file. If you don't need or want to translate you can define string constants almost wherever you like and add them at runtime e.g. during dialog initialization. In this case you'd have to make each string not to be translateable with PMString.SetTranslatable(kFalse).<br />If you want to add items to a listbox or text edit during runtime you just have to get the interfaces and call their methods. Below is a small example taken from a dialog with a dropdown listbox, a text edit field and a button widget. In the DialogObserver I implemented the Update function to the following functionality:<br />- when the button (Insert Button) is pressed the content of the edit field is read and inserted into the listbox<br />- when something in the listbox is selected, the selection is shown/inserted into the text field<br /><br />void VSPDialogObserver::Update<br />(<br />     const ClassID& theChange,<br />     ISubject* theSubject,<br />     const PMIID& protocol,<br />     void* changedBy<br />)<br />{<br />     // Call the base class Update function so that default behavior will still occur (OK and Cancel buttons, etc.).<br />     CDialogObserver::Update(theChange, theSubject, protocol, changedBy);<br /><br />     do<br />     {<br />          InterfacePtr<IControlView> controlView(theSubject, UseDefaultIID());<br />          ASSERT(controlView);<br />          if(!controlView) <br />               break;<br />          <br />          InterfacePtr<IDialogController> dialogCtrl(this, UseDefaultIID());<br />          if (!dialogCtrl)<br />               break;<br /><br />          InterfacePtr<IPanelControlData> panelControlData(this, UseDefaultIID());<br />          if (!panelControlData)<br />               break;<br /><br />          //get currently selected/active widget<br />          WidgetID theSelectedWidget = controlView->GetWidgetID();<br />          <br /><br />          // is it the drop down list?<br />          if (theSelectedWidget== kVSPDropDownWidgetID) <br />          {<br />               TRACE("ListBoxAction");<br />               //insert selected string into edit field<br />               PMString strSelection =     dialogCtrl->GetTextControlData(kVSPDropDownWidgetID);<br />               strSelection.SetTranslatable(kFalse);<br />               dialogCtrl->SetTextControlData(kVSPTopEditBoxWidgetID, strSelection);<br />               break;<br />          }<br /><br />          // ist it the text edit field?<br />          if (theSelectedWidget == kVSPInsertButtonWidgetID && theChange == kTrueStateMessage)<br />          {<br />               TRACE("Insert Button pressed");<br />               IControlView* listView = panelControlData->FindWidget(kVSPDropDownWidgetID);<br />               InterfacePtr<IStringListControlData> listControlData(listView, UseDefaultIID());<br /><br />               //Insert the string into listbox<br />               PMString strText = dialogCtrl->GetTextControlData(kVSPTopEditBoxWidgetID);<br /><br />                        // obviously there can't be a translation for text entered by user<br />               strText.SetTranslatable(kFalse);<br />               listControlData->AddString(strText,kVSPTopEditBoxWidgetID);<br />          <br />               //"clear" the text edit field<br />               dialogCtrl->SetTextControlData(kVSPTopEditBoxWidgetID, "");<br />               break;<br />          }<br />     } while (kFalse);<br />}

  • How to add elements to html form dynamically

    Hi,
    the following piece of code tries to add input elements to a form dynamically on button's click event.
    But it doesnot work. Can anyone spot the trouble
    <html>
    <body>
    <input type=file name="fileName" value="browse">
    <input type=button value="Add more file" onclick="add();">
    <input type=hidden name="theValue" value='0'>
    <script type="text/javascript">
    function add()
    var num=parseInt(theValue.value)+1;
    theValue.value=num;
    var name="fileName"+num;
    var element=document.createElement(input);
    element.setAttribute('type','file');
    element.setAttribute('name',name);
    element.setAttribute('value','browse');
    document.appendChild(element);
    </script>
    </body>
    </html>

    Hi,
    Since no one is giving you the hint: I'm afraid you're in the wrong forum. This is not a Javascript forum. I know it sounds confusing but despite the name, Javascript and Java have nothing really in common. Javascript runs on the client side. Java web technologies don't. Although, what you are asking for can be done with JSP's, I'm afraid, I can't help you with Javascripting :(....
    Cheers,
    Joerg

  • How to add elements to a list of Long Serializable

    I am currently writing a set of generic DAOs with generic signatures such as DAO<PK extends Serializable> (you've all seen the pattern).
    I am using Hibernate to persist to the database whose method is;
    public Serializable save(Object object)
    However, I am working in batches to save groups of Objects at a time & would like to save the returned Serializable types from this method to a list.
    List< ? extends Serializable> someList = new ArrayList< Long >
    for ( loop 0..n ) {
    someList.add( save( objectToPersist ) );
    This will not even compile as the IDE gives the error;
    The method add(capture-of ? extends Serializable) in the type List<capture-of ? extends Serializable> is not applicable for the arguments (Serializable)
    Ive obviously got the wrong end of the stick somewhere but I thought List<? extends Serializable> was a subclass of Collection<?> etc.
    Or am I trying to subclass a super type...
    Apologies for a stupid question as Ive just started using Generics & I've got the Tiger 5 book to read this weekend so Im sure itll make sense by then, but this is confusing me.
    Thanks

    As a side note
            List<? extends Serializable> someList = new ArrayList< Long >();
            someList.add(null);  //works
            someList.add(new Long(21));  //wont compilehttp://www.javabeat.net/articles/33-generics-in-java-50-3.html
    http://www.javabeat.net/articles/33-generics-in-java-50-4.html
    Came across these links discussing why the above wont compile

  • "Add Bookmark" = expanded dropdown list

    When I want to add a Bookmark in Safari 3.0.4, I click on Bookmarks / Add Bookmark, and I get a little window asking where I want to keep this bookmark. If I click on the drop-down list arrows, a very lengthy, fully-expanded list of all my bookmark folders and sub-folders, opens up. I've got a lot of sub-folders, so it takes a lot of time to scroll down to the bottom.
    In Firefox, if I recall correctly, that drop-down list is collapsed - in other words, only the top-level folders show up until you start drilling down into the specific sub-folders you want.
    Is there any way to get Safari to show me just the top-level folders and then let me drill down to specific sub-folders? It'd be a lot easier than scrolling through every folder and sub-folder I have.

    Hi all,
    Unfortunately, there's no way that I know of to do what you've described. Hopefully someone will come along with a solution. While waiting though, perhaps you could also give Apple your feedback via the 'Report Bug' toolbar button.
    That said, I have been a long-time user of Saft (shareware) and it provides an 'Add Bookmark Here' function to the Bookmarks menu, and to each subfolder therein. It's not an ideal solution, especially since it's a paid plugin, but I thought you might find it interesting.
    Yang

  • Dropdown list dynamic domain Display Settings contains no values

    Hi,
    I want to create a dynamic domain on a viewobject (RefCodesByDomain), which is not based on an entity object.
    When I test my bc4j-service everything works as expected.
    The view object has a key attribute.
    In the Application Definition Editor I am able to create a dynamic domain with the data-collection of RefCodesByDomain1 but I cannot select any attributes in the "Display Settings"-section.
    Can you give me some advise on this matter?
    Regards,
    Romano

    Steven,
    I rebuild the project. I think it has something to do with importing business components.
    What I did is the folowing:
    1. In a existing project I extended the default base-classes to create our own layer
    2. created a project called ModelShared
    2a. configured the project to use the base-classes I created in step 1
    2b. created an entitybased-viewobject (RefCodesByDomain)
    2c. created bc deployment-descriptors
    3. created a project called RelatieModel in the same workspace as ModelShared
    3a. added dependencies to the deployment-descriptors as well as the project created in step 2
    3b. configured the project to use the base-classes I created in step 1
    3c. imported business components
    Although I did not recieve any errors during the import of business components, I am unable to add the vo (RefCodesByDomain) to a service.
    I do see the package which contains the vo but is has no entries.
    Importing the business components to a new BC Project in a seperate workspace did succeed (I could reuse the vo).
    I tested a little further and the folowing occurred:
    4. I created a new vo in the ModelShared Project
    5. I deployed the ModelShared
    6. Restarted JDeveloper
    7. Got the folowing error message in the console window when expanding a service in my datacontrol pallette:
    INFO: oracle.adf.share.config.ADFConfigFactory No META-INF/adf-config.xml found
    1-sep-2008 13:23:27 oracle.adf.dt.controls.DataControlsTreeWillExpandListener treeWillExpand
    FINER: THROW
    java.lang.NullPointerException
            at oracle.adf.dt.objects.JUDTViewReferenceAccessorDefinition.init(JUDTViewReferenceAccessorDefinition.java:108)
            at oracle.adf.dt.objects.JUDTViewReferenceAccessorDefinition.<init>(JUDTViewReferenceAccessorDefinition.java:98)
            at oracle.adfdt.internal.meta.bc4j.BC4JDataControlDefinition.createViewObjectDefinition(BC4JDataControlDefinitio
    n.java:228)
            at oracle.adfdt.internal.meta.bc4j.BC4JDataControlDefinition.addViewObjects(BC4JDataControlDefinition.java:208)
            at oracle.adfdt.internal.meta.bc4j.BC4JDataControlDefinition.loadStructure(BC4JDataControlDefinition.java:110)
            at oracle.adfdt.internal.meta.bc4j.BC4JDataControlDefinition.getStructure(BC4JDataControlDefinition.java:407)
            at oracle.adf.dt.controls.treemodel.jsr227.JSR227DataControlTreeNode.loadChildNodes(JSR227DataControlTreeNode.ja
    va:129)
            at oracle.adf.dt.controls.DataControlsTreeWillExpandListener.treeWillExpand(DataControlsTreeWillExpandListener.j
    ava:32)
            at javax.swing.JTree.fireTreeWillExpand(JTree.java:2302)
            at javax.swing.JTree.setExpandedState(JTree.java:3000)
            at javax.swing.JTree.expandPath(JTree.java:1742)
            at javax.swing.plaf.basic.BasicTreeUI.toggleExpandState(BasicTreeUI.java:2189)
            at javax.swing.plaf.basic.BasicTreeUI.handleExpandControlClick(BasicTreeUI.java:2176)
            at javax.swing.plaf.basic.BasicTreeUI.checkForClickInExpandControl(BasicTreeUI.java:2130)
            at com.jgoodies.looks.plastic.PlasticTreeUI.access$801(Unknown Source)
            at com.jgoodies.looks.plastic.PlasticTreeUI$MouseHandler.mousePressed(Unknown Source)
            at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:222)
            at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:221)
            at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:221)
            at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:221)
            at java.awt.Component.processMouseEvent(Component.java:5485)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
            at java.awt.Component.processEvent(Component.java:5253)
            at java.awt.Container.processEvent(Container.java:1966)
            at java.awt.Component.dispatchEventImpl(Component.java:3955)
            at java.awt.Container.dispatchEventImpl(Container.java:2024)
            at java.awt.Component.dispatchEvent(Component.java:3803)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3889)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
            at java.awt.Container.dispatchEventImpl(Container.java:2010)
            at java.awt.Window.dispatchEventImpl(Window.java:1774)
            at java.awt.Component.dispatchEvent(Component.java:3803)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    java.lang.NullPointerException
            at oracle.adf.dt.objects.JUDTViewReferenceAccessorDefinition.init(JUDTViewReferenceAccessorDefinition.java:108)
            at oracle.adf.dt.objects.JUDTViewReferenceAccessorDefinition.<init>(JUDTViewReferenceAccessorDefinition.java:98)
            at oracle.adfdt.internal.meta.bc4j.BC4JDataControlDefinition.createViewObjectDefinition(BC4JDataControlDefinitio
    n.java:228)
            at oracle.adfdt.internal.meta.bc4j.BC4JDataControlDefinition.addViewObjects(BC4JDataControlDefinition.java:208)
            at oracle.adfdt.internal.meta.bc4j.BC4JDataControlDefinition.loadStructure(BC4JDataControlDefinition.java:110)
            at oracle.adfdt.internal.meta.bc4j.BC4JDataControlDefinition.getStructure(BC4JDataControlDefinition.java:407)
            at oracle.adf.dt.controls.treemodel.jsr227.JSR227DataControlTreeNode.loadChildNodes(JSR227DataControlTreeNode.ja
    va:129)
            at oracle.adf.dt.controls.DataControlsTreeWillExpandListener.treeWillExpand(DataControlsTreeWillExpandListener.j
    ava:32)
            at javax.swing.JTree.fireTreeWillExpand(JTree.java:2302)
            at javax.swing.JTree.setExpandedState(JTree.java:3000)
            at javax.swing.JTree.expandPath(JTree.java:1742)
            at javax.swing.plaf.basic.BasicTreeUI.toggleExpandState(BasicTreeUI.java:2189)
            at javax.swing.plaf.basic.BasicTreeUI.handleExpandControlClick(BasicTreeUI.java:2176)
            at javax.swing.plaf.basic.BasicTreeUI.checkForClickInExpandControl(BasicTreeUI.java:2130)
            at com.jgoodies.looks.plastic.PlasticTreeUI.access$801(Unknown Source)
            at com.jgoodies.looks.plastic.PlasticTreeUI$MouseHandler.mousePressed(Unknown Source)
            at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:222)
            at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:221)
            at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:221)
            at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:221)
            at java.awt.Component.processMouseEvent(Component.java:5485)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
            at java.awt.Component.processEvent(Component.java:5253)
            at java.awt.Container.processEvent(Container.java:1966)
            at java.awt.Component.dispatchEventImpl(Component.java:3955)
            at java.awt.Container.dispatchEventImpl(Container.java:2024)
            at java.awt.Component.dispatchEvent(Component.java:3803)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3889)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
            at java.awt.Container.dispatchEventImpl(Container.java:2010)
            at java.awt.Window.dispatchEventImpl(Window.java:1774)
            at java.awt.Component.dispatchEvent(Component.java:3803)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)8. In my other "fresh" bc project I was able to use the newly created vo.
    Do you have any suggestions?
    Regards,
    Romano

  • Add multiple entries to dropdown list without using data dictionary

    Hi,
    By default when we use a data dictionary element for dropdown list, all the possible values are listed in the dropdown. However when no data dictionary element is used for the dropdown list, it behaves like a parameter with a single line.
    I would like to know if it is possible to not use the data dictionary element and still have multiple lines in the dropdown.
    Thanks in advance.
    Shamia

    Check the below program :
    *report zxyz.
    report zxyz.
    Table diclaration
    tables: tvdir.
    Selection screento table View
      selection-screen skip 2.
      parameter p_tabnm(30) as listbox visible length 30 obligatory.
      selection-screen skip 1.
      selection-screen begin of block s1 with frame title text-001.
      parameter: p_radio1 radiobutton group g1,
                 p_radio radiobutton group g1.
      selection-screen end of block s1.
    Add values to list box
    at selection-screen output.
      type-pools: vrm.
      data: name  type vrm_id,
            list  type vrm_values,
            value like line of list.
      name = 'P_TABNM'.
      refresh list.
      value-key = 'V_024'.
      value-text = text-002. "'V_024-Purchasing Groups'.
      append value to list.
      value-key = 'V_T024D'.
      value-text = text-003. "'V_T024D-MRP Controllers'.
      append value to list.
      value-key = 'ZT604'.
      value-text = text-004. "'T604-Commodity Codes'.
      append value to list.
      value-key = 'T179'.
      value-text = text-005. "'T179-Product Hierarchies'.
      append value to list.
      value-key = 'TVM1T'.
      value-text = text-006. "'TVM1T-Business Manager'.
      append value to list.
      value-key = 'TVM2T'.
      value-text = text-007. "'TVM2T-Division manager'.
      append value to list.
      value-key = 'TVM3T'.
      value-text = text-008. "'TVM3T-Director'.
      append value to list.
      value-key = 'V_TVV2'.
      value-text = text-009. "'V_TVV2-Customer Group 2'.
      append value to list.
      call function 'VRM_SET_VALUES'
           exporting
                id     = name
                values = list.
    start-of-selection.
    Get flag of corresponding table view
      select single tabname flag from tvdir into tvdir
                    where tabname = p_tabnm.
    Set flag of corresponding table view
      if p_radio1 eq 'X'.
        if tvdir-flag ne 'X'.
          update tvdir set: flag  = 'X'
                     where tabname = p_tabnm.
        endif.
      endif.
      if p_radio eq 'X'.
        if tvdir-flag eq 'X'.
          update tvdir set: flag  = ''
                       where tabname = p_tabnm.
        endif.
      endif.
    Execute View/Table
      call function 'VIEW_MAINTENANCE_CALL'
        exporting
          action                               = 'U'
          view_name                            = p_tabnm
       exceptions
         client_reference                     = 1
         foreign_lock                         = 2
         invalid_action                       = 3
         no_clientindependent_auth            = 4
         no_database_function                 = 5
         no_editor_function                   = 6
         no_show_auth                         = 7
         no_tvdir_entry                       = 8
         no_upd_auth                          = 9
         only_show_allowed                    = 10
         system_failure                       = 11
         unknown_field_in_dba_sellist         = 12
         view_not_found                       = 13
         others                               = 14.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    Reset flag of corresponding table view
      update tvdir set: flag  = tvdir-flag
                    where tabname = p_tabnm.
    Thanks
    Seshu

  • Is there a way you can add elements dynamically to an existing array??

    hey guys... i need to add elements to an array dynamically... how do i do that?
    for example... in one of my functions i do..
         for each(var item:Object in fileList){
              fileListArr.push(item);
    and in a later function i need to add one more element to my fileListArr...
    so i tried doing
    fileListArr[indexNum].push({
         key:videoKey
    so i need to have an array which resembles something like this...
    Before adding elements...
    fileListArr:
         [0]:  name:test1
                Size:12K
                caption:testing caption
                number:1
         [1]:  name:test2
                Size:12K
                caption:testing caption
                number:2
    after adding key to array
    fileListArr:
         [0]:  name:test1
                Size:12K
                caption:testing caption
                number:1
                key:xyxyyy11y1yy1y1y2y2u33n
         [1]:  name:test2
                Size:12K
                caption:testing caption
                number:2
                key:iiduudjmenri112jj2n4n3m2j1j21
    any ideas?

    hmm interesting... so i made the changes... i changed the array to arraylist and the code i have is as follows... but i still get an error... the error says ... "ReferenceError: Error #1056: Cannot create property key on flash.net.FileReference."
    public var videoReference:VideoHandler;
    public var fileRef:FileReferenceList = new FileReferenceList();
    [Bindable] public var fileListArr:ArrayList = new ArrayList();
    [Bindable] public var fileNames:ArrayCollection = new ArrayCollection();
    public function selectionHandler(event:Event):void{
         fileRef.removeEventListener(Event.SELECT, selectionHandler);
         var numSelected:int = event.target.fileList.length;
         var fileList:Array = event.target.fileList;
         for each(var item:Object in fileList){
              fileListArr.addItem(item);
              fileNames.addItem({
                   num: fileNames.length + 1,
                   name: item.name,
                   size: formatFileSize(item.size),
                   status: ""
         var newListLength:Number = fileListArr.length;
         if(fileCounter > 0){
              loopList(fileCounter);
         else
              loopList(0);
    public function loopList(value:int):void{
         //trace("looplist -->");
         if(value < fileListArr.length){
              _numCurrentUpload = value;
              file = new FileReference();
              file = FileReference(fileListArr.getItemAt(value));
              file.addEventListener(Event.COMPLETE, loadVideo);
              file.addEventListener(ProgressEvent.PROGRESS, fileProgress);
              file.load();
    public function setUploadKey(event:ResultEvent):void{
         if(event.result.ThereWasAnError){
              Alert.show(event.result.ErrorMessages[0]);
         }else{
              videoKey = event.result.UploadKey;
              if(fileCounter >= fileListArr.length){
                   trace("in if");
                   fileCounter = 0;
                   uploadLoopList(fileCounter);
              }else{
                   trace("in else");
                   //fileListArr[fileCounter - 1]['videoKey'] = videoKey;
    -----> get an error here --->fileListArr.getItemAt(fileCounter - 1).key = videoKey;
                   //fileListArr[fileCounter - 1] = [{key: videoKey}];
                   loopList(fileCounter);

  • Link db results to Dropdown list and link to email

    I need to pull information from a table 'Suppliers' in an (datebase.mdb) and retrieve two items, name and email. This in itself Dreamweaver makes fairly simple. From this information I need to produce a dropdown list, again Dreamweaver makes this simple.By the way we are using the Suppliers table as 'Departments'.
    Now the real work begins and this question. Once the user selects a name on this dropdown list, I need to create a feed of the email address associated with the selected name and pass it to an email form field as a BCC. This form (email) is generated by another subroutine, so I will also have to add the necessary coding for the form to include this BCC email address if selected.
    I wish to add the new dropdown list just below the subject and as this is an optional field, the first selection should be 'optional' and do nothing if no selection is made by the user.
    I believe that the form is generated by the 'shopcustcontact' and results passed to 'shopmailform' for final processing and sending.
    I appreaciate your input this this question.

    This isn't a Design question. Please repost in the Dreamweaver forum.

  • Delete values in Dropdown list

    Hi
    I want to delete values from a dropdown list.
    The attribute is:
    Component: ICCMP_BP_DETAIL
    View: ICCMP_BP_DETAIL/BuPaCreate
    Context Node: PARTNERTYPE
    Attribute: BP_CATEGORY
    Do you have any idea of how to achieve this?
    Best regards.
    JM

    Hi,
    My reqiurement is to add values in Dropdown list which is standard one. Already threre some values are there, like
    hourly,daily,wekly.
    Now I need to add montly value to the above dropdown list.How this can be done.
    Suggest me.
    Thanks,
    Brahmaji

  • How to add elements into Object[][] type of list, in runtime?

    I have Object list, ie.
        final Object[][] data = {
            {"January",   new Integer(150) },
            {"February",  new Integer(500) },
            {"March",     new Integer(54)  },
            {"April",     new Integer(-50) }
        };How can I dynamicly add new elements in it, at the runtime?
    Thank you in advance!

    Do I have to remove 'final' for that, and then add
    elements?
    No. you can't change an array's size.
    You can do this
    Object[][] arr = new Object[numRows][numCols];But once you've created it, its size can't change.*
    I don't know what you're doing, though, and what actual data you're putting in, but Object[][] holding rows of [String, Integer] is almost certainly a poor data structure. Think about creating a class the represents one "row" here and then create a 1D array of that class.
    * Okay, you can kinda sorta effectively "change" the size of second and subsequent dimensions, since a multidimensional array is an array of arrays. I wouldn't recommend it though: int[][] arr = new int[3][2]; // a 3 x 2 rectangular array of int--it's  an array of array of int, with 3 "rows", each of which is an array of int with 2 elements.
    arr[0] = new int[10]; // now it's a jagged array whose first row has 10 elments instead of 2Here we haven't changed an array's size, just replaced one of its elements, which is also an array, with a new, larger array.

Maybe you are looking for