Combo box select default value.

Hi,
I am using Combo box to display the status of the document.
my code is
oForm = SBO_Application.Forms.Item("I8_BGU_")
                        Dim oCombo1 As SAPbouiCOM.ComboBox
                        oForm.DataSources.UserDataSources.Add("ComboSrc5", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1)
                        'oItem = oForm.Items.Item("21")  ''for accessing the combo box item
                        oCombo1 = oForm.Items.Item("21").Specific
                        '' to bind the combo box item to defined user data source
                        oCombo1.DataBind.SetBound(True, "", "ComboSrc5")
                        ''giving some static values to combobox
                        oCombo1.ValidValues.Add("Open", "Open")
                        oCombo1.ValidValues.Add("Closed", "Closed")
                        oCombo1.ValidValues.Add("Extended", "Extended")
                        ' oCombo.Select("Open")
                        oCombo1.Select("Open", SAPbouiCOM.BoSearchKey.psk_ByValue)
                        oForm.Items.Item("21").Specific.DataBInd.SetBound(True, "@I8_BGU", "U_STATUS")
                        oCombo1.Select("Open")
In this code when it reaches last lineof line it is throwing  error.
Object refertence not set to any instance..
some time it is throwing
error,,
" Unble to cast COM object sbouiCom.itemeventClas to Interface Type IItemevent. This application Cal is failed.
The same logic working form for another form..
Is there any modification needed.
Please.. get to me..
mahi.

Hi Mahendra,
In case of selecting a default value in a combo, it has 2 parameters to be passed.  Its as below.
objCombo.Select(0, SAPbouiCOM.BoSearchKey.psk_Index)
Replace this with proper value (1st parameter).  It will work.
I find that you have already used that line.  So you can remove your last line.
Best Regards,
satish. B.
Edited by: satish b on Jan 12, 2010 8:35 AM

Similar Messages

  • A text box should appear based on combo box selection in a jsp page.

    Hi,
    I have this problem. I ahve an option in the combo box"other". If other is selected then a text box shud appear . Can any one post a quick answer for me. may be a sample of how to do it will help me a lot.
    Thank You,
    Sagar.

    Hi Guys,
    Thnx all for ur replies. Let me explain u the scenario which i work in now. I have a combo box with 4 values "other " being the last of them. If i select "other" then a text box shud appear with the label. what happenes now is i have added onChange whn an option is changed . I have named that functiion refresh for which the code goes like this..
    function refresh()
    window.location.reload(true);
    whn i select an other option thn the whole page gets refreshed and the first value only appears. If i select other then the page refreshes and gets back again to the first value. These guys here use tags like <c: if> <C;choose> <c: otherwise> which am not familiar with. Do pls help me in retaining the option selected.. Thank You.

  • Regarding  input combo box list of values

    Hi,
    I am using JDev 11.1.1.5.0
    I used the input combo box list of values in adf application based on VO.When I type a value in the input combo box and press TAB key,it gives first item of that list rather than that entered value and when I open the list, it shows the repeating values of the first item.
    Please suggest me some solutions.

    Hi,
    hard to say based on your description. Try with 11.1.1.6 or 11.1.17 and if it reproduces, provide a test case based on the HR schema. Is that an option ? Then send it my way in a zip file renamed to "unzip". My mail address is in my OTN profile, just follow the named link left to this reply
    Frank

  • Combo box selected index is not working.

    Hi guys, I have a problem with changing the combo box selected index.
    I load a list of phone types(such as "Home","Office",...) using Remote Object and assign it as a data provider for a combo box.What I need is to select a specific index in the combo but combo.selectedIndex statement doesn't work for the first time, I mean the combo changes its index only if I load the view again.
    I checked different examples, solutions but none of them worked for me!! Can anyone here help me to figure out the problem?
    Here is my Code:
    <mx:Canvas creationComplete="init()"
                 xmlns:mx="http://www.adobe.com/2006/mxml">
         <mx:ComboBox id="comboPhone0"
                    prompt="Type"
                    dataProvider="{phoneTypeList}"
                    />
    <mx:Script>
         <![CDATA[
    [Bindable]
    private var phoneTypeList:ArrayCollection;
    private function init():void
         loadPhoneType();
    private function loadPhoneType():void
         phoneTypeLoaderService.getPhoneType(); //phoneTypeLoaderService is a remote Object to load the phone types
    private function handlephoneTypeLoadResult(ev:ResultEvent):void
         phoneTypeList=ev.result as ArrayCollection;
            comboPhone.selectedIndex = getComboSelectedIndex("HOME");
    private function getComboSelectedIndex(phoneType:String):int
    var index : int= -1;
    var result : int= -1;
         for each (var pt:PhoneType in phoneTypeList)
              if (pt.type == phoneType)
                        result = index;
                        break;
              else{
                   index++;
              return result;
         ]]>
         </mx:Script>
    </mx:Canvas>

    hi
    I think in getComboSelectedIndex() method index should initialized to zero. If that does not work use after assigning the data from result event.
    phoneTypeList.refresh();
    Hope this helps
    Rush-me

  • VideoFormatChooser - Frame rate combo box show: default

    In my applicatio, VideoFormatChooser - Frame rate combo box show: < default > but in JMStudio, I have a list of available frame rates... know why ?
    [EDIT]
    I does that for testing:
    Format[] formats = videoVector.elementAt(i).getFormats();
    for(Format f : formats){
    if(f instanceof RGBFormat)
    RGBFormat rgbFormat = (RGBFormat) f;
    String size = rgbFormat.getSize().toString();
    comboVideoFormat.addItem("RGB: FrameRate= "+rgbFormat.getFrameRate()+" Size= "+size);
    else if(f instanceof YUVFormat)
    YUVFormat yuvFormat = (YUVFormat) f;
    String size = yuvFormat.getSize().toString();
    comboVideoFormat.addItem("YUV: FrameRate= "+yuvFormat.getFrameRate()+" Size= "+size);
    and getFrameRate always return -1 wich must be Default... where JMStudio find my camera Frame Rates ??
    Thanks
    Edited by: Grattier on Oct 24, 2007 9:49 AM

    Pete:
    I have not had this issue with combo boxes. Could post the code you use to construct and add your combo box to the frame?

  • Populate 2nd combo box based on value selected in 1st combo box

    I am still using Acrobat 6 though I may be upgrading soon to Acrobat 8. I have a form with two combo boxes, the first "state" has values of MN and WI. Based on which value the user picks I would like to populate a "county" combo box with lists of counties that we deal with.
    Thanks,
    Gene

    One can set the option and export value using an arry:<br /><br />// document level script<br />// Master List of Lists <br />// Each entry in this object listeral is the name of a State <br />//Manually enter the State Names into the state field combo box <br />// The associated value is the item list, where each item is a name value pair, [<County> and [county code, zip code]] <br /><br />// state: ["county name", ["county code", "zip code"]]<br />var oStateNames = {MN: [["-", ["", ""] ], <br />                       ["St. Louis", ["MNStl", "55001"] ], <br />                       ["Carlton", ["MNSCrl", "55002"] ], <br />                       ["Pine", ["MNPin", "55003"] ],<br />                       ["Cook", ["MNCok", "55004"] ] <br />                       ], <br />                   WI: [["-", [" ", " "] ],<br />                        ["Douglas", ["WIDou", "55005"] ] ,<br />                        ["Bayfield", ["WIBay", "55006"] ],<br />                        ["Burnette", ["WIBur", "55007"] ],<br />                        ["Ashland", ["WIAsh", "55008"] ]<br />                       ]<br />                     }; <br /><br />//SetCountyEntries() on keystroke entry in state field <br />function SetCountyEntries() <br />{ <br />   if(event.willCommit) <br />   { <br />      // Get the new counties list from the Master List <br />      // Since the selection is being committed, <br />      // event.value contains the State name <br />      var lst = oStateNames[event.value]; <br />      // Clear the county list if there are no counties for the selected state <br />      this.getField("ee.address.county").clearItems();<br />      this.resetForm(["ee.address.code", "ee.address.zip"]);<br />      if( (lst != null) && (lst.length > 0) )<br />           this.getField("ee.address.county").setItems(lst); // set opiton and export value<br />   } <br />} <br />//  end document level script<br /><br />For the combo box "ee.address.county" one can create an array from the export value to populate the county code and zip code<br /><br />// custom keystroke for county combo box<br />if(event.willCommit & event.value != "") {<br />// split county and zip codes<br />var aCodes = this.getField(event.target.name).value.split(",");<br />this.getField("ee.address.code").value = aCodes[0];<br />this.getField("ee.address.zip").value = aCodes[1];<br />}<br />// end custom key stroke code

  • I need a combo box with 4 values to choose from which will populate a text box on the form with text related to each combo box selection

    For example:
    Combo box choices:
    apple
    tomato
    squash
    Pumpkin
    The text box depending on the selection above would state the color:
    Green        (if Apple was chosen from the combo box
    Red           (if Tomato was chosen from the combo box
    Yellow       (if Squash was chosen from the combo box
    Orange      (if Pumpkin was chosen from the combo box
    I am very new at this and have spent hours looking for an answer.  Thank to anyone in advance who can help!

    Place each value as the export value of the options in the combo-box and then use this code as the text field's custom calculation script:
    event.value = this.getField("ComboBox Name").value;

  • Combo Box Selected Data

    I have a combo box called class_cb, I am trying to use the
    combo box in a maths formula.
    I am trying to set that if the active selected combo box data
    = 1 then a text area = given number, if data = 2 then ....
    I can get flash to recognise the change i just can't seem to
    get the statement
    "if selected combo box data = 1 then text area = 5" to work,
    the text area defaults to the first value and changing the
    combo box item and pressing calculate doesn't change the
    value of the text box.
    Any help would be appreciated, thanks
    // COMBO BOX
    // Add Items to List.
    class_cb.addItem({data:1, label:"Normal"});
    class_cb.addItem({data:2, label:"Free"});
    class_cb.addItem({data:3, label:"Close & Interference"});
    // Update Upon Change Listener Object
    // Create Listener Object.
    var cbListener:Object = new Object();
    // Assign function to Listener Object.
    cbListener.change = function(event_obj:Object) {
    trace("Value changed to:
    "+event_obj.target.selectedItem.data);
    // Add Listener.
    class_cb.addEventListener("change", cbListener);
    // CALCULATE
    shaft_ta.text = "nul";
    //On calculate_btn release
    //Math functions
    calculate_btn.onRelease = function(){
    //If combo box = data no. then change label
    if (class_cb.selectedItem.data = 1) {
    shaft_ta.text = "6";
    } else {
    if (class_cb.target.selectedItem.data = 2){
    shaft_ta.text = "7";
    } else {
    if (class_cb.selectedItem.data = 3){
    shaft_ta.text = "9";
    }

    can any one help?, I have tried many different things and
    still can't get it to work.

  • Layer/OCG Visibility based on Combo Box Selection

    Hello,
    I'm VERY new to javascript, so please bear with me.  I have a combo box with multiple selections.  For some selections, I would like a separate OCG layer to appear, and with other selections that same layer to disappear.
    For example:
    ComboBox1: A, B, C
    Layer 1 default: hidden
    A - toggle layer 1: hidden
    B - toggle layer 2: hidden
    C - toggle layer 3: visible
    I have seen the javascripting involved turning layers on/off with buttons, but I'm having some difficultly with the combo box. 
    Thanks!
    Mike

    The code would be much the same as with buttons. Use the Validate event of the combo box to get the selected value (event.value) and show/hide the appropriate OCGs. If the combo box items have export values, you'd use the Keystroke event so you can get the export value of the selected item via the event.changeEx property: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.607.html

  • Show text box from one combo box selection

    Total newb here and need help.  I tried searching for a javascript to copy/paste, but without any luck.  I am using Acrobat Pro 9.2.0.  If you could help me out with the javascript or with directions on how to make the following be accomplished, I would be greatly appreciative.
    I am creating a fillable PDF and currently have a combo box that is labeled "Internship Satisfied By" with the options of "TCoB PDP", "MRKTNG 4185", and "Other College".  I would like a hidden text box (where the end user can fill in to explain) to become visible only when the end user selects the "Other College" option, but stay hidden for the other selections.  The hidden text box is labeled "Internship Explained".
    Thanks in advance! Jarrod

    Use this code as the combo box's validation script:
    if (event.value == "Other College") {
    getField("Internship Explained").display = display.visible;
    } else {
    getField("Internship Explained").display = display.hidden;

  • Access 2010 - How to display data from a table into a text box upon combo box selection?

    Hi
    I have a a table with 5 columns: month, year, USD, SGD, BAHT.
    I created a form with a combo box for selection of the month and year, and I would like to set adjacent text boxes to show USD, SGD, BAHT information. How can i go about doing that?
    From the Q&A here, most of them uses the function similar to this "=[Combo0].[Column](1)" to show the data in the text box, but this would require the combo box to list a whole bunch of details if i were to add in more currency values to the
    table. Is it possible to not show this information in the combo box, but still populate data in the textboxes base on a selection on only the "month" and "year" in the combo box.

    Hi,
    According to your description, my understanding is that you want to show only the month/year in the combo box, we can choose the date, and it will display the value of USD/SGD/BAHT based on the month/year.
    If it is, I recommend you try the steps:
    Create a form based on your data source table>Add the combo box>combo box wizard>Find a record on my form based on the value I selected my combo box>Add mouth and year to selected fields
    http://office.microsoft.com/en-us/access-help/create-a-list-of-choices-by-using-a-list-box-or-combo-box-HA010113052.aspx
    If I misunderstand something, please let me know. We may upload some screenshots or a sample through OneDrive.
    Regards,
    George Zhao
    TechNet Community Support

  • Combo Box Selection to Change Selection in another Combo Box

    I'm pretty familiar with excel and VBA, but when it comes to Adobe Acrobat, I am lost with Javascript.
    I am creating a form.
    My first field is a combo box named: Rent.booth
    My second field is also a combo box named: County.booth
    I need to know where and how I would implement a java command that states that if Rent.booth = Rent, then County.booth automatically = No.
    If No is selected for Rent.booth, then allow the user to choose any of the 3 values.
    Combo Box Options for Rent.booth:
    Select One
    Rent
    No
    Combo Box Options for County.booth:
    Select One
    Yes
    No
    Any leads would be appreciated.  So far I've only seen the Combo Box to Text box solutions, nothing for Combo box to Combo Box.

    You'll get the best help with Javascript in the Acrobat Scripting forum.

  • Changing xy graph scale using combo box selection

    Hello,
    I have a xy graph with x scale set to 10k and y scale set to 6 by default.
    I have a combo box which i use to select what the graph will display. For example in combo box i have 3 choices, A, B, C.
    If i select A, xy scale is set to 10k and 6. If i select B, xy scale is set to 2.5k and 8, if i select C, xy scale is set to 4k and 10 respectively. Is there some functions that i can use to do this?
    Thanks.
    Solved!
    Go to Solution.

    Like this (attached)?
    Of course, if the data actually follows these mins and maxes, you could just turn on auto scaling and it would do it automatically
    Tim Elsey
    LabVIEW 2010, 2012
    Certified LabVIEW Architect
    Attachments:
    Untitled 1.vi ‏14 KB

  • Combo Box Selection Issue in SBO 2007

    Hello.
    Here is one issue which I am facing now.
    I have just installed the 2007 Version of SBO in my machine. And using VB.Net.
    When I tried to retrieve the <i>Selected.Value</i> from a ComboBox, it is returning a wrong value.
    The real problem is this.
    Suppose there is two ValidValues in the Combo box
    1. <b>aaa</b>
    2. <b>bbb</b>
    and suppose we manually selected the value '<b>aaa</b>' in it.
    Then the combobox will show '<b>aaa</b>' as selected value.
    When we try to return it using the <i>Selected.Value</i> property, it returns <b>aaa</b>.
    then I tried to select '<b>bbb</b>' using a code which is here
    <i>oCombo.Select("bbb",SAPBouicom.BoSearchKey.psk_ByValue)</i>
    Now the combobox will show '<b>bbb</b>' as selected value. But,
    When we try to return it using <i>Selected.Value</i> property, It still returns <b>aaa</b>.
    If we select <b>bbb</b> manually, it will return <b>bbb</b>.
    IT ALWAYS RETURNS THE LAST MANUALLY SELECTED VALUE.
    here is the original Code which I tried in my application.
    <i>cboCategory.Select(CWRptMaint.ReportCategory, SAPbouiCOM.BoSearchKey.psk_ByValue)
    Dim s As String = cboCategory.Selected.Value
    Dim t As String = cboCategory.Selected.Description
    </i>
    Please Help me to solve this issue.
    Thank you
    Anoop

    HI
    I never had a problem about combobox not using datasource
    But here's the example code about combobox using datasource and not using datasource that i'm taken from one of my friend's project (VB6)
    '================================================================
    Public Type objectReportBA
        oComboBox As SAPbouiCOM.ComboBox
        oComboBox2 As SAPbouiCOM.ComboBox
        oUserDataSource As SAPbouiCOM.UserDataSource
    End Type
    Public oRBA As objectReportBA
    '==================================================================
        '// example Adding a Combo Box item not using user data source
        Set oItem = oFormReportBA.Items.Add("RCB1", it_COMBO_BOX)
        oItem.Left = 70
        oItem.Width = 85
        oItem.Top = 4
        oItem.Height = 18
        oItem.DisplayDesc = True
        Set oRBA.oComboBox = oItem.Specific
        oRBA.oComboBox.ValidValues.Add "1", "aaa"
        oRBA.oComboBox.ValidValues.Add "2", "bbb"
        oRBA.oComboBox.Select "bbb", psk_ByValue
        SBO_Application.MessageBox "Combo1->" & oRBA.oComboBox.Selected.Value       '<<<< will get a value = 2
        SBO_Application.MessageBox "Combo1->" & oRBA.oComboBox.Selected.Description '<<<< will get a description = bbb
    '==================================================================
        '// example Adding another Combo Box item and using datasource
        Set oItem = oFormReportBA.Items.Add("RCB2", it_COMBO_BOX)
        oItem.Left = 157
        oItem.Width = 163
        oItem.Top = 24
        oItem.Height = 14
        oItem.DisplayDesc = True
        Set oRBA.oComboBox2 = oItem.Specific
        oRBA.oComboBox2.ValidValues.Add "1", "aaa"
        oRBA.oComboBox2.ValidValues.Add "2", "bbb"
        oFormReportBA.DataSources.UserDataSources.Add "CombSource", dt_LONG_TEXT, 30
        oRBA.oComboBox2.DataBind.SetBound True, "", "CombSource"
        Set oRBA.oUserDataSource = oFormReportBA.DataSources.UserDataSources.Item("CombSource")
        oRBA.oUserDataSource.Value = "bbb"
        SBO_Application.MessageBox "Combo2->" & oRBA.oUserDataSource.Value  '<<< will get a value = bbb (but u will get diferent value if u click the combobox manually)
    '======================================================================
    'if you click the combobox manually using itemEvent
    Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, pVal As SAPbouiCOM.IItemEvent, BubbleEvent As Boolean)
         Select Case pVal.ItemUID      
              Case "RCB1": '//combobox object not using datasource
                        If pVal.EventType = et_COMBO_SELECT Then
                            If pVal.BeforeAction = False Then
                                SBO_Application.MessageBox "combo1->" & oRBA.oComboBox.Selected.Description  '<<<< will get a description = aaa or bbb
                            End If
                        End If
              Case "RCB2": '//Combobox object that using datasource
                        If pVal.EventType = et_COMBO_SELECT Then
                            If pVal.BeforeAction = False Then
                                SBO_Application.MessageBox "combo2->" & oRBA.oUserDataSource.Value            '<<<< will get a descriptian = 1 or 2
                                SBO_Application.MessageBox "combo2->" & oRBA.oComboBox2.Selected.Description '<<<< will get a description = aaa or bbb
                            End If
                        End If
         end select
    end sub
    '===============================================================
    Hopefully this will Help You Anoop
    Regards
    Ancumen

  • Netui:select default value on top instead of bottom

    Is there anyway that I can change the netui:select tag to show the default value
    on the top of the list instead of the bottom?
    thanks
    kunal

    Kunal--
    If you are binding to a data set (a LinkedHashMap, for example), you can insert the default value
    into the data set in code in the JPF before binding to the select box, but it's not configurable
    when simply setting the defaultValue attribute.
    Apologies for the limitation.
    Eddie
    Kunal Mittal wrote:
    Is there anyway that I can change the netui:select tag to show the default value
    on the top of the list instead of the bottom?
    thanks
    kunal

Maybe you are looking for

  • RAID 0s no longer appear

    Hi. I have a strange problem that seems too unlikely to be pure coincidence. I have two double disk external enclosures connected via firewire, each set up as a software RAID 0 from disk utility. I keep one as a backup of the other. The other day, BO

  • Writing a text file in Application layer (through AL11) via a batch program

    Hi , I want to write a text doc everytime a batch(background) program is run in al11 in the specified directory. It is working fine in development server. But when itransported it into quality , its working  some times and many times its not working 

  • Directory listing from a JAR file

    Hi, I want to know how i can get a list of files in a certain directory located inside a jar file. Thanks

  • Remote Install Snow leopard to macbook pro from windows xp using airport??

    I have a problem... I finally bought my snow leopard, but I can not install it because my cd drive broke. so... I have a PC with XP on it, so I am trying to remote install it... I rebooted my mac and held the "Option" key and a list of one disk "Mach

  • OBIEE Clustering in AIX server

    Hi Obiee Experts, I am going to implement OBIEE Clustering, I need your help friends. what are the requirements needed in this configuration. I have two servers in our development,I have installed obiee 10.1.3.4.1 (Basic Version). This is first time