Populating a drop down list of users using JSON from a REST call

Hi guys,
First post, have just started the mammoth project of turning us paperless.
My first task has been to create a header template - this header to be used on any form we use. I got this done almost without issue, it seems the only complication is to attach the username to the document.
Initially I tried to do this with a text field. I set this up with a calculation script to set this.rawValue = identity.username (also tried identity.name), however further reading taught me that that requires priviledged context (haven't figured out what that is or how to get it yet, but it seems like a 'no' for this method).
My next step has been to attempt to let the user pick their username from a list. "Easy!" I thought, "I just set up a webscript last week to return a configurable list of user details. My web script (it runs off of Alfresco CMS, for the record) is accessed from an URL like https://docs.ourcompany.com:8443/alfresco/service/ourcompany/users?useGroup=[a user group]&filter=[a filter string] and returns JSON like this:
    "users" :
"name" : "Chris O'Kelly", "userName" : "ChrisO"
"filter" : "all",
"error" : 0
In the layout:ready script section for my dropdown I have used the following js
function createRequest() {
  var result = null;
  if (window.XMLHttpRequest) {
    // FireFox, Safari, IE>6
    result = new XMLHttpRequest();
    if (typeof xmlhttp.overrideMimeType != 'undefined') {
      result.overrideMimeType('application/json');
  else if (window.ActiveXObject) {
    // IE <7
    alert("No available type");
    result = new ActiveXObject("Microsoft.XMLHTTP");
  else {
    alert("No available type");
    return;
  return result;
var req = createRequest();
req.onreadystatechange = function() {
  if (req.readyState != 4) return;
  if (req.status != 200) {
    alert("REST call failed");
    return;
  // Request successful, read the response
  var resp = req.responseText;
  this.addItem(resp.users.name, resp.users.userName);
req.open("GET", "https://docs.ourcompany.com:8443/alfresco/service/ourcompany/users?useGroup=GROUP_EveryUser&filter=status", true);
req.send();
But when I preview the form I get nothing, no errors, no alerts, no filling of the dropdown. I've read a few conflicting forum posts on whether or not xmlHttpRequest works within liveCycle forms, so I suppose the guts of my question boils down to- does it?

Hi!
In the DropDownList set the labelField property to the name of the object property you want to appear.
Ex:
<s:DropDownList labelField="facilityNumber"
                includeIn="NewInspection"
                dataProvider="{ddFacNum}"
                fontFamily="Arial" fontSize="16"
                id="ddFacilityNumber"
                prompt="Select facility number..."/>

Similar Messages

  • Help needed with populating a drop-down list from an Access Database

    Topic
    data drop-down list
    Jason Murthy - 11:39am Feb 14, 2005 Pacific
    Hello,
    I am trying to use the data drop-down list from the custom library. I enter the name of my data connection and the other 2 variables in quotes when they are initialized, just like the example says to, but it still doesn't work. Anyone have any thoughts?
    Thanks,
    Jason
    Reply To This Discussion | Back to Topic List | Bookmark | Change Subscription
    To start a NEW discussion click on the Back to Topic List link and select Add Topic.
    If you are in an archive forum please go up to the main topic list (archives are read only).
    Messages 11 messages. Displaying 10 through 11.
    First Previous Next Last Show All Messages
    Denzil White - 5:46am Jul 28, 05 PST (#10 of 11)
    Oh and before you say anything more I have also tried changing it from Javascript to the FormCalc, and no diff, maybe I am more stupid than I realised, heh,heh
    Post Reply | Bookmark
    Henk Pisuisse - 12:06am Aug 9, 05 PST (#11 of 11)
    I am having trouble (sleepless nights) with populating a drop-down list from an Access Database. The result is: I only get the first record from the data connection. So the connection works but I cannot go through the other records. Maybe there is an other way to do this.
    I am trying to selectively fill a form with data from an MS-access database.
    I hope someone can help me.
    [email protected]
    The Netherlands (small country in Europe)

    If you email the access DB and the form to [email protected], I will try to take a look at it for you.

  • Populating 2nd drop down list based on the selection of the first using Access DB...

    I have a form that I would like to have the user select the first drop-down list as populated from a data source, but them have the subsequent selection choice dependent on the first. For instance, if they select "administration" for their division, the department numbers shown in the second box would only contain those with "Administration" listed as their division. I have all of this information in my Access table.
    I've seen this possible by storing all of the information in a script. i.e.- listing each division and department. The only problem is that we have over 300 departments and making any changes would be very tedious in an in-form script. Is there any way to have this automatically reference a table in Access?
    Thank you,
    Mike

    In the current version of the portal, it is not possible as you cannot do code-behind on postbacks. If you want more flexibility, you need to write your own front-end that uses the FIM Service webservices...
    Regards, Soren Granfeldt
    blog is at http://blog.goverco.com | facebook https://www.facebook.com/TheIdentityManagementExplorer | twitter at https://twitter.com/#!/MrGranfeldt

  • Populateing a drop down list in a repeating sub form

    I have been using the scripts from the Purchase Order sample that work with the Country and States/Provinces drop down lists and have modified them to fit my needs. The scripts work great. However I have a drop down list that is in a repeating sub form and the only the drop down list in the first occurance of the sub form works. The others don't.
    I put this line of code in a field called drpOrderedByTeam.
    JobsScript.getJobsOther(xfa, xfa.resolveNode("form1.TimeSheetSF.DetailsSF[*].DetailsTable.DetailsRow.ItemNumber"));
    I thought I just needed to add an "[*]" to the name of the sub form and it would work with all occurances but it doesn't seem so and I'm not sure what else to do.

    Based on your explanations, I've attempted to re-create your form and I think I've got it working the way you'd like it to.
    There are some difficulties with using fields in table headers which are replicated on subsequent pages because while new instances of the header subform and the fields it contains are created, you don't have access to these instances using the header's Instance Manager (I think this is a bug but I'm not sure). This means that you can't iterate through the instances of the header in order to populate the task lists depending on the selection in the team list. One solution for this is to make all header fields Global (select each field and, in the Object palette's Binding tab, set the
    Default Binding property to
    Global). This means that all instances of these fields will share the same value. The effect is that when you change the value of a field on an instance of a header on any page, the change will be replicated on all instances on all pages. The catch, though, is when you use lists in the header. Making list fields global doesn't mean that their item lists are global -- which causes other headaches.
    In the end, because of the problems I've described, I had to resort to cheating a little but if you think about it, it's not really cheating. What the form does is whenever the team list value changes, it removes all instances of the DetailsSF rows. This has the effect of also removing all instances of the DetailTitlesSF headers accross the current page set (and removes all pages but the first one). Then 6 new instances of the DetailsSF row are generated and the DetailTitlesSF header is re-populated using the new selection in the team list. After that, if a new page gets generated because of the number of instances of the DetailsSF rows, the new instances of the task lists in the new instances of the DetailTitlesSF header will have the correct list of items based on the current value of the team list. In the end, even though I'm cheating by removing all instances of the DetailsSF row in order to reset the lists in the DetailTitlesSF header, it's not really cheating because if you change teams, then it should be assumed that all data entered doesn't apply anymore because the tasks change as well... Convinced?
    The best way to understand this is to check-out the sample form.
    Let me know if you have any questions.
    Stefan
    Adobe Systems

  • Populating fields, drop down lists, etc... from external data

    Hi,
    I am trying to evolve my forms, and am interested in learning how to connect my forms to external data sources.  I assume using server solutions would work, but are complex and costly.  They are also likely beyond my scope of understanding.  What are the best practices for doing this?  Can it be done with a text file or spreadsheet?  I am really looking for a better way to create custom data in forms than to go into the script and change them manually.  Price is a good example.  I have some forms that generate a very basic quote for services.  When the price of part x changes I need to going into the from chance the script for those items, re-save it and hope I have not missed any items.  Evey time his happens it is a hassle.  Not to mention if more than one user needs it I have to make sure they are all using the right version (to be clear I am less worried about this part as it seems a complex task).
    Is there a better way of doing this?  What are the best practices for this?  What external sources can be used to hold the data.  I would be interested in any tutorials that may exist on the subject as well.
    Thanks in advance for any/all help. 
    Tom
    P.S. it is amazing what LCD can do, and that I really enjoy working in it, although I have little background in scripting.  Great product and resource!

    Thanks Paul,
    I have been able to solve the drop down list question, thanks to your help.
    I have another question that involves locking specific fields in a four page form which contains approximately 100 fields that need to be locked before the end user completes the remaining fields. How do I lock individual subforms so that the remaining fields remain open and editable?  The final version of the form, will have at least 200 fields in it that will also need to be locked in sections.
    I can lock all the fields using the lock all fields button, but have been unable to make it work for just part of the form.
    I've emailed the draft form.  It would be really helpful if I had one example of a locked subform on the form I'm struggling with.
    Thanks for your help.
    Nellie

  • Purchase order sample - drop down list populating another drop down list

    hello, when i use this sample script, it works fine. but when i add additional arrays to it, it doesn't work at all. please let me know what i need to change in this script in order to add additional items into the drop down lists. here is the script that works (displays 3 options in first drop down list (blank, option, another option)):
    // This script object controls the interaction between the carrier and plan Drop-down lists.
    // The array contains the carriers and the corresponding plans.
    var myCarriers = new Array(new Array(2), new Array(14), new Array(17)); // Create a two-dimensional array.
    // For each carrier, add a 'new Array(number of plan +1)'.
    // Define the carrier and the corresponding plans.
    // The array syntax is arrayName[index][index].
    // The first index number represents the carrier,
    // the second index number is the actual data value.
    myCarriers[0][0] = " "; // The first items in the Drop-dowm Lists should be blank.
    myCarriers[0][1] = " ";
    myCarriers[1][0] = "ANERT"; // The first data value is the carrier name,
    myCarriers[1][1] = "MC250"; // the rest are plans.
    myCarriers[1][2] = "MC2501";
    myCarriers[1][3] = "MC5002";
    myCarriers[1][4] = "MC5003";
    myCarriers[1][5] = "MC1000";
    myCarriers[1][6] = "MC2000";
    myCarriers[1][7] = "MCHC2300";
    myCarriers[1][8] = "MCHC3000";
    myCarriers[1][9] = "MC2500";
    myCarriers[1][10] = "MB";
    myCarriers[1][11] = "P500";
    myCarriers[1][12] = "MHH3000";
    myCarriers[1][13] = "MHH5000";
    myCarriers[2][0] = "BCCA"; // This is a new carrier, see how the first number is now [1].
    myCarriers[2][1] = "S Plan";
    myCarriers[2][2] = "BPlan";
    myCarriers[2][3] = "P40";
    myCarriers[2][4] = "P30";
    myCarriers[2][5] = "P35*";
    myCarriers[2][6] = "P45*";
    myCarriers[2][7] = "Ad25*";
    myCarriers[2][8] = "Pr20";
    myCarriers[2][9] = "Pr10";
    myCarriers[2][10] = "PH750*";
    myCarriers[2][11] = "PH500*";
    myCarriers[2][12] = "2400HD";
    myCarriers[2][13] = "3500HD";
    myCarriers[2][14] = "2000HD";
    myCarriers[2][15] = "LH1500";
    myCarriers[2][16] = "LH3000";
    // This function will populate the carrier Drop-down List.
    // This function is called from the initialize event of the carrier Drop-down List.
    function getCarriers(dropdownField)
    dropdownField.clearItems();
    for (var i=0; i < myCarriers.length; i++)
    dropdownField.addItem(myCarriers[i][0]);
    // This function will populate the plans Drop-down List for any event EXCEPT the change event.
    // This function is called by the initialize event of the plan Drop-down List.
    function getPlans(carrierField, dropdownField)
    dropdownField.clearItems(); // Clear the items of the Drop-down List.
    for (var i=0; i < myCarriers.length; i++) // Look through all the carriers until we find the one that matches the carrier selected.
    if(myCarriers[i][0] == carrierField.rawValue) // Check to see if they match.
    for (var j=1; j < myCarriers[i].length; j++) // When they match, add the plans to the Drop-down List.
    dropdownField.addItem(myCarriers[i][j]);
    dropdownField.rawValue = myCarriers[i][1]; // Display the first item in the list.
    // This function will populate the plans Drop-down List for the change event.
    // This function is called by the change event of the carrier Drop-down List.
    // The first parameter is simply a pointer to the xfa object model.
    function getPlansOther(myXfa, dropdownField)
    dropdownField.clearItems(); // Clear the items of the Drop-down list.
    for (var i=0; i < myCarriers.length; i++) // Look through all the carriers until we find the one that matches the carrier selected.
    if(myCarriers[i][0] == myXfa.event.newText) // Check to see if they match. Note: we have to use the event.newText in this case because
    { // the ch

    continued...
    change hasn't been committed yet.
    for (var j=1; j < myCarriers[i].length; j++) // When they match, add the states/provinces to the Drop-down List.
    dropdownField.addItem(myCarriers[i][j]);
    dropdownField.rawValue = myCarriers[i][1]; // Display the first item in the list.
    when i try to add 4 more arrays (add items to first drop down list and second drop down list), nothing displays in either drop down lists. please let me know the items that need to be changed - besides these items (i know i need to add arrays and add myCarriers[1][0],[2][0],[3][0] to [6][0] --- for 4 additional items in the first drop down):
    var myCarriers = new Array(new Array(2), new Array(14), new Array(17)); // Create a two-dimensional array.
    // For each carrier, add a 'new Array(number of plan +1)'.
    // Define the carrier and the corresponding plans.
    // The array syntax is arrayName[index][index].
    // The first index number represents the carrier,
    // the second index number is the actual data value.
    myCarriers[0][0] = " "; // The first items in the Drop-dowm Lists should be blank.
    myCarriers[0][1] = " ";
    myCarriers[1][0] = "ANERT"; // The first data value is the carrier name,
    myCarriers[1][1] = "MC250"; // the rest are plans.
    myCarriers[1][2] = "MC2501";
    myCarriers[1][3] = "MC5002";
    any help would be greatly appreciated. thank you!

  • Drop Down list in table with data from database table

    Hi,
    I have created an interactive form in WD ABAP.
    In Context tab I have created the nodes as follows:
    ZSOHEADER node with cardinality 1..1
    |-> MATERIAL node with cardinality 0..n. Under MATERIAL node there are 2 attrib. MAKTX and MATNR.
    I am fetching data from MARA table into an internal table IT_MARA.
    The node MATERIAL is bound to internal table IT_MARA.
    I have created a table with property ' Body rows vary depending on data ' .
    I have only one row in table. The first cell of the row is a drop down field.
    I have bind the field to the node MATERIAL->DATA->MAKTX.
    Now the issue is even though I have created only one row in my table, in preview it is creating as many rows in the table as the no.of records in the internal table.
    I want only one row with the drop down list containing all values of the internal table.
    Kindly suggest what to do.
    Regards,
    Vinod

    Hi,
    In the WebDynpro Context, in the main node create another node like A1 with cardinality 0..n and in this node create attributes TEXT and VALUE.
    Now goto method and in that method using code wizard read the node A1.
    And use the below code snippet sample in your program, i.e. code this under respective method of the webdynpro.
    *Declare the TYPES
    TYPES : BEGIN OF TY_TABLE,
    TEXT TYPE SOMETYPE,
    VALUE TYPE SOMETYPE,
    END OF TY_UOM.
    *Define Internal Table and work area.
    DATA : IT_TABLE TYPE STANDARD TABLE OF TY_TABLE INITIAL SIZE 0,
    WA_TABLE TYPE TY_TABLE.
    SELECT TEXT VALUE FROM TABLENAME INTO TABLE IT_TABLE.
    lr_node_info->bind_table( IT_TABLE ).
    And in the Adobe Form Layout
    Go to Menu of the Adobe LiveCycle Designer:
    Tools>Options..>DataBinding
    In that window you just check the Show Dynamic properties Check Box.
    Now for the Drop Down go the binding tab in object palette and click on the list items and there specify the Internal Table and specify the text as the internal table text field and value as internal table value field.
    OR
    From the WebDynpro Native Library Palette use the Value Help Drop Down and in object pallette goto binding tab and provide the form interface binding. Before this in the WebDynpro goto Context and for the particular field under the properties provide the search help as dictionary search help and specify the name of the dictionary search help.
    OR
    We have another method of setting the Text and Value to the DDL directly in the WebDynpro by coding in the methods, I dont have much knowledge on this.
    Regards
    Pradeep Goli

  • Drop down list of email addresses missing from "Im...

    Hi folks,
    BT Yahoo's log in screen had the option of a drop down list of email addresses allowing you to select the one you wanted - this was very handy if you used several email addresses or there was only one PC in the house and various members used it.
    In the new improved email, there doesn't appear to have this option - you go into the main account (when you discover how) and the option is still ticked, but has no effect.
    I wish BT would remember that "if it ain't broke don't fix it!"
    I would be grateful to know if it is possible to still select from a list.
    Michael.

    Hi ypt,
    Yes, BT are moving their email and associated services away from Yahoo! For more information on this please go to www.bt.com/newemail
    The new BTemail service and platform will be provided by CP (Critical Path) and existing BT broadband customers will hopefully be migrated to the new email system and platform sometime in the near future once the field trials have been completed.
    The BTYahoo login portal has been closed and you can now only login to your emails by the new BT email login portal on the http://www.bt.com website.
    Cheers
    jac_95 | BT.com Help Site | BT Service Status
    Someone Solved Your Question?
    Please let other members know by clicking on ’Mark as Accepted Solution’
    Try a Search
    See if someone in the community had the same problem and how they got it resolved.

  • How to find the list of users  used  transcation from last 2 days plz urgen

    hi friendd
                   i am in need of  knowing the list of users used transcation in last 2 days
    can any one help me . how to find out the list of  users and used trancation in detail or step by step
    thanks in advance .i know that i can see in st03 but i dont find any user list or trancations .
    apart from that so we have any other transcation to see the user in sap abap box
    regards
    raja

    This info has been posted before but here you go (this is an alternative way to Bernhards):
    ST03N, make sure you are in Expert Mode (not Service Engineer)
    Expand Workload
    Expand Total
    Double Click on the day you want to analyse
    You can see transaction details under Transaction Profile -> Standard
    You can see what tx a user has started under User & Settlement Statistics -> User Profile
    If you are not seeing any data then speak to your Basis administrator about what they are doing with the log files.

  • Populating a Drop Down List

    I'm new to using Flash Builder 4, so we'll get that out of the way immediately!
    My project uses a local database to retrieve and store information.  I've successfully created the database & can query it.  The problem I have is taking the results of that query and populating a simple dropdown list control.  All of the examples and tutorials I've seen, watched and read use either 1) local XML files for sample data or 2) a web data service to return items.  I've gone through those tutorials and trying to accomplish what I want is a piece of cake.  The "Data/Services" has no such 'connector' for local databases, so those 'techniques' don't apply...
    I've tried numerous different solutions I've found and the result is I get all sorts of errors.  This is just my latest attempt and it throws an "Error #1034: Type Coercion failed: cannot convert flash.events::SQLEvent@437fe49 to mx.rpc.events.ResultEvent" at me.  I've tried to search for the different error numbers I get and frankly, the explainations and solutions seem totally out of whack.  I've tried to incorporate them with no success.
    Using Flash Builder 4, it inserts the Spark components.  Lots of errors complain because I don't have an "mx:" component.  Changing "s:DropDownList" to "mx:DropDownList" per examples then starts throwing it's own set of unique errors in the process.
    I have had code where it doesn't throw any errors, but the dropdown list just shows [object Object] for each item returned by the query.  This code throws the error I quote above:
    private var getFacNum:SQLStatement = new SQLStatement();
    [Bindable]
    private var ddFacNum:ArrayCollection = new ArrayCollection();
    private function populateFacilityNumber():void
    getFacNum.sqlConnection = connection;
    getFacNum.text = "SELECT id_facility, facilityNumber FROM facility ORDER BY facilityNumber";
    getFacNum.addEventListener(SQLEvent.RESULT,ongetFacNum);
    getFacNum.execute();
    connectionStatus.text = "Executed Query"; 
    // just show me a prompt that indicates I've gotten at least this far...
    private function ongetFacNum(e:ResultEvent):void
    ddFacNum = getFacNum.getResult().data as ArrayCollection;
    <s:DropDownList includeIn="NewInspection"
    dataProvider="{ddFacNum}"
    fontFamily="Arial" fontSize="16"
    id="ddFacilityNumber"
    prompt="Select facility number...">
    </s:DropDownList>
    I'm coming from a .NET developing environment and it seems that these two types of systems are vastly different.  Any and all assistance, links, pointers, whatever, would be greatly appreciated.

    http://www.adobe.com/devnet/flex/videotraining.html
    http://www.adobe.com/devnet/flex/flex_net.html
    I haven't used .NET for data access as yet but these 2 links should give you a start.
    If you were talking Coldfusion or PHP, I might be able to help but fortunately I haven't been forced to used .NET for a few years. ;o)

  • Drop down list for User ID's and SAP List viewer format

    Couple of quick questions. Any help will be greatly appreciated.
    1) I need to put User ID on the selection criteria screen. And also, I need to build a dropdown list for user ID selection by finding all user IDs in the Finance department and put it on the list.
    2) I need to display the report in the SAP List viewer format, which enable these functions including sorting, hiding fields, filtering, exporting to an excel file as necessary. My output is currently plain vanilla as follows
    loop at ibkpf where belnr = ibseg-belnr.
           read table iskat with key saknr = ibseg-hkont.
           read table icepct with key prctr = ibseg-prctr.
           read table icskt with key kostl = ibseg-kostl.
           write:/
           iBKPF-BELNR,     " Accounting document number
           iBKPF-BUKRS,    " Company code
           iBKPF-GJAHR,     " Fiscal Year Range
           iBKPF-MONAT,     " Period
           iBKPF-USNAM,     " Username
           iBSEG-BELNR,      "Document #
           iBSEG-BUZEI,      "Item #
           iBSEG-BSCHL,      "Posting Key
           iBSEG-SHKZG,      "Debit/credit indicator
           iBSEG-PRCTR,      "Profit Center
           icepct-ktext,
           iBSEG-KOSTL,      "Cost Center
           icskt-ltext,
           iBSEG-HKONT,      "G/L Account
           iskat-TXT20,
           iBSEG-DMBTR,      "Local currency
           iBSEG-WRBTR,      "Document currency
           iBSEG-SGTXT,      "Explanation
           iBSEG-KOART.      "Account type

    Hello Syed
    Here is a sample coding for a dropdown listbox:
    *& Report  ZUS_SDN_DROPDOWN_LIST
    REPORT  zus_sdn_dropdown_list.
    TYPE-POOLS: vrm. " Value Request Manager: Typen und Konstanten
    DATA:
      gt_values   TYPE vrm_values.
    PARAMETERS:
      p_usrid    TYPE xubname AS LISTBOX VISIBLE LENGTH 13.
    INITIALIZATION.
    * Select the allowed values for dropdown listbox
      SELECT bname AS key FROM  usr02 INTO TABLE gt_values
             WHERE  bname  LIKE 'S%'.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = 'P_USRID'
          values          = gt_values
        EXCEPTIONS
          id_illegal_name = 1
          OTHERS          = 2.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    START-OF-SELECTION.
    END-OF-SELECTION.
    You have two fields for the listbox available:
    - KEY (obligatory)
    - TEXT (optional)
    Regards
      Uwe

  • How to get Date value from database and display them in a drop down list?

    Hello.
    In my Customers table, I have a column with Date data type. I want to create a form in JSP, where visitors can filter Customers list by year and month.
    All I know is this piece of SQL that is convert the date to the dd-mm-yyyy format:
    SELECT TO_CHAR(reg_date,'dd-mm-yyyy') from CustomersAny ideas of how this filtering possible? In my effort not to sound like a newbie wanting to be spoonfed, you can provide me link to external notes and resources, I'll really appreciate it.
    Thanks,
    Rightbrainer.

    Hi
    What part is your biggest problem?? I am not experienced in getting data out of a database, but the way to get a variable amount of data to show in a drop down menu, i have just messed around with for some time and heres how i solved it... In my app, what i needed was, a initial empty drop down list, and then using input from a text-field, users could add elements to a Vector that was passed to a JComboBox. Heres how.
    package jcombobox;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Vector;
    import javax.swing.*;
    public class Main extends JApplet implements ActionListener {
        private Vector<SomeClass> list = new Vector<SomeClass>();
        private JComboBox dropDownList = new JComboBox(list);
        private JButton addButton = new JButton("add");
        private JButton remove = new JButton("remove");
        private JTextField input = new JTextField(10);
        private JPanel buttons = new JPanel();
        public Main() {
            addButton.addActionListener(this);
            remove.addActionListener(this);
            input.addActionListener(this);
            buttons.setLayout(new FlowLayout());
            buttons.add(addButton);
            buttons.add(remove);
            add(dropDownList, "North");
            add(input, "Center");
            add(buttons, "South");
        public void actionPerformed(ActionEvent e) {
            if (e.getSource() == addButton) {
                list.addElement(new SomeClass(input.getText()));
                input.setText("");
            } else if (e.getSource() == remove) {
                int selected = dropDownList.getSelectedIndex();
                dropDownList.removeItemAt(selected);
        public void init(String[] args) {
            setSize(400,300);
            getContentPane().setLayout(new BorderLayout());
            getContentPane().add(new Main());
    }And that "SomeClass" is show here
    package jcombobox;
    public class SomeClass {
        private String text;
        public SomeClass(String input) {
            text = input;
        public String toString() {
            return text;
    }One of the things i struggled a lot with was to get the dropdown menu to show some usefull result. If the list just contains class references it will show the memory code that points to that class. Thats where the toString cones in handy. But it took me some time to figure that one out, a laugh here is welcome as it should have been obvious :-)
    When the app is as simple as this one, using a <String> vector would have been easier, but this is just to demonstrate how to place classes in a vector and get some usefull info out of it, hope this answered some of your question :-)
    The layout might have been easier to write, than using the toppanel created by the JApplet and then the two additional JPanels, but it was just a small app brewed together in 15 minutes. Please comments on my faults, so that i can learn of it.
    If you need any of the code specified more, please let me know. Ill be glad to,

  • Drop Down List not getting populated

    Dear All,
    I have developed a form in SFP which containes a drop down list.The drop down list is to be populated by an internal table field.
    Whenever I am executing the form i can see only the first item in the drop down listand nothing else.
    While debugging i could see the almost 15 entries in the internal table.
    I have mapped a field of this internal table to the drop down list.I am unable to figure out the problem....do let me know which type of drop down list should i use for this scenario....I even tried with java script...but nothing works for me...do let me know??
    Waiting for t
    Regards,
    Geet

    hi,
    i guess you have bound the field but not the list elements of the field.
    the content of the field (as result of the selection from the drop down list box) can be bound to a variable.
    But if you want to display your internal table as entries in your drop down list box you have to do some dynamic data binding of the list elements.
    to be able to do this, you first have to activate dynamic data binding in general. Use the way i proposed (--> extras from the toolbar!, options, data binding, dynamic). then the word "list elements" in the object palette of your dropdown list box will be green and you will be able to do some dynami data binding!
    i recommend you this one:
    --> http://www.adobe.com/devnet/livecycle/articles/strategies_creating_forms_lc_designer8/strategies_for_creating_form_designs_using_designer8.pdf
    br
    norbert

  • How to populate active directory users in to drop down list items dynamically in Share point 2010 ?

    Hi My self Arun in my current project i have a task on that active directory user  need to automatically populate in share point list drop down  please help me.  is that any out of box feature in share point 2010 ?   
    Thanking You 
    Arun 

    Arun,
    If you plan to implement the "Querying the Active Directory" based on my code snippet,
    and if you do not have permission [your account must be the part of domain admin] to do so,
    Then still you can do it in least effort through code,
    string usersInXml = SPContext.Current.Web.AllUsers.Xml;your xml string look like this.
    <Users><User ID="2" Sid="" Name="Administrator"
    LoginName="i:0#.w|murugesan\administrator" Email="" Notes="" IsSiteAdmin="True" IsDomainGroup="False" Flags="0" /><User ID="1" Sid="" Name="Murugesa Pandian" LoginName="i:0#.w|murugesan\murugesan" Email="" Notes="" IsSiteAdmin="True" IsDomainGroup="False" Flags="0" /><User ID="1073741823" Sid="S-1-0-0" Name="System Account" LoginName="SHAREPOINT\system" Email="" Notes="" IsSiteAdmin="False" IsDomainGroup="False" Flags="0" /></Users>
    You can user Linq to XML to filter the "LoginName,Name and Email and then populate your drop down list.
    * User must be logged into the site at least once.
    Murugesa Pandian.,MCTS|App.Devleopment|Configure

  • Is it possible to show first item in a Drop down list

    Is it possible to automatically display the first item in a drop down list ?
    The reason I ask is  ... I am generating pre-filled PDF forms using XML data files.
    Whenever there is a certain type of data I am populating a drop down list for the user to review.
    Currently, the user must click on the drop down to see if data is there regardless of whether there is no data at all or many data lines of data..
    I would like to make it clear to the user whether or not there is any data - right awa.y
    I have considered creating a display item next (like a check box or a text field ) next to the drop down and setting it to cindicate if there is data, etc -
    but i thougth that I would ask if the drop down could simply be set to automatically display the first item in the list (this is the preferred functionality)
    If this is not possible I can always create a check box and set it if there is any data as an  indicator for the user ..
    Thanks

    You can do this way..
    Place the code in Inititalize event with Java Script
    if(DropDownList1.rawValue == null)
        DropDownList1.selectedIndex = 0;
    You need to check if the Dropdown has a value selected from the previous save.. If not then set the selected item to 0th index. (which is 1st one in the dropdown values)..
    Thanks
    Srini

Maybe you are looking for

  • BT wont credit my account and re-bill me!! Chat in...

    I have been having difficulties with BT for 7 months now! they really are driving me mad, i have phoned, been on instant chat to them soooo many times, no one listerns at all to what you say. I was made unemployed back in Nov, this meaning i was unab

  • CS5 Playback Settings grayed out and no longer can set playback on external monitor.

    I like to view my projects while editing on an external monitor but the Playback Settings are grayed out. I've done all my prior projects with external monitor display enabled with no problems and can go back to a prior projects completed and view th

  • Tired of replacements that don't work!!!

    I am on my 3rd replacement of a 4th generation 20gb ipod, originally purchased in August, 2004. Each replacement has had either a bad hard drive, a malfunctioning click wheel or some other problem which I have now forgotten. I received my last replac

  • Email button created in InDesign won't work on Interactive PDF. Anyone know a fix?

    Hello there, I am trying to make a e-mail button work after its .swf file is imported into a new iD document and exported as a interactive PDF. I have tried various things and work around but I can not seem to be able top make it wrong. I ask iD twit

  • Outlook 2010 not picking up Acess Connection​s

     Hi Guys, I am wondering if you can help me ? I just got the edge 13 with intergrated 3g. However i can not connect to my exchange account as it keeps on giving me a please connect to internet error. IE works perfectly and i can access the webmail. I