Add items in DropDownList

Hi, I have a problem.
I use dataProvider to get data from my database and put in my dropdown. But I want to add an item, for example: "Select an element...".
At the end of the init(), I do dropDown.setItem("Select an item"), but disappear the data loaded of database and neither appears the item "Select an item...".
Any idea ? Thank's !

I tried that and it didn't work in my real life project, but now that I've tried it in a simple test script it works! In my main project I'm passing something from one window to another and I must be doing something wrong there. Thanks. At least now I know what should work, I just have to find what else I'm missing.

Similar Messages

  • How do I read txt file and add items to dropdownlist or checkbox

    I want to add items to a dropdown or check box by reading from a text file(and select one of them). (I donot use any table or database). The list of items is sometimes upto 20MB and hence cannot populate using session bean.I want items to be added to either checkbox or listbox during a button action. I have done this for textarea but unable so far to acheive for checkbox or listbox. I use following code which does not work:
    public String button3_action() {       
    try{           
    FileReader fr = new FileReader "F:/CreatorProjects/checkboxtst.prs");
    BufferedReader br = new BufferedReader(fr);
    String s;
    while((s=br.readLine())!=null) {
    dropdown1.setValue(s);
    br.close();
    fr.close();
    }catch(Exception e) {
    e.printStackTrace();
    return null;
    I know I cant just transplant textarea code for dropdownlist or checkbox.
    Any help is greatly appreciated.
    Thanks.
    Dr.AM.Mohan Rao

    I am able to read from txt file to a listbox if i write in sessionsbean1:
    try{
    FileReader fr = new FileReader("F:/CreatorProjects/checkboxtst.prs");
    BufferedReader br = new BufferedReader(fr);
    String s1="";
    String s="";
    while((s=br.readLine())!=null) {
    s1 = s1+s;
    s1= s1+"\n";
    disOptions = new com.sun.rave.web.ui.model.Option[] {              
    new Option(s1,s1)};
    diseases = new String[] {};
    fr.close();
    br.close();
    catch(Exception e) {
    e.printStackTrace();
    But I get all data in one line!! if I click submit button text area gets all. How to display items in each line????Please help...
    Dr.AM. Mohan Rao

  • How to add TickMark into dropdownlist?

    Hello,
    i am looking for dropdownlist with multiple selection.
    Is there a DropDownList widget allows more than one menu item to be selected at a time?
    i got ans from forum
    http://forums.adobe.com/message/3319311#3319311
    they said we can add tickmark into dropdownlist.so that we can select more than one item.But How to add Tickmark into dropdownlist? OR can we custmize dropdownlist?
    please, give some hint.
    If Anybody knows the solution , please help me.

    I think there are two ways:
    1) Use a specific control with text tokenization, like a Telerik's one  RadAutoCompleteBox (user1's text is a token, and user2's text is an editable
    text area);
    2) Use CSR (client-side rendering; JSLink field of a list EditForm's web part) to make the original field (input tag) read only and dynamically add second text
    box for user2's editable text. Then on form submit you can combine the two values: read only one and dynamically edited. You may do so via overriding the PreSaveAction() JavaScript function in your JSLink file.
    v

  • Can not add item to the shopping Cart with FireFox 8.0

    I can not add items to the shopping cart with Firefox 8.0. Switch to IE everything works then.

    Such details are stored in a cookie, so make sure that you do not block cookies on that site.
    *Tools > Page Info > Permissions
    You can inspect and manage the permissions for all domains on the <b>about:permissions</b> page via the location bar.
    *http://kb.mozillazine.org/Cookies
    *http://kb.mozillazine.org/Websites_report_cookies_are_disabled

  • When I want to add items to the bookmarks toolbar, for example: -Zoom toolbar. The zoom Toolbar appears on the bookmarks toolbar, but it shows the favicons aswell the underlined text. I only want the favicons. How to do this, please help!!

    I want to add items to the bookmarks toolbar. for example: the Zoom Toolbar addon. This works, but not only the favicons appear on the bookmarks toolbar, aswell as the underlined text. How to avoid this?
    I only want the favicons from an addon to appear on the bookmarks toolbar, not with the underlined text. How to do this?
    This problem doesn't happen with any other toolbar. And this problem didn't happen with an earlier version of firefox. Please Help!
    Thanx, BassMann.

    If you only want the favicons and not the names of the bookmarks on the bookmarks toolbar, you can do that with the [https://addons.mozilla.org/en-US/firefox/addon/4072/ Smart Bookmarks Bar] add-on.

  • Get previous items unique value in new add item form

    Hi
    I have on list having items related to multiple locations.
    Every location is related to one user.
    When user logs in it filters the list with that users location.
    Now when user click on add new item I want to get the data related to his location using item event listener.
    But in new item form there is no way to get the location of that user in event listener as its new item.
    So I passed the qury string parameter form list and changed the add item form link and form to get the query string paramter as default value in Add new Item form.
    But again when user clicks on save button it redirects to original url without paramter. 
    How to redirect user to url with parameter on click on Save/Cancel.
    Is there any other way to get the previous item unique value in add new item from before executing the event listener?

    Hi,
    According to your post, my understanding is that you wanted to redirect user to url with parameter on click on Save/Cancel.
    You need to modify the onclick event need to as below:
    javascript: {{ddwrt:GenFireServerEvent('__redirect={{Home.aspx?Participant={@Participant}&amp;@Activity={@Activity}}}')}}
    Here is a similar thread for your reference:
    http://social.technet.microsoft.com/Forums/en-US/b506cfe5-650e-4017-b470-9ca0a75cd390/sharepoint-2010-list-how-to-pass-parameters-in-a-url-to-another-page?forum=sharepointcustomizationprevious
    In addition, you can creating an intermediate page which just finds the filed value with a DVWP and then redirect to RedirectURL with the filed value on the Query String.
    For more information, you can refer to:
    Redirect to Another Page from NewForm.aspx with the New Item’s ID
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • DataGrid - Create at runtime - How to Add Items??

    I create a DataGrid at runtime and then and columns to it as need be. How Can I add items with the correct dataField if I don't if I don;t know this till runtime? In other word I'm having trouble constructing the Object to send to AddItem becase the dataField Name needs to be hard coded...
    Below does not work for me because if I have more than one column then I can seem to figure out out to create  ItemObjFinal dynnamically.
    var ItemObjFinal:Object = {ThisNameNeedsToBeDynamic: "text", ThisNameNeedsToBeDynamic: "value" };
    I also tried creating an array of Objects like this:
    var ItemObjFinal:Object = new Object;
    var obj:Object= dgc.dataField;
    ItemObjFinal [0] = {(obj.valueOf()):  dgc.headerText };
    ItemObjFinal [1] = {(obj.valueOf()):  dgc.headerText };
    =========================================================================================
                  ac.addItemAt(dgc, int(ac.length));
                  dataGrid_preview.columns = ac.toArray();
                  var obj:Object= dgc.dataField;
                  var ItemObjFinal:Object = {(obj.valueOf()):  dgc.headerText };
                  var obj2:Object= dgc.dataField;
                  var ItemObjFinal2:Object = {(obj2.valueOf()): dgc.headerText};
                  //K Now add it!
                  //IList(dataGrid_preview.dataProvider).removeAll();
                  IList(dataGrid_preview.dataProvider).addItemAt(ItemObjFinal,0);
                 //IList(dataGrid_preview.dataProvider).addItemAt(ItemObjFinal2,1);

    Ahh answered my own question:
                 ac.addItemAt(dgc, int(ac.length));
                  dataGrid_preview.columns = ac.toArray();
                  var ItemObjFinal:Object = new Object;
                  var ItemObjFinal2:Object = new Object;
                  for each(var col:DataGridColumn in ac)
                    ItemObjFinal[col.dataField] = col.headerText;
                    ItemObjFinal2[col.dataField] = col.headerText;
                  ItemObjFinal[dgc.dataField] = dgc.headerText;
                  ItemObjFinal2[dgc.dataField] = dgc.headerText;
                  //K Now add it!
                  if(IList(dataGrid_preview.dataProvider).length > 1)
                      IList(dataGrid_preview.dataProvider).removeItemAt(0);
                      IList(dataGrid_preview.dataProvider).removeItemAt(1);
                  IList(dataGrid_preview.dataProvider).addItemAt(ItemObjFinal,0);
                  IList(dataGrid_preview.dataProvider).addItemAt(ItemObjFinal2,1);
    This code may still need some tweaking as I get an RTE at  "IList(dataGrid_preview.dataProvider).removeItemAt(1);"   but at least I'm able to solve my original question. Thanks Alex!

  • Cannot add item in A/P Invoice

    Hi, all,
    I want create a A/P invoice without copy from PO or GRPO. However, after I input BP Code, I am not able to add item in Matrix row. Seems that it is blocked
    Any ideas?
    Thanks

    Hello kimmycheng,
    The marketing document can be of 2 types ..Item or Service...this is indicated by the Item / Service type drop down just above the matrix/grid
    If you want to add an Item..this drop down should be set to Item.  If it is of type Service then you might not see the ItemCode column.
    If does not reflect / help what you are referring to ....then please explain your issue ina bit more detail
    Suda

  • Error message when trying to add item in change BOM goup

    Hi I went to transaction cs05,and trying to add item to specific material with BOM group,an error message popped up and saying assign the item to an alternative,what does it mean? How to solve?

    Hi,
    A finished material can have multiple alternative BOMS which can be stored in a common BOM group number. CS05 is used to change these multiple boms.
    When you add a new item in CS05, system will ask - to which alternative bom the new item should be assigned and that's how you are getting this message. For example, if in a bom group you have 3 differnet alternatvie boms for a FG material, when you add new item in CS05, you will see 3 checkbox at the right hand side of the screen. If you want to assign new item to all the three alternative BOMs , than select all the three check box and save.
    Regards,
    Ravi Thakkar.

  • Open Add Item Form as Dialog

    Hi All - I have a custom button on the click of which I am trying to open a Add Item form. When the display form opens I want to hide all the masterpage items( viz. Quick Launch, header, foooter, etc). I tried below but it's not opening and giving error
    when the masterpage is Oslo. It works fine when masterpage is Seattle. 
    <asp:LinkButton OnClientClick ="javascript:SP.UI.ModalDialog.showModalDialog({ url: '../Lists/AddAccount/NewForm.aspx', title: 'Add Account' }); return false;" CausesValidation="false"   CssClass="orange-btn" Text="Post"
    runat="server" ID="btnPost"></asp:LinkButton>
    Does anything know why is it happening?
    Regards,
    Khushi
    Khushi

    You need to set the URL of SharePoint link button like this
    http://<Site Name>/Lists/AddAccount/NewForm.aspx?isDlg=1
    to open that in modal dialog use below jScript.
    <script type="text/javascript">
    function openDialog(listUrl, frmTitle) {
    var options = {
    url: listUrl,
    title: frmTitle,
    allowMaximize: false,
    height: 500,
    width: 600,
    showClose: true
    //SP.UI.ModalDialog.showModalDialog(options);
    SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
    </script>
    And your anchor tag should be like
    <asp:LinkButton OnClientClick ="javascript:openDialog('/Lists/<List Name>/NewForm.aspx?IsDlg=1', 'Add Account')" CausesValidation="false" CssClass="orange-btn" Text="Post" runat="server" ID="btnPost"></asp:LinkButton>
    Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer.

  • How to customize the default add item in a content area

    Hi!! I want to know what can I do to introduce a file in a content area, but I don't want to use the default page that portal use. I want to customize the add item option, the same that I have done with the folders. The problem that I have is that I need the user to have the file on his/her pc, and the api add_item needs the file on unix, where de DB is installed.
    If anyone has any idea, please help me.

    Hi All,
    Thanks for all your reply, but maybe i didn't describe my problem clear. My problem for the combobox is that once the combobox has a selected value, then there is no way to clear it in the UI even I remove all the items in its ValidValues. From the user interface, the selected value still stays there but actually this combobox is empty and does not have any items. My question is how can I remove the current selected item in the combobox.
    Thanks,
    Lan

  • 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

  • Virtual keyboard's context-menu: can users add items to it?

    iPad's virtual keyboard has a context-menu: when you hold a finger down on the -a- key of the English keyboard, for example, a context-menu appears showing various accented/combining forms of the character -a- from which you can choose. Is there a way for users to add items to this context-menu? Could one add [ð] [u00F0, 'Latin eth'] to the [d] key's context-menu and [þ] [u00FE, 'Latin thorn'] to the [t] key's context-menu?

    Unless there is a keyboard language that already supports those characters, then no. You cannot add additional options to the built-in keyboard. There are apps that extend the keyboard, one in particular is the Wolfram Alpha app. While I don't know if it supports the characters you are looking for, it does have an extensive variable based keyboard for input in addition to the system keyboard.

  • Object array - how to add items?

    Hello!
    I have little problem, how to add item to array, to get something like this:
    Object[][] someObject = {
    {"1", "2"},
    {"4","5"}
    };From this:
    Object[][] someObject = {
    {"1", "2"}
    };? Thanks in advance!

    Once you allocate an array like that, you can't
    resize it.
    Object[][] someObject = {
    {"1", "2"}
    };creates an array with size [1][2]. You can't makeit
    any larger. You can create a new Object[][]
    with the new size, copy the elements into the new
    array, then add your new objects in the newposition.
    or even better use arraylistExcept that he's using this for a JTable, so the best he could do is a Vector. Yuck. :)

  • The RFX before upgrade does not allow me to add items from catalog

    hello gurus
    I have a problem with the RFX, we did an upgrade to SRM7.0 from SRM5.0.
    The RFX that existed before upgrade in the server does not allow me to add new items from catalog.
    each RFx I created after the upgrade works fine.
    My client needs to work with the RFx still open, add items and make bids.
    I have reviewed the upgrade guide and found nothing regarding an update of purchasing documents.
    I have
    SRM 7.0 SPS03 EHP1
    MDM 7.1 SP06
    MDM catalog 3.0SP10

    in SRM 5.0 the system was MDM catalog. Actually, after the upgrade , i have SRM7.01 with MDM catalog.
    i donn´t know if it is about version, SP or compatability issue, but i believe the upgrade not affect the purchaser documents.
    Those look as locked to modify. on tap Position, the buttom ADD LINE, only i can see Position, not anymore option like MDM catalog, free text.
    it is a big problem, because the client has documents opened. i need to resolve this issue. Actually i am working in a sandbox system, but i afraid to have the same problem in PRD system after upgrade.
    regards

Maybe you are looking for

  • Links not showing in Links palette; InDesign CS3

    Specs: Version CS3 OS: XP Professional Memory: 2gb After running several searches I found an almost identical question in this forum, but an answer was not posted, plus they had an older version. The link text (missing or not) is not showing up in th

  • Ive tried to reset my iclouds password but its not working

    i need to activate iphone 4s, ive tried on my laptop to re-set it but its not working, ive been trying for the pass 3hours? i just want to use my phone again? i cant remember setting a password? I aslo cant remember if i created two different passwor

  • How can i delete a UserName  from a text file using Strings or io.

    hi i m trainee i have been assigned to make java program which deletes a UserName and his Passwor from a Text File i m unable to do it using the code below plz help do reply   import javax.swing.*; import java.awt.*; import java.awt.event.*; import j

  • What do you do when BT are ignoring you?

    Hi.  I don't know what else I can do to get an explanation/apology from BT.  I phoned the 150 number because I was unable to call out on my phone and was later told no-one could call in either.  Assuming a fault I used mobile to call it in. One hour

  • User conversion tag

    Hi people, I have following mapping rule in mappings file: in-chan=*;out-chan=tcp_intranet;convert $C$:T$EYes,Channel=tcp_keeper The $T is used to find user conversion tag, but it seem that it not working, at the same time it does work with mailDomai