Can't set InfoPath 2010 Drop Down List field with C#

Hi Guys,
Here I go again, last time it was a date field, this time it is a drop down list. The applications does this: When the user comes into the form, they have the option of creating a new form via a hyperlink button on the top of the page, this button creates
a new IP Page of the same exact type of page that it is coming from. The issue I am having is that one of my fields called ddlStatus isn't coming up correctly in the copied form, not sure why? If anyone can help I would be eternally grateful. Here is a copy
of my code:
if (e.InputParameters !=
null)
                            System.Text.
StringBuilder status =
new System.Text.StringBuilder();
string ddlStatus =
string.Empty;
if (e.InputParameters.TryGetValue("ddlStatus",
out ddlStatus))
                                status.AppendLine(ddlStatus);
                                nav.SelectSingleNode(
"/my:myFields/my:secInfo/my:ddlStatus", NamespaceManager).SetValue(status.ToString());
Best regards, Mike

Well, ok, so I set my code as such:
   addStatus()                    
if (e.InputParameters !=
null)
                           System.Text.
StringBuilder status =
new System.Text.StringBuilder();
string ddlStatus =
string.Empty;
if (e.InputParameters.TryGetValue("ddlStatus",
out ddlStatus))
XPathNavigator nav1 = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:secInfo/my:Group",
NamespaceManager);
                                nav1.SelectSingleNode(
"/my:myFields/my:secInfo/my:Group/my:DisplayName",
NamespaceManager).SetValue(status.ToString());
                                nav1.SelectSingleNode(
"/my:myFields/my:secInfo/my:Group/my:Value",
this.NamespaceManager).SetValue(status.ToString());
and I also created a new method called addStatus() which looks like this:
public
void addStatus()
try
SPSite site =
new
SPSite(http://MyTestBox);
SPWeb web = site.OpenWeb();
SPList list = web.Lists["Status"];
SPListItemCollection listitems = list.Items;
XPathNavigator nav =
this.CreateNavigator().
                    SelectSingleNode(
"/my:myFields/my:secInfo/my:Group",
this.NamespaceManager);//
Note: "/my:myFields/my:Countries" => Group Countries
foreach (SPListItem
li in listitems)
XPathNavigator newNode =
null;
                    newNode = nav.Clone();
                    newNode.SelectSingleNode(
"/my:myFields/my:secInfo/my:Group/my:DisplayName",this.NamespaceManager).SetValue(li["Title"].ToString());
                    newNode.SelectSingleNode(
"/my:myFields/my:secInfo/my:Group/my:Value",this.NamespaceManager).SetValue(li["Title"].ToString());
                    nav.InsertAfter(newNode);
                    newNode =
null;
                nav.DeleteSelf();
                nav =
null;
catch
but it still isn't working??
Best regards, Mike

Similar Messages

  • Can we assign OTR to drop down list?

    Hi, All:
    In Webdyn Pro, Can we use Text element or can we assign OTR to drop down list text field.
    for example:
    wa_value_set-text  = $OTR:ZPACKAGE/TEST_MSG
    thanks,

    STEP 1 GET THE OTR TEXTS:
    <b>
    As described in previous answer...
    CALL METHOD CL_BSP_RUNTIME=>GET_OTR_TEXT
          EXPORTING
            ALIAS = 'OTR_Package/OTR_Elemet'
          RECEIVING
            TEXT  = wa_value_set-text .
    </b>
    Step 2 Update Node attribute info with the set of
    <b>
    Update the meta data info behind the COntext Node attribute that is to have the
    drop down list.
    GET NODE from WD_CONTEXT.  (use wizard)
    Then call GET_NODE_INFO to get the reference to the meta.
    Then ADD  your values,  whatever they are from STEP 1 to the ATTRIBUTE 
    of the node. Using SET_ATTRIBUTE_VALUE_SET method.
    </b>
    Seems a strange thing to do.
    May I ask why the OTR is to be the source of drop down lists ?
    regards
    Phil.

  • How can I make a bound drop-down list using OAF?

    Please note, this is for OAF. I am aware of the support in ADF.
    I'm sorry this is such a basic question, but I've been trying for days, and I can't think of anywhere else to look for an answer.
    I need a simple drop-down list, not a search. This particular list only has 10 or so items. It is based on a view containing a code value, and a description. I need all descriptions to be available at all times. Just click the arrow, and the entire list is displayed. When the user selects an entry, the code associated with the discription populates a bound attribute. Ideally, when the page is instantiated, the code value controls the text value visible in the collapsed drop-down list. Visually, it would be similar to an html <select> element.
    Can someone please tell me how I can produce such a simple thing, or point me to some documentation?
    Thank you.

    Thank you for the excellent reference Peddi. I had played with the OAMessageChoiceBean component yesterday, but I was able to tell from your instructions that "Picklist Display Attribute" and "Picklist Value Attribute" really are not for binding to the database EO. That was the key piece of information that had me confused.
    In addition to adding the messageChoice component to the page, I needed to write some code to synchronize the picklist value with the corresponding code value, which I placed in am OAFormValueBean (hidden form field) which I could then bind to my application's database EO in the controller, running in the processFormRequest procedure:
    /** Synchronize the catalog code with the selected catalog name */
    protected void syncCatalogValues(OAPageContext pageContext,
    OAWebBean webBean, MyApplicationAMImpl am) {   
    OAMessageChoiceBean mcb =
    (OAMessageChoiceBean) webBean.findChildRecursive("CatalogName");
    OAFormValueBean cc =
    (OAFormValueBean) webBean.findChildRecursive("CatalogCode");
    String catalogDescription = mcb.getText(pageContext);
    if (catalogDescription != null) {
    String catalogCode = am.getCatalogCode(catalogDescription);
    cc.setValue(pageContext, catalogCode);
    Along with a little code to get the catalogCode value from the LOVVO, that's all it took.
    Thanks again. This was a great help.
    Pete

  • Acrobat form; how to set-up a drop down list that has catagories?

    Hi,
    We produce business directories.
    I am working on a display ad proof template where the user has a choice of 10 main categories where each main has 5 to 15 sub-categories.
    In my new Adobe Acrobat Pro 9 I understand how to create a drop down list, but can't seem to find where to tie in the sub-categories for each for the main listing.
    When the main category is chosen it would only show the related subcategories. See clip below. I am sure this is easy...just find the steps in the instructions.
    Thanks, Bruce 

    Hi Bruce,
    This forum is specific to Designer, which comes with Acrobat Pro 9. It will be easier to create this type of functionality in Designer (compared to achieving it in Acrobat).
    Designer creates XFA Forms, which are wrapped in a PDF. The user doesn't see any difference: eg they see a PDF which will open in Acrobat/Reader. However for user with Reader to be able to save the data they input, the form must be reader Enabled. This is a topic in itself and there are many discussions on the forums - just try a quick search.
    Now to the question...
    Yes, you can achieve this with some script. Basically you would need script in the preOpen event of the Business sub-category, which would look back at the selection in the Business category. Based on this value, the script would populate the sub-category with appropriate items.
    There is an example here: http://assure.ly/jcTahK.
    Hope that helps,
    Niall

  • How can I add categories to drop-down lists or check-boxes?

    hello can I use sub categories or group items by labels when using drop-down lists or check-boxes?

    You can't include sub-menus in a drop-down. What is possible, though, is to populate another drop-down based on the selection made in the first one, or use a pop-up menu. Both things require a script, though.

  • How can I put JTree into drop-down List of JCombobox

    I want to create a drop-down list which shows a list of nodes. When the user clicks on a node, it should open to show the leafs. Clicking on a leaf should close the ComboboxPopup and show its value. Creating a renderer only represent my tree, but I can't trap the events.
    Here is my simplified code.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.JTree;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.border.*;
    import java.util.*;
    public class ComboBoxTreeDemo  extends JPanel
         static JFrame frame;
         ComboBoxRenderer renderer;
         JTree tree;
         public ComboBoxTreeDemo()
              setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
              DefaultMutableTreeNode root =  new DefaultMutableTreeNode("top");
              DefaultMutableTreeNode sub1 =  new DefaultMutableTreeNode("sub1");
              DefaultMutableTreeNode sub2 =  new DefaultMutableTreeNode("sub2");
              root.add(sub1);
              root.add(sub2);
              tree = new JTree(root);
              String[] string = {"1" };
              JComboBox jcb = new JComboBox(string);
              renderer = new ComboBoxRenderer(this);
              jcb.setPreferredSize(new Dimension(100,22));
              jcb.setEditable(true);
              jcb.setRenderer(renderer);
              JPanel jpa = new JPanel();
              jpa.setLayout(new BoxLayout(jpa, BoxLayout.PAGE_AXIS));
              jpa.setAlignmentX(Component.LEFT_ALIGNMENT);
              jpa.add(jcb);
              add(jpa);
              setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
         private static void createAndShowGUI()
              JFrame.setDefaultLookAndFeelDecorated(true);
              JFrame frame = new JFrame("ComboBoxTreeDemo");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JComponent newContentPane = new ComboBoxTreeDemo();
              newContentPane.setOpaque(true);
              frame.setContentPane(newContentPane);
              frame.pack();
              frame.setVisible(true);
          class ComboBoxRenderer extends JPanel implements ListCellRenderer
              ComboBoxTreeDemo cbt;
              public ComboBoxRenderer(ComboBoxTreeDemo cbt)
                   this.cbt = cbt;
                   setLayout(new BorderLayout());
                   add(cbt.tree);
              public Component getListCellRendererComponent(JList list,Object value,int index, boolean isSelected,boolean cellHasFocus)
                   return this;
         public static void main(String[] args)
              javax.swing.SwingUtilities.invokeLater(new Runnable()
                   public void run()
                        createAndShowGUI();
    }

    Thank you for the excellent reference Peddi. I had played with the OAMessageChoiceBean component yesterday, but I was able to tell from your instructions that "Picklist Display Attribute" and "Picklist Value Attribute" really are not for binding to the database EO. That was the key piece of information that had me confused.
    In addition to adding the messageChoice component to the page, I needed to write some code to synchronize the picklist value with the corresponding code value, which I placed in am OAFormValueBean (hidden form field) which I could then bind to my application's database EO in the controller, running in the processFormRequest procedure:
    /** Synchronize the catalog code with the selected catalog name */
    protected void syncCatalogValues(OAPageContext pageContext,
    OAWebBean webBean, MyApplicationAMImpl am) {   
    OAMessageChoiceBean mcb =
    (OAMessageChoiceBean) webBean.findChildRecursive("CatalogName");
    OAFormValueBean cc =
    (OAFormValueBean) webBean.findChildRecursive("CatalogCode");
    String catalogDescription = mcb.getText(pageContext);
    if (catalogDescription != null) {
    String catalogCode = am.getCatalogCode(catalogDescription);
    cc.setValue(pageContext, catalogCode);
    Along with a little code to get the catalogCode value from the LOVVO, that's all it took.
    Thanks again. This was a great help.
    Pete

  • Setting values in Drop down list in Screen Painter

    Hello Freinds,
    I have the requirement as, I have drop down list in screen painter and want to fill the values in that list using database table.
    So using foreign key table I have updated the values in the list.
    But now client wants me to fill the dropdown list with ID as well as description..
    Please suggest me how to achieve this.
    Thanks and Regards
    Nishad

    Hi,
    You the FM 'F4IF_INT_TABLE_VALUE_REQUEST'  and try.
    Fill the internal table with the key and description and pass the same to above FM.
    You will get sample code by searching the forum.
    Thanks.
    Anversha

  • PO drop down list populates with "Delivery Completed" POs

    All,
    I have seen the following issue: When the supplier creates an ASN manually and is requested to populate the Purchase Order field, the drop down list displays "Open" Purchase Orders as well as "Delivery Completed" ones, which is very confusing.  Do you happen to know how I can ensure that the supplier only has the choice to select from "Open" Purchase Orders when creating a new ASN?
    Thank you for your help!
    Johanna

    If a particular email address will only be associated with a single office, then one thing you can do is set the export value of the items in the combo box to the corresponding email addresses. The email address will be the value of the field when you retrive it with JavaScript.
    To submit to a particular email address, it would be best to use the mailDoc method, which is documented here: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.505.html
    This is best because it allows you to reliably customize all the the email properties like recipients, subject, body, etc.
    The code for getting the value of the comob box would look something like this:
    // Get the email address from the combo box named "combo1"
    var sTo = getField("combo1").value;
    If more than one office will have the same email address associated with it, post again and I can refer you to other posts that discuss this situation. You would have to use a similar approach if you do not want to set the export values of the items to the email addresses for some reason.
    The alternative is to use the submitForm JavaScript method, but specifying the subject and body text is less reliable and more complicated.
    If you need more help, post again.

  • Use of Zero (0) in Required Drop-Down List Field

    Using LiveCycle Designer ES 8.2.1x and Acrobat Pro Extended 9.1.2.
    I have a drop-down list (DDL) on a form for entering a quantity.  For certain reasons (i.e., quantity bundling/packages), I want to use a DDL.
    For one thing, if I set the default value to zero (0), that value does not appear in the DDL in the published form.
    Moreover, I've set the field to "User Entered - Required".  However, the form doesn't recognize/validate zero (0) as an entry in this field, and I need it to.
    Is there a trick to using a zero (0) as a value in a DDL, esp. one set to "required"?

    I too was unable to recreate the error/condition, so, I deleted and
    re-inserted the fields, without a problem.
    B

  • How to set focus on drop down list

    I've a drop donw list and when the user click on a record of the list, i'ld like to set the focus on the previous record.
    Can u help me pleassse

    I'm not sure if you can detect the "previous" element, it may be possible through tab order perhaps.
    But you could use the drop downs change event, to set the focus to any field by hard coding it:
    form.drop_down_list::change - (JavaScript, client)
         xfa.host.setFocus(form.previous_field_name.somExpression);

  • Sugar CRM issues: can't create or edit drop-down lists

    ''locking as a duplicate - https://support.mozilla.com/en-US/questions/822646''
    Sugar CRM CE 6.2.0 will not let me add drop down boxes in Firefox. Yes I've cleared the cache. Yes I can do what I need in IE8. Yes the server permissions have been checked by the web host.
    IE8 was partially faulty but works since the host reset my permissions.
    Initally I got this errror:
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Tablet PC 2.0; .NET4.0C; InfoPath.3)
    Timestamp: Mon, 16 May 2011 05:51:03 UTC
    Message: 'inputsWithErrors[...].style' is null or not an object
    Line: 1
    Char: 1
    Code: 0
    URI: http://www.[hostname].com/beta3/index.php?module=ModuleBuilder&action=index&type=dropdowns
    Message: 'inputsWithErrors[...].style' is null or not an object
    Line: 1
    Char: 1
    Code: 0
    URI: http://www.[hostname].com/beta3/index.php?module=ModuleBuilder&action=index&type=dropdowns
    Can anyone suggest a fix for FF so I can stop using horrible IE?
    Thanks in advance,
    Jo

    Just look a little lower on the left-hand side. It's under the "Links" category, just below "customer ratings" and "more from..."

  • Infopath 2010 - Drop down

    Requirement:
    1. There are 20 drop down fields in InfoPath, each fields having three values,
              Values: NA (Default), Yes , No
    2. Once the User selects the No options, Count should be displayed in One separate Field (Eg: If user selects 10 No option out of 20, Total
    Count should be 10).
    3. If User deselect the No option, Count should be reduce.
    4. Action needs to be Captured before save the item.
    Types of deselecting options:
    User can deselect the dropdown values  from No to Yes. Count should be reduce only once.
    User can deselect the dropdown values from No to Yes then Yes to NA. But Count should be reduce only once.
    Can anyone suggest the logic for this requirement, Thanks in Advance.

    Hi,
    create a  text boxes for calculations and do condition on each field based on the selected value, increment the value in the text box or decrement
    to put conditions
    http://blogs.msdn.com/b/infopath/archive/2006/11/27/conditional-default-values.aspx
    https://support.office.com/en-us/article/Add-rules-for-performing-other-actions-5322d726-b787-4e5f-8d37-ba6db68b451d
    https://social.msdn.microsoft.com/Forums/en-US/28325090-e64f-4e4f-9fd9-940de7a43a81/infopath-calculated-value?forum=sharepointcustomizationprevious
    http://walisystems.com/articles/sps/radiobtns/infopathradiobuttons.htm
    Kind Regards,
    John Naguib
    Senior Consultant
    John Naguib Blog
    John Naguib Twitter
    Please remember to mark this as answered if it helped you

  • How can I get my Bookmark drop down list back?

    I had to clear and restore my Macbook Pro and when I installed Firefox the drop down Bookmark menu is gone. I have the same version of Firefox on two computers and one has the drop down menu and this one doesn't. How do I get it back?

    Do you mean the star on the location/address bar to bookmark the current page?
    You can try to click the Restore Defaults button in the Customize palette.
    Make sure that toolbars like the "Bookmarks Toolbar" are visible.
    *"3-bar" Firefox menu button > Customize > Show/Hide Toolbars
    *View > Toolbars<br>Tap the Alt key or press F10 to show the Menu Bar
    *Right-click empty toolbar area
    Open the Customize window and set which toolbar items to display.
    *"3-bar" Firefox menu button > Customize
    *check that "Bookmarks Toolbar items" is on the Bookmarks Toolbar
    *if "Bookmarks Toolbar items" is not on the Bookmarks Toolbar then drag it back from the Customize palette into the Customize window to the Bookmarks Toolbar
    *if missing items are in the Customize palette then drag them back from the Customize window on the toolbar
    *if you do not see an item on a toolbar and in the Customize palette then click the Restore Defaults button to restore the default toolbar setup
    *https://support.mozilla.org/kb/customize-firefox-controls-buttons-and-toolbars

  • Drop down list populated with parent entity

    Hi,
    I am new with all these ADF in jdev. Let's say I have this model parent -> child. I created toplink mapping, ejb facade and adf data control.
    If I want to create a form for child with one drop down box will be parentId. How do I do that?
    Thank you

    Hi,
    if you use ADF, then you create a data control from the EJB session facade. This exposes the method to query all parents as well as the details. You drag and drop the result set of the details as a form. Then you remove the attribute for which you want to create a drp down list. Expand the detail result node and drag the attribute to the form. In teh opened context menu choose selectOne. In teh opened binding dialog, create a new list binding and choose the result set of the parent. Map the paren't PK to teh detail FK attribute and choose one or more display attributes
    otn.oracle.com/products/jdev has tutorials on this as well
    Frank

  • The microsoft on-screen keyboard doesn't work with firefox. I try to enter type and it jumps around the page. I can't select anything on drop down lists.

    I tend to use the on-screen keyboard. For about two months I've been unable to type text in firefox. I can't use dropdown boxes. I have to text to notepad then copy and paste it. I realize this is hardly a critical issue but I've loved using firefox for years and am considering going to another browser if I can't resolve this.

    '''''[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode Start Firefox in Safe Mode]'''''
    <BR>While you are in safe mode;<BR>
    '''''Firefox Options > Advanced > General'''''.<BR>
    Look for and turn off '''Use Hardware Acceleration'''.
    Restart FF. If there is still a problem, check '''caret browsing''' <F7>.
    It might have been turned on.

Maybe you are looking for