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");

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 ITEMS TO DROPDOWN BOX FROM A TEXT FIELD(USER ENTERS THE ITEM) AND BOUND VALUE ALSO

    I WANT TO ADD ITEMS  THE DROPDOWN BOX FROM THE TEXT FIELD(ITEM NAME) WHERE USER ENTER'S THE ITEM DESCRIPTION
    AND BOUND VALUE ALSO SHOULD BE ADDED TO THE SAME ITEM.
    SAME WAY REMOVE ITEMS FROM DROPDOWN BOX
    PLEASE GIVE SAMPLE FORM OR JAVASCRIPT FOR THE ABOVE SCENARIO.....
    INDEED HELPFUL FOR MY PROJECT PLEASE SEND ATTACHED PDF FORM

    Hi Praveen,
    Your form is not shared so I have not been able to access it.  But I have updated mine.  There are now two approaches, one that follows on from the above method and updates each drop down list in each row.  The second updates a separate dataset that the drop down list is bound to.  This second approach requires the remerge() method which can cause problems if your code has updates some form properties like a borders color as these will be reset, but the code is simplier and you will only have one list to maintain.  The add button click code is;
    var particulars = xfa.datasets.resolveNode("particulars");
    if (particulars === null)
        particulars = xfa.datasets.createNode("dataGroup","particulars");
        xfa.datasets.nodes.append(particulars);    
    var particular = xfa.datasets.createNode("dataValue","particular");
    particular.value = ItemName.rawValue;
    var boundValue = xfa.datasets.createNode("dataValue","id");
    boundValue.value = BoundValue.rawValue;
    particular.nodes.append(boundValue);
    boundValue.contains = "metaData";
    // find sorted position to insert
    for (var i = 0; i < particulars.nodes.length; i++)
        p = particulars.nodes.item(i);
        if (p.value > particular.value)
          particulars.nodes.insert(particular, p);       
                 break;
    // add to end if greater than all existing items
    if (particular.parent === null)
        particulars.nodes.append(particular);
    // clear source fields
    ItemName.rawValue = null;
    BoundValue.rawValue = null;
    // remerge form data to pick up new item
    xfa.form.remerge();
    And the binding looks like;
    I have updated my sample to include both methods, https://workspaces.acrobat.com/?d=OwysfJa-Q3HhPtFlgRb62g
    Regards
    Bruce

  • 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

  • How to upload price for a item in price list using DTW ?

    hi all,
    How to upload prices of all the items in price list using DTW ?
    What are templates used for it ?
    Item masters were already created.
    Jeyakanthan

    Hi
    Create two Excel templates 'Items.xls' and 'Items_Prices.xls'
    Since you have already imported items, just have the record key and item code alone in the 'Items.xls' . For example:
    RecordKey.......ItemCode
    1.......................I0001
    2.......................I0002
    In the Items_Prices template, Fill Pricelist Number fromOPLN and Price of the Item
    RecordKey....LineNum......Price
    1......................1..............350.00   (Means for Item I001, Pricelist 1 is updated with 350)
    1......................2..............300.00   (Means for Item I001, Pricelist 2 is updated with 300)
    2......................1..............550.00   (Means for Item I002, Pricelist 1 is updated with 550)
    2......................2..............600.00    (Means for Item I002, Pricelist 2 is updated with 600)
    In step 4 of DTW, Choose
    Check - Update Exisiting Object
    Uncheck - Import New Object
    This should update the pricelist alone for the items

  • 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

  • How can I select properties from dropdown lists using only the keyboard?

    Hi,
    I am using SAP Netweaver Studio and when modifying UI elements in views, I want to select the value for a property from the corresponding dropdown list in the Properties view using only the keyboard.
    When a property row is selected, "Enter" toggles to Edit mode, Alt+ArrowDown expands the list, but ArrowUp or ArrowDown directly selects the previous/next item list and changes to Selected mode.  Which key is used to navigate between the list items without selecting them immediately?
    Thanks a lot. I deal with lots of views and this would save me quite a few massage hours
    Maria
    Edited by: Maria Marinova on Feb 14, 2008 9:40 AM
    Edited by: Maria Marinova on Feb 14, 2008 9:40 AM

    Thanks Andrew. When creating an external table does it requires an access to SQL*Loader?
    CREATE TABLE dept_external (
       deptno     NUMBER(6),
       dname      VARCHAR2(20),
       loc        VARCHAR2(25)
    ORGANIZATION EXTERNAL
    (TYPE oracle_loader
    DEFAULT DIRECTORY admin
    ACCESS PARAMETERS
    RECORDS DELIMITED BY newline
    BADFILE 'ulcase1.bad'
    DISCARDFILE 'ulcase1.dis'
    LOGFILE 'ulcase1.log'
    SKIP 20
    FIELDS TERMINATED BY ","  OPTIONALLY ENCLOSED BY '"'
    deptno     INTEGER EXTERNAL(6),
    dname      CHAR(20),
    loc        CHAR(25)
    LOCATION ('ulcase1.ctl')
    REJECT LIMIT UNLIMITED;

  • 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 />}

  • Capture item by Dropdown list in Interactive Form

    Hi experts,
    I have a problem. I hope to get your suggestion ready. 
    I created a WebDynpro Abap that contains within it an Adobe Interactive Forms.
    With the method wddoinit by the component controller I set all values of the fields into interactive forms correctly.
    Inside the form there is a dropdown list which is bind to a table, the list of this dropdown list is filled with properly values of the table which is bind.
    When I select a value from the list dropdown I can not capture the selected item by the table corresponding of the data.
    Carryover below the code I use to recover (unsuccessfully) the values selected by list dropdown:
    DATA:
        node_adobe_data   TYPE REF TO if_wd_context_node,
        node_it0002       TYPE REF TO if_wd_context_node,
        node_stato_civile TYPE REF TO if_wd_context_node,
        elem_stato_civile TYPE REF TO if_wd_context_element,
        stru_stato_civile TYPE wd_this->element_stato_civile.
    navigate from <CONTEXT> to <ADOBE_DATA> via lead selection
      node_adobe_data = wd_context->get_child_node( name =  wd_this->wdctx_adobe_data ).
    navigate from <ADOBE_DATA> to <IT0002> via lead selection
      node_it0002 = node_adobe_data->get_child_node( name =  wd_this->wdctx_it0002 ).
    navigate from <IT0002> to <STATO_CIVILE> via lead selection
      node_stato_civile = node_it0002->get_child_node( name =  wd_this->wdctx_stato_civile ).
    get element via lead selection
      elem_stato_civile = node_stato_civile->get_lead_selection( ).
    get single attribute
      elem_stato_civile->get_static_attributes(
        IMPORTING
         static_attributes = stru_stato_civile ).
    The problem persist also if I use the method GET_LEAD_SELECTION_INDEX.
    The return value always is the first item and not what I selected.
    I wait trusting your suggestions to solve the problem.
    Regards.

    Hi Davide,
    Maybe you can try to keep your own Index parameter (Integer) to keep track of the selected index.
    Then use that parameter to select data from your node:
    node_stato_civile->get_static_attributes(
        exporting
          index             = wd_this->lv_index
        importing
          static_attributes = stru_stato_civile
    Hope this helps.
    Regards,
    Roelof Albers

  • Unable to add printer to printer list

    Hello everybody!
    I'm unable to add a printer to the printer list. It's a HP Photosmart Plus B210a. I configured the printer without any difficulties (unpacking, installing ink, booting up, first run test prints, connecting it to the wireless network etc.). Now I want to add the printer to my Macbook Air (11", late 2010 version, Mac OS X 10.6 Snow Leopard) via the wireless connection.
    To do this, I go to the system settings, printers and faxing. Since I have no other printers installed, there's nothing to see there. I clikc the plus + to add a printer and it finds the Photosmart via Bonjour connection. All looks fine to this point (doesn't it?). The I click add and then software update asks if I want to download software. Clicking not now obviously doesn't add the printer, clicking install starts a search for software (after accepting Apple's terms). Software is found, downloaded and installed, but after the install, nothing happens! The install progress bar closes, but then I'm still in the add printer screen, where I can still see the Photosmart through Bonjour connection. In the printer screen, the printer lists remains empty! When I add the printer again, it wants to search for software again, but it's unable to find (I guess because it doesn't find newer software, since I now have the software installed already). It simply doesn't add the printer to the list.
    Connecting the printer with a USB cable ends up the same: you install the printer, but it won't show up in the printer list. Installing again results in the same message that no software can be found.
    I also tried downloading the software from HP. Installation works just fine, but after the installation the software want to configure the printer through the same add printer screen. There I end up the same way: adding the printer makes software update search. Now it finds a HP printer update, which installs just fine, but the printer simply is not added to the printer list. This is also confirmed by the HP configuration software: it detects that the wireless printer is not in the list. Installing via USB cable however, ends up in succesful installation (says HP configuration software), but no success: no printer available!!!
    I can reproduce everything as many times as I like, by using the HP uninstaller that is installed with the download I installed manually. Then everything happens all over again, no matter what I try.
    Does anybody know what kind of error this is? (there is no error message anywhere, only the notification from software update that it can't find new softare at the moment). Does anybody have experience with adding this particular printer, or any HP printer or any printer at all? Why can't I add my printer?
    I think it's Apple related, not HP related. The printer works as it should (for what that's worth if you can't use it because your computer doesn't accept it). I can print through HP ePrint. This is not ideal, because it always prints the e-mail and attachment so it costs an extra page and a bit of ink. I just want to print simply by printing directly for my Macbook!
    Any help is appreciated, I hope my problem is described with enough detail, but if you need more info, ask! I will provide.

    Hi Niala... Before you go thru the hassle of reinstalling your operating system, please try installing Gutenprint for your Mac: http://gimp-print.sourceforge.net/MacOSX.php
    I just purchased a new EPSON printer today and couldn't add it to my printer queue (just like you): i kept getting an error message telling me that the driver was unavailable from Apple, and there was a Bonjour connectio problem somewhere.
    Anyway: I downloaded the Gutenprint drivers, installed them and the next time I clicked on the [+] sign, everything went well.
    Maybe it will work for you too. Definitely worth a try...
    Cheers!

  • How to add item to a List with a bounded wildcard

    Hi,
    Is there a way to add a subtype instance to a List with a bounded wildcard? For example, say I have an
    abstract class called Car. Then I have 2 concrete subclasses--Ford and Toyota. Now say I have another
    class that contains a prepopulated list and is wildcard bounded like this: List<? extends Car> carList. I
    want to add a method where I pass in a Car subtype as a parameter and then add it into this list, e.g:
    public void addCar(Car car) {
    carList.add(car);
    Trying this, I keep getting "cannot find symbol" compilation errors. When I went back to read the Generics
    tutorial by Bracha, he mentions that explicitly adding a subtype, e.g. carList.add(new Ford()), can not be
    done. But here I'm adding the "upper bound" of the wildcard, i.e. the Car type. Therefore there should be no
    discrepancy between supertype and subtype an thus the carList.add(car) should be ok, IMO.
    Am I misunderstanding something with this logic? Also, if carList.add(car) can not be done, then how can
    I go about doing something similar which will allow me to add subtypes to a "generic" list?
    Thanks in advanced!
    -los

    I get a compilation error expecting an Object instead of a Car. Of course you did. List<? super Car> is a list into which you can put cars -- and possibly other stuff. List<? extends Car> is a list out of which you can get cars (possibly of different makes).
    Do you need a list that you can put cars in and get cars out? That's List<Car>
    This isn't a linguistic problem you are having; this is a design problem. If you have a function that takes an argument which is a list that you can put any kind of car into and be sure of getting a car out of, it isn't reasonable to pass in a List<Ford> (because the function might put in a Chevy) or a List<Object> (but there might be motorcycles already in there). By the requirements you have, you need a List<Car> and nothing else.
    Yes, you could use a cast, but all you are doing is circumventing the type system by saying "I know this List<Object> only has Cars in it."

  • How to Update multiple items in other list using event handler?

    Hi All,
    If i update a item in a list, then i should update multiple items in another list need to be update. How to achive using event receivers?

    Hi Sam,
    According to your description, my understanding is that you want to update multiple items in another list when updated a list item.
    In the event receiver, you can update the multiple item using Client Object Model.
    Here is a code snippet for your reference:
    public override void ItemUpdated(SPItemEventProperties properties)
    string siteUrl = "http://sp2013sps/sites/test/";
    ClientContext clientContext = new ClientContext(siteUrl);
    List oList = clientContext.Web.Lists.GetByTitle("another list name");
    ListItem oListItem = oList.GetItemById(1);
    oListItem["Title"] = "Hello World Updated!";
    oListItem.Update();
    clientContext.ExecuteQuery();
    Best regards,<o:p></o:p>
    Zhengyu Guo
    Zhengyu Guo
    TechNet Community Support

  • CAML Query to get specific item in folder based on dropdown value using Javascript client object model

    Hi,
    I am using the Javascript Client object model.
    I have a custom list and a custom document library.
    Custom list contains 2 columns - dlName , dlValue
    The document library contains 2 folders - "folder1" ,  "folder2" and contains some images.
    The image name starts with the "dlValue" available in the custom list
    I am using a visual webpart and using javascript client object model.
    I am trying to achieve the below functionality:
    1) Load a dropdown with the custom list.
    2) set the image based on the value in dropdown.
    I have achieved the first option, I have set the dropdown, but not sure how to query the folder and set the image.
    Below is the code i have used so far:
    //In Visual webpart
    <select id="ddlTest" >
    </select>
    <br/>
    <div id="PreviewLayer">
    <img id="imgPlaceHolder" runat="server" alt="Image" title="imgPlaceHolder" src=" " />
    </div>
    // In Javascript file
    function RenderHtmlOnSuccess() {
    var ddlTest = this.document.getElementById("ddlTest");
    ddlTest.options.length = 0;
    var enumerator = this.customListItems.getEnumerator();
    while (enumerator.moveNext()) {
    var currentItem = enumerator.get_current();
    var dropdownValue = currentItem.get_item("dlValue");
    ddlTest.options[ddlTest.options.length] = new Option(currentItem.get_item("dlName"), dropdownValue);
    setImage(dropdownValue); // Not sure how to query the folder and set the image based on value.
    // Also if dropdown value is changed, corresponding image should be shown
    How to query the folder and based on dropdown value, show the image? Also, how to handle the dropdown value change?
    Thanks

    Hi,
    Here are two links for your reference:
    Example of how to Get Files from a Folder using Ecmascript \ Javascript client object model in SharePoint 2010
    http://sharepointmantra.wordpress.com/2013/10/19/example-of-how-to-get-files-from-a-folder-using-ecmascript-javascript-client-object-model-in-sharepoint-2010/
    SP2010 JSOM Client Object Model: How to get all documents in libraries including all folders recursively
    http://sharepoint.stackexchange.com/questions/70185/sp2010-jsom-client-object-model-how-to-get-all-documents-in-libraries-including
    In SharePoint 2013, we can also use REST API to achieve it.
    http://msdn.microsoft.com/en-us/magazine/dn198245.aspx
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • Javascript needed - need checkbox to check automatically based on selected item from dropdown list

    I am building a fillable form.  In this form, I have created items in a dropdown list.  Based on the item picked from the dropdown list, I need a corresponding checkbox to be checked.  I am certain there is an easy javascript to resolve my current problem.  Please assist.
    For example: dropdown list field (SubSupplier1) -   Demolition                            export value 2
                                                                                    Rough Carpentry Labor       export value 4
                                                                                    Rough Carpentry Material    export value 3
    I need the corresponding checkbox (SalesTax1) to automatically be checked when Demolition (export value 2) or Rough Carpentry Material (export value 3) is selected.
    Thank you,
    Jennifer

    Hi Jennifer,
    This should help you do what you need. Place it in the Custom Calculation property of the dropbox and select "commit selected value immediately" in the fields options:
    var drop = this.getField("SubSupplier1");
    var check = this.getField("SalesTax1");
    if ((drop.value == 2) || (drop.value == 3)){
    check.checkThisBox(0,true);
    else {
    check.checkThisBox(0,false);
    The code is asking if the export value of the field is either '2' or '3' and if so, check the box.
    Otherwise uncheck the box.
    If you don't want it to uncheck on other selections, remove the 'else' section of code.

  • Update one list item to another list using WF

    hi
    i have a SP Designer workflow which copies one list item to another list
    but if i edit the 1st list this will copy a new item to another list i want the same item to be edited without making a new copy of the item.
    Alen Austin

    so in the workflow separate between on edit and on new item, so mostly you will need to either do checking and have variable saved to know if you are editing only, or create 2 workflows one when you add new item and other when u edit (if needed)
    Kind Regards,
    John Naguib
    Senior Consultant
    John Naguib Blog
    John Naguib Twitter
    Please remember to mark this as answered if it helped you

Maybe you are looking for