"Define New" in Combo Box

Hello,
I would like to implement the "define new" feature for combo boxes that I am using in my UDO, as it is for some of the combo boxes of SAP. I have noticed that when I add a linked table to my user defined field, this option doesn't appear in the UDO forms, so I believe it must be implemented by code. How can this be done?
Thanks.
Ralph

Hi.
I haven`t try this, but mayby You can make Value in combo with  description "Define new", and if this value is set, open form whith You want ?
This is my sugestion.
Hope it helps.
Regards
Kamil Wydra
I found that this topic was answered in the past.
Here:
SAP Business One SDK
Message was edited by: Kamil Wydra

Similar Messages

  • Hai , How to create 'Define New ' ?

    hai,
    How to create 'Define New ' in Combo box and then Enter the value in the user defined table how to get the value  from the database table and display combo box ?

    Hi.
    I used this example for the matrix column. It's work and open a form for defining new values.
    Your need to add an event to refresh values in combobox.
    Think I help you.
    Best regards
    Sierdna S.
    P.S. How to proceed.
    1) Fill the combobox with valid values:
    Try
      ' Add first value to combobox
      oCombo.ValidValues.Add("", "")
      Dim oRS As SAPbobsCOM.Recordset
      oRS = SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
      Dim sSql As String = "SELECT Code, Name FROM [@" & sLinkedTable & "]"
      oRS.DoQuery(sSql)
      oRS.MoveFirst()
      While oRS.EoF = False
          oCombo.ValidValues.Add(oRS.Fields.Item("Code").Value, oRS.Fields.Item("Name").Value)
          oRS.MoveNext()
      End While
      ' Last value
      oCombo.ValidValues.Add("Define","Define")
      If Not oRS Is Nothing Then
          System.Runtime.InteropServices.Marshal.ReleaseComObject(oRS)
          oRS = Nothing
      End If
      System.GC.Collect() 'Release the handle to the table
    Catch ex As Exception
      ' log exception
    Finally
      oCombo = Nothing
    End Try
    2) In Item event handler
    If pVal.EventType = SAPbouiCOM.BoEventTypes.et_COMBO_SELECT _
    And pVal.FormUID = sFormUID _
    And pVal.ItemUID = sMatrixUID _
    And pVal.ColUID = sColUID _
    And pVal.BeforeAction = False _
    And pVal.ItemChanged = True _
    Then
      Try
        Dim oMatrix As SAPbouiCOM.Matrix
        oMatrix = oForm.Items.Item(MatrixID).Specific
        If oMatrix Is Nothing Then Throw New Exception("ERROR: matrix object is nothing"))
        Try
          Dim oCombo As SAPbouiCOM.ComboBox
          Dim sValue As String = ""
          oCombo = oMatrix.Columns.Item(sColUID).Cells.Item(pVal.Row).Specific
          sValue = oCombo.Selected.Value
          If sValue.Equals("Define") Then
            Try
                oCombo.Select(0, SAPbouiCOM.BoSearchKey.psk_Index)
                oForm.Refresh()
            Catch ex As Exception
            ' log exception
            End Try
            SBO_Application.Menus.Item("<menu id to activate>").Activate()
          End If
          BubbleEvent = False
        Catch ex1 As Exception
          ' log exception
        End Try
      Catch ex As Exception
        ' log exception
      End Try
    End If

  • Combo box entries not refreshing as per new data

    Hi,
    I am using Oracle SOA PS3 version.
    I have created an Updating ordered List report on a DataObject. I created a filter on a field 'NAME' and made that filter associated that to a prompt. The prompt is visible as a drop down on top of a report.
    Before I open the report there is no data in DataObject and the combo box does not show any options. But after the report is opened data comes into the dataObject and the rows appear in report also. But when I try to see the entries in the combo box, I dont see anything there.
    The entries in combo box are not getting refreshed dynamically as per the newly arriving data. Any idea of how to get this done .. ?
    Any Information on this will be helpful.
    Thanks,
    Raj Kumar

    Hi,
    Do the below checks,
    1) Check if you have maintained correct Key values where the data is stored in your report.
    2) Check if you have data for the specific combination of dimension members using EVGET function
    3) Check if the data is there in the backend for the specific combination of dimension members using the transaction RSA1
    4) Create new Report of that type and check if the data is flowing.
    Hope this helps,
    Regards,
    G.Vijaya Kumar

  • New to Java - Combo Box

    I have a Application using swing, I have a combo box with a collection of flex codes. The problem that I'm having is that system titles can have more than one flex codes. What I'm trying to do if a system title have more than one flex codes I like for the system title to be list twice with the flex code.
    For example:
              SYSTEM TITLE      FLEX CODE
    First Row     9MH16R12     9001
    Second Row     9MH16R12     9002
    The flex code are set up in combo box to allowed the user to change the flex code.
    Here is some of the code that I have written:
    public class FlexCellEditor extends DefaultCellEditor implements TableCellEditor
    public FlexCellEditor()
    super(new JComboBox());
    public Component getTableCellEditorComponent(JTable aTable, Object obj, boolean flag, int aRow, int aColumn)
    JComboBox vComboBox = (JComboBox) super.getComponent();
    SystemTitle vSystemTitle = aRow >= 0 ? model.getSystemTitle(aRow) : null;
    Collection<FlexCode> vSelected = vSystemTitle != null ? vSystemTitle.getFlexCodes() : null;
    DefaultComboBoxModel vComboMode = (DefaultComboBoxModel) vComboBox.getModel();
    vComboMode.removeAllElements();
    int vSelectedIndex = -1;
    if (vSystemTitle != null)
    for (FlexCode vFlexCode : vSystemTitle.getFlexCodes())
    vComboMode.addElement(vFlexCode);
    if (vFlexCode.equals(vSelected))
    vSelectedIndex = vComboMode.getSize() - 1;
    vComboBox.setSelectedIndex(vSelectedIndex);
    return vComboBox;
    }

    Just to provide a completely different approach:
    Instead of converting to an object array, then passing that into the combo box, you can take advantage of the MVC nature of swing (I'm assuming you are using a JComboBox):
    public class ArrayListComboBoxModel extends AbstractListModel{
      ArrayList myList;
      public ArrayListComboBoxModel(ArrayList l)
        myList = l;
      public Object getElementAt(int index) {
          return myList.get(index);
      public int getSize() {
          return myList.size();
    }Then create your JComboBox as follows:
    JComboBox box = new JComboBox(new ArrayListComboBoxModel(anArrayList));Nifty!
    - K

  • Combo define new

    in the system forms there are combobexes that have a option define new. when i select define new a new form iti is open and i can define some new values for the combo. does any one know how to do this on a user define form.
    I have a form build in screen painter, i have added Define New option to the combobox on my form. i want when i select new to can define a new transaction code (from OTRC table).

    Hi,
    In the procedure where you are handling the events, on the combo select event, check if the item selected is New. If yes, enable the menu code for the form, which you want to open. and than perform a click on the add button for that form.
    Rahul

  • Entity Descriptions are not displayed correctly in Combo box dropdown list

    In Web Analysis, Entity Descriptions are not displayed correctly in Combo box dropdown list when entity descriptions from HFM contains a dot(.)
    Example:
    'Entity A. LTD' becomes 'LTD'
    'Entity B Inc.' becomes blank
    It seems that everything before the dot is not displayed when opening the combobox.
    It looks like it is acting like the option to show short description for entities in HR where the parent-child relation is not shown. This behaviour I don't expect for descriptions. And in my opinion is not an option in Web Analysis.
    Does anybody knows the sollution or have seen this issue before?

    Hi,
    This is a known issue with combo box list of values.
    Please follow this workaround:
    - Remove ComboboxLOV on Deptno
    - Create an updateable transient attribute(Say Dname) of type String
    - Define combobox lov with following values:
    List Data Source: DeptView1
    List Attribute: Dname
    List Return Values:
    Dname - Dname
    Deptno - Deptno
    UI Hints: Display Attribute - Dname
    - Edit Dname(transient attribute) and provide following groovy expression
    oracle.jbo.Key key = new oracle.jbo.Key(Deptno);
    return DeptView1.findByKey(key, 1)[0].getAttribute("Dname");- Now, you are done and observe that Dname combo box lov shows Description even on selection and change in this combo box sets the Deptno value
    Sireesha

  • Combo Box items missing

    Hi,
    I'm new to ADF and have a few basic questions.
    1)From a View Object in the Data Control Palette I dragged and dropped an attribute as Combo Box. When I run the panel no items are shown, although data is available at the database. I actually expected that ADF handels the item adding in a combo box. Is some coding really needed or what is the standard way of doing that?
    2) How can one handle dynamic displaying in combo boxes (one item selected in one box defines the items of the next one).
    Thanks.

    Hello Frank,
    thank you for your replay. Problem 1) is solved, I just had to pick the View Object and drop it as a combo box instead of the attribute itself.
    Regarding 2) I did it as follows:
    - In a JClient application I created Entity Object from two tables with 1:n relationship
    - Generated views from these EO's
    - Added those vews to my application module
    - Dragged and droppped both views in a JPanel as combo boxes
    Now what has to be reached is that by selecting one item from the first (master) combo box the items shown on the following one are only those that correspond to the Foreign Key relation.
    Thanks again
    Jan

  • Setting value in input combo box list of values programmatically.

    Hi,
    I have the following requirement.
    I have a combo box LOV defined in the column of application table. Whenever the user is trying to change this value, I need to check for a condition and invoke a warning popup with yes/no button and allow the user to change if dialog outcome is 'yes'. If the outcome is 'No', then i need to reset the combo box to its original value. To do this, in the valuechangelistener of LOV, I am invoking the warning popup and control will coming out of the valuechangelistener and dialog listener will be called.
    How do i set the combo box value in dialog listener ? and How do I retain the existing value of the LOV if user clicks on 'No' button.
    Jdev Version : Build JDEVADF_11.1.1.7.0_GENERIC_130226.1400.6493
    Thanks in advance.
    Harish

    You could, for example. store both of them (old value, along with new one) in the pageFlowScope. You can do that in the valueChangeListener (before calling popup), and use them in the dialog listener...

  • Combo boxes

    hi!
    Is it possible to force a combo box to accept only the values of
    the list? Now I can type whatever I want in the field, nothing
    happens, only when I commit the changes it doesn't work, because
    it is no value from the list; but maybe some user will try to
    type in new values and wonder why it doesnn't work.
    any ideas?
    null

    Michaela (guest) wrote:
    : hi!
    : Is it possible to force a combo box to accept only the values
    of
    : the list? Now I can type whatever I want in the field, nothing
    : happens, only when I commit the changes it doesn't work,
    because
    : it is no value from the list; but maybe some user will try to
    : type in new values and wonder why it doesnn't work.
    : any ideas?
    If you use "Poplist" instead of "Combo Box", the "Listitem"
    will only accept the defined elements. This is a property
    under the "Functional" group of this type of item. The
    "Poplist" will also have the auto-expand feature for the first
    character of each value.
    Gruss.
    null

  • Define new

    Hi.
    When i click Define New in the combo box the datas that i enter should be displayed in the combo.but it is not displayed.how to do it

    Hi try this one
    CREATE FORM SUB
    Public Sub CreateForm(...)
      If oMatrix.RowCount > 0 Then
        Call InitializeMatrixCombo(oForm, _
                                   MatrixID, _
                                   "DSU_Linked", _  ' Combobox Column
                                   "@LINKED_TABLE", _
                                   "<Default_Value>" _
      End If
    End Sub
    InitComboBox sub when we initializing combobox to combobox values we add also 2 new values:
    - "","" : NULL value, if database column accept null value
    - "Redefine","Redefine" : When selected with ItemEvent we activating menu with form uid where are we can define new values.
    Public Sub InitializeMatrixCombo( _
        ByRef oForm As SAPbouiCOM.Form, _
        ByVal sMatrixID As String, _
        ByVal sComboColumnName As String, _
        ByVal sLinkedTable As String, _
        Optional ByVal sDefaultValue As String = "" _
      Try
        oForm.Freeze(True)
        If SBO_Company.Connect Then
          ' Matrix
          Dim oMatrix As SAPbouiCOM.Matrix
          oMatrix = oForm.Items.Item(sMatrixID).Specific
          If oMatrix Is Nothing Then Throw New Exception("ERROR: matrix object is nothing"))
          ' Matrix column
          Dim oColumn As SAPbouiCOM.Column
          oColumn = oMatrix.Columns.Item(sComboColumnName)
          ' Matrix column cell
          Dim oCell As SAPbouiCOM.Cell
          oCell = oColumn.Cells.Item(oMatrix.VisualRowCount)
          ' Matrix column cell combo
          Dim oCombo As SAPbouiCOM.ComboBox
          oCombo = oCell.Specific
          If ClearCombo(oCombo) Then
            Try
              ' Add 1-st value if database field accept NULL
              oCombo.ValidValues.Add("", "")
              Dim oRS As SAPbobsCOM.Recordset
              oRS = SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
              Dim sSql As String = "SELECT Code, Name FROM [@" & sLinkedTable & "] ORDER BY 1"
              oRS.DoQuery(sSql)
              oRS.MoveFirst()
              While oRS.EoF = False
                oCombo.ValidValues.Add(oRS.Fields.Item("Code").Value, _
                oRS.Fields.Item("Name").Value)
                oRS.MoveNext()
              End While
              ' Add DEFINE NEW value +++++++++++++++++++++++++++++++
              ' Note: Code can have length up to 8 caracters
              oCombo.ValidValues.Add("Redefine", "Redefine")
              If Not oRS Is Nothing Then
                System.Runtime.InteropServices.Marshal.ReleaseComObject(oRS)
                oRS = Nothing
              End If
              System.GC.Collect() 'Release the handle to the table
              ' Select dafault value if not null
              If Not sDefaultValue.Equals("") Then
                If oCombo.ValidValues.Count > 0 Then
                  oCombo.Select(sDefaultValue, SAPbouiCOM.BoSearchKey.psk_ByValue)
                End If
              Else
                If oCombo.ValidValues.Count >= 1 Then
                  oCombo.Select(0, SAPbouiCOM.BoSearchKey.psk_Index)
                End If
              End If
            Catch ex As Exception
              ' log exception
            Finally
              oCombo = Nothing
              oCell = Nothing
              oColumn = Nothing
              oMatrix = Nothing
            End Try
          End If
        End If
      Catch ex As Exception
        ' log exception
      Finally
        oForm.Freeze(False)
        System.GC.Collect() 'Release the handle to the table
      End Try
    End Sub
    Item Event to handle selection of "Redefine" voice in combobox.
    Private Sub SBO_Application_ItemEvent( _
          ByVal FormUID As String, _
          ByRef pVal As SAPbouiCOM.ItemEvent, _
          ByRef BubbleEvent As Boolean _
    ) Handles SBO_Application.ItemEvent
      Dim oForm As SAPbouiCOM.Form
      oForm = SBO_Application.Forms.Item(FormUID)
      If pVal.EventType = SAPbouiCOM.BoEventTypes.et_COMBO_SELECT _
      And pVal.FormUID = sgloFormUID _
      And pVal.ItemUID = MatrixID _
      And pVal.ColUID = "DSU_Linked" _
      And pVal.BeforeAction = False _
      And pVal.ItemChanged = True _
      Then
        Try
          Dim oMatrix As SAPbouiCOM.Matrix
          oMatrix = oForm.Items.Item(MatrixID).Specific
          If oMatrix Is Nothing Then Throw New Exception("ERROR: matrix object is nothing")
          Try
            Dim oCombo As SAPbouiCOM.ComboBox
            Dim sValue As String = ""
            oCombo = oMatrix.Columns.Item("DSU_Linked").Cells.Item(pVal.Row).Specific
            sValue = oCombo.Selected.Value
            If sValue.Equals("Redefine") Then
              Try
                oCombo.Select(0, SAPbouiCOM.BoSearchKey.psk_Index)
                oForm.Refresh()
              Catch ex As Exception
               ' log exception
              End Try
              ' +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
              ' Here place your menu uid to call the form for adding new value
              ' +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
              SBO_Application.Menus.Item("51207").Activate()
            End If
            BubbleEvent = False
          Catch ex1 As Exception
            ' log exception
          End Try
        Catch ex As Exception
          ' log exception
        End Try
      End If
      ' Other events +++
    End Sub

  • How to create define new?

    i have taken combo box in form . i want to select  define new option in combo box.
    is it possible....?

    Imports SAPbobsCOM
    Imports SAPbouiCOM
    Public Class Class1
        '// At the begining of every UI API project we should first
        '// establish connection with a running SBO application.
        Private WithEvents SBO_Application As SAPbouiCOM.Application
        Private oForm As SAPbouiCOM.Form
        Dim oButton As SAPbouiCOM.Button
        Dim oOptionBtn As SAPbouiCOM.OptionBtn
        Dim oCheckBox As SAPbouiCOM.CheckBox
        Dim oComboBox As SAPbouiCOM.ComboBox
        Dim oItem As SAPbouiCOM.Item
        Dim oStatic As SAPbouiCOM.StaticText
        Dim oEdittext As SAPbouiCOM.EditText
        Dim oEditItem As SAPbouiCOM.EditText
        Dim oFolder As SAPbouiCOM.Folder
        Private oMatrix As SAPbouiCOM.Matrix
        Private Matrix2 As SAPbouiCOM.Matrix
        Private oLink As SAPbouiCOM.LinkedButton
        Private oColumns As SAPbouiCOM.Columns
        Private oColumn As SAPbouiCOM.Column
        Private sPath As String
        Private oDBDataSource As SAPbouiCOM.DBDataSource
        Private oCompany As SAPbobsCOM.Company
        Private rs As SAPbobsCOM.Recordset
        Private oLineRec As SAPbobsCOM.Recordset
        Private rs1 As SAPbobsCOM.Recordset
        '// declaring a User data source for the "Remarks" Column
        Private oUserDataSource As SAPbouiCOM.UserDataSource
        Public sErrMsg As String
        Public lErrCode As Long
        Public lRetCode As Long
        Private Sub SetApplication()
            '// Use an SboGuiApi object to establish connection
            '// with the SAP Business One application and return an
            '// initialized appliction object
            Dim SboGuiApi As SAPbouiCOM.SboGuiApi
            Dim sConnectionString As String
            SboGuiApi = New SAPbouiCOM.SboGuiApi
            '// by following the steps specified above, the following
            '// statment should be suficient for either development or run mode
            'sConnectionString = Environment.GetCommandLineArgs.GetValue(1)
            sConnectionString = "0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056" 'Environment.GetCommandLineArgs.GetValue(1)'
            Try
                SboGuiApi.Connect(sConnectionString)
                '// connect to a running SBO Application
                '// get an initialized application object
                SBO_Application = SboGuiApi.GetApplication()
            Catch ex As Exception
                MsgBox("Make Sure That SAP Business One Application is running!!! ", MsgBoxStyle.Information)
                Exit Sub
            End Try
        End Sub
        Private Function ConnectToCompany() As Integer
            '// Make sure you're not already connected.
            If oCompany.Connected = True Then
                oCompany.Disconnect()
            End If
            '// Establish the connection to the company database.
            ConnectToCompany = oCompany.Connect
        End Function
        Private Function SetConnectionContext() As Integer
            Dim sCookie As String
            Dim sConnectionContext As String
            ' Dim lRetCode As Integer
            '// First initialize the Company object
            oCompany = New SAPbobsCOM.Company
            '// Acquire the connection context cookie from the DI API.
            sCookie = oCompany.GetContextCookie
            '// Retrieve the connection context string from the UI API using the
            '// acquired cookie.
            sConnectionContext = SBO_Application.Company.GetConnectionContext(sCookie)
            '// before setting the SBO Login Context make sure the company is not
            '// connected
            If oCompany.Connected = True Then
                oCompany.Disconnect()
            End If
            '// Set the connection context information to the DI API.
            SetConnectionContext = oCompany.SetSboLoginContext(sConnectionContext)
        End Function
        Public Sub New()
            MyBase.New()
            Try
                SetApplication()
                ' Set The Connection Context
                If Not SetConnectionContext() = 0 Then
                    SBO_Application.MessageBox("Failed setting a connection to DI API")
                    End ' Terminating the Add-On Application
                End If
                If Not ConnectToCompany() = 0 Then
                    SBO_Application.MessageBox("Failed connecting to the company's Data Base")
                    End ' Terminating the Add-On Application
                End If
                'SBO_Application.MessageBox("DI Connected To: " & oCompany.CompanyName)
            Catch
                System.Windows.Forms.MessageBox.Show("SBO application not found")
            End Try
            diplay_DNEWform()
        End Sub
        Private Sub diplay_DNEWform()
            Dim oForm As SAPbouiCOM.Form
            Try
                oForm = SBO_Application.Forms.Item("SM_DNFM")
                SBO_Application.MessageBox("Form Already Open")
            Catch ex As Exception
                Dim fcp As SAPbouiCOM.FormCreationParams
                fcp = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)
                fcp.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Fixed
                fcp.FormType = "SM_DNFM"
                fcp.ObjectType = "SM_DNEW"
                fcp.UniqueID = "SM_DNFM"
                oForm = SBO_Application.Forms.AddEx(fcp)
                oForm.AutoManaged = False
                DrawDNEWForm(oForm)
            End Try
            oForm.Visible = True
        End Sub
        Public Sub DrawDNEWForm(ByVal oform As SAPbouiCOM.Form)
            Dim oItem As SAPbouiCOM.Item
            Dim oButton As SAPbouiCOM.Button
            ''Form specifications
            oform.Title = "define new"
            oform.Left = 335 '340
            oform.ClientWidth = 550 '350
            oform.Top = 55
            oform.ClientHeight = 200 '500
            'oForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE
            ShowAllItems(oform)
            '// Adding a OK button
            oItem = oform.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 27
            oItem.Width = 65
            oItem.Top = 175 '300
            oItem.Height = 20
            oButton = oItem.Specific
            '// Adding a Cancel button
            oItem = oform.Items.Add("2", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 101
            oItem.Width = 65
            oItem.Top = 176 '300
            oItem.Height = 20
            oButton = oItem.Specific
        End Sub
        Private Sub ShowAllItems(ByVal oForm)
            oDBDataSource = oForm.DataSources.DBDataSources.Add("@TESTDNEW")
            Dim oEditordr As SAPbouiCOM.ComboBox
            oItem = oForm.Items.Add("amtTxt", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            oItem.Left = 5
            oItem.Width = 100
            oItem.Top = 10
            ' oItem.AffectsFormMode = False
            oItem.LinkTo = "amtVal" '"Vndval"
            oStatic = oItem.Specific
            oStatic.Caption = "location"
            oItem = oForm.Items.Add("amtVal", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX)
            oItem.Left = 110
            oItem.Width = 160
            oItem.Top = 10
            ' oItem.LinkTo = "OrdrTxt"
            oItem.AffectsFormMode = True
            oEditordr = oItem.Specific
            '' Adding Choose From List
            oEditordr.DataBind.SetBound(True, "@TESTDNEW", "U_name")
            Dim scombo As String = "Define New"
            Call InitializeMCombo(oForm, scombo, "@TEST_TABLE", "<Default_Value>")
        End Sub
        Public Sub InitializeMCombo( _
            ByRef oForm As SAPbouiCOM.Form, _
            ByVal sCombo As String, _
            ByVal sLinkedTable As String, _
            Optional ByVal sDefaultValue As String = "" _
            Try
                oForm.Freeze(True)
                Dim oCombo As SAPbouiCOM.ComboBox
                oCombo = oForm.Items.Item(sCombo).Specific
                Try
                    ' Add 1-st value if database field accept NULL
                    oCombo.ValidValues.Add("", "")
                    Dim oRS As SAPbobsCOM.Recordset
                    oRS = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                    Dim sSql As String = "SELECT Code, Name FROM [@" & sLinkedTable & "] ORDER BY 1"
                    oRS.DoQuery(sSql)
                    oRS.MoveFirst()
                    While oRS.EoF = False
                        oCombo.ValidValues.Add(oRS.Fields.Item("Code").Value, _
                        oRS.Fields.Item("Name").Value)
                        oRS.MoveNext()
                    End While
                    ' Add DEFINE NEW value +++++++++++++++++++++++++++++++
                    ' Note: Code can have length up to 8 caracters
                    oCombo.ValidValues.Add("Redefine", "Redefine")
                    If Not oRS Is Nothing Then
                        System.Runtime.InteropServices.Marshal.ReleaseComObject(oRS)
                        oRS = Nothing
                    End If
                    System.GC.Collect() 'Release the handle to the table
                    ' Select dafault value if not null
                    If Not sDefaultValue.Equals("") Then
                        If oCombo.ValidValues.Count > 0 Then
                            oCombo.Select(sDefaultValue, SAPbouiCOM.BoSearchKey.psk_ByValue)
                        End If
                    Else
                        If oCombo.ValidValues.Count >= 1 Then
                            oCombo.Select(0, SAPbouiCOM.BoSearchKey.psk_Index)
                        End If
                    End If
                Catch ex As Exception
                    ' log exception
                Finally
                    oCombo = Nothing
                End Try
            Catch ex As Exception
            Finally
                oForm.Freeze(False)
                System.GC.Collect()
            End Try
        End Sub
        Private Sub SBO_Application_ItemEvent( _
              ByVal FormUID As String, _
              ByRef pVal As SAPbouiCOM.ItemEvent, _
              ByRef BubbleEvent As Boolean _
        ) Handles SBO_Application.ItemEvent
            Dim oForm As SAPbouiCOM.Form
            oForm = SBO_Application.Forms.Item(FormUID)
            If pVal.EventType = SAPbouiCOM.BoEventTypes.et_COMBO_SELECT _
            And pVal.FormUID = "SM_DNFM" _
            And pVal.ItemUID = "amtval" _
            And pVal.BeforeAction = False _
            And pVal.ItemChanged = True _
            Then
                SBO_Application.MessageBox("30")
                Try
                    Try
                        Dim oCombo As SAPbouiCOM.ComboBox
                        Dim sValue As String = ""
                        oCombo = oForm.Items.Item("amtval").Specific
                        sValue = oCombo.Selected.Value
                        If sValue.Equals("Redefine") Then
                            Try
                                oCombo.Select(0, SAPbouiCOM.BoSearchKey.psk_Index)
                                oForm.Refresh()
                            Catch ex As Exception
                                'log exception
                            End Try
                            SBO_Application.Menus.Item("51207").Activate()
                        End If
                        BubbleEvent = False
                    Catch ex1 As Exception
                        ' log exception
                    End Try
                Catch ex As Exception
                    ' log exception
                End Try
            End If
            ' Other events +++
        End Sub
    End Class
      its not working ,   please check it  why this is hapening.
    please help me.....

  • Placement of combo boxes.

    You can see a screenshot of my current GUI here: http://i43.tinypic.com/2gxjiol.png
    On another computer I was developing this on, these combo boxes lined up nicely along the top and matched decently with the different sections of the bar graph presented. On this new system, that does not appear to be the case (as you can see in the screenshot). They don't all fit in one line and don't line up nicely with the sections of the graph. What is the best solution for this issue?
    It is an array of combo boxes defined something like this...
    JComboBox[]               noteBoxes = {
                   new JComboBox(noteNames)};
    for(int i=0; i < noteBoxes.length; i++){
                 noteBoxes.setSelectedIndex(i);
         noteBoxes[i].addActionListener(this);
         add(noteBoxes[i]);
    }Thanks in advance!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hm, I don't know what a "best" answer would be, but one way to possibly do it is to make each column out of a JPanel and place a JComboBox at the top of each column, perhaps BorderLayout.NORTH. Also, due to changes in screen resolution, you may have to put the whole graph business in a JScrollPane.

  • Combo boxes on web forms

    I'm currently converting a forms v4.5 application onto 9iAS with web forms. I'm have major problems with my user community as combo boxes are no longer supported under web forms and they use them extensively.
    To try and overcome the problem I have converted the combo box into a 'TEXT_ITEM' and set up a LOV called from a button. This works for inserting new records, but when they query back existing records no data is displayed in the text_item boxes.
    Does anybody know how I get the LOV to fire JUST to display back existing single row data.
    Many Thanks
    Jez Thorpe.

    combobox is available on webform, but it did not deliver what a standard combobox supposes to offer.
    e.g., 1) it can display one column and return one valure;
    for emp table, there are ename and empno:
    ename empno
    David M Brown 100
    David M Brown 101
    David L Miller 103
    Then I have to use LOV to display these records of different persons and same name. If you try MS OFFICE, with ACCESS, you will see how nice the combox it is. Of course they are industry GUI standard, forms cannot do it, it is normal.
    2) it does not support partial search as seen on MS Access application
    for ename records in the list,
    David M Brown
    Bill L Kim
    Bill P Kelly
    What is expecting is that if user types in 'D', then the first records should automatically populate into the box's text field; if types in 'B', then the shortened list with the two records beginning with 'B' should be displayed for user to pick.
    This can be seen on MS ACCESS, but not on webforms.
    When we say combobox is available, it is not accurate enough to define the 'availability' of it.

  • How to populate data in the data table on combo box change event

    hi
    i am deepak .
    i am very new to JSF.
    my problem is i want to populate data in the datatable on the combo box change event.
    for example ---
    combo box has name of the city. when i will select a city
    the details of the city should populate in the datatable. and if i will select another city then the datatable should change accordingly..
    its urgent
    reply as soon as possible
    thanks in advance

    i am using Rational Application Developer to develop my application.
    i am using a combo box and i am assigning cityName from the SDO.
    and i am declaring a variable in the pageCode eg.
    private String cityName;
    public void setCityName(String cityName){
    this.cityName = cityName;
    public String getCityName(){
    return cityName;
    <h:selectOneMenu id="menu1" styleClass="selectOneMenu" value="#{pc_Test1.loginID}" valueChangeListener="#{pc_Test1.handleMenu1ValueChange}">
                        <f:selectItems
                             value="#{selectitems.pc_Test1.usercombo.LOGINID.LOGINID.toArray}" />
                   </h:selectOneMenu>
                   <hx:behavior event="onchange" target="menu1" behaviorAction="get"
                        targetAction="box1"></hx:behavior>
    and also i am declaring a requestParam type variable named city;
    and at the onChangeEvent i am writing the code
    public void handleMenu1ValueChange(ValueChangeEvent valueChangedEvent) {
    FacesContext context = FacesContext.getCurrentInstance();
    Map requestScope = ext.getApplication().createValueBinding("#{requestScope}").getValue(context);
    requestScope.put("login",(String)valueChangedEvent.getNewValue());
    and also i am creating another SDO which is used to populate data in datatable and in this SDO in the where clause i am using that requestParam .
    it is assigning value in the pageCode variable and in the requestParam but it is not populating the dataTable. i don't no why??
    it is possible that i may not clear at this point.
    please send me the way how my problem can be solved.
    thanks in advance

  • How to Bind a Combo Box so that it retrieves and display content corresponding to the Id in a link table and populates itself with the data in the main table?

    I am developing a desktop application in Wpf using MVVM and Entity Frameworks. I have the following tables:
    1. Party (PartyId, Name)
    2. Case (CaseId, CaseNo)
    3. Petitioner (CaseId, PartyId) ............. Link Table
    I am completely new to .Net and to begin with I download Microsoft's sample application and
    following the pattern I have been successful in creating several tabs. The problem started only when I wanted to implement many-to-many relationship. The sample application has not covered the scenario where there can be a any-to-many relationship. However
    with the help of MSDN forum I came to know about a link table and managed to solve entity framework issues pertaining to many-to-many relationship. Here is the screenshot of my application to show you what I have achieved so far.
    And now the problem I want the forum to address is how to bind a combo box so that it retrieves Party.Name for the corresponding PartyId in the Link Table and also I want to populate it with Party.Name so that
    users can choose one from the dropdown list to add or edit the petitioner.

    Hello Barry,
    Thanks a lot for responding to my query. As I am completely new to .Net and following the pattern of Microsoft's Employee Tracker sample it seems difficult to clearly understand the concept and implement it in a scenario which is different than what is in
    the sample available at the link you supplied.
    To get the idea of the thing here is my code behind of a view vBoxPetitioner:
    <UserControl x:Class="CCIS.View.Case.vBoxPetitioner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:v="clr-namespace:CCIS.View.Case"
    xmlns:vm="clr-namespace:CCIS.ViewModel.Case"
    mc:Ignorable="d"
    d:DesignWidth="300"
    d:DesignHeight="200">
    <UserControl.Resources>
    <DataTemplate DataType="{x:Type vm:vmPetitioner}">
    <v:vPetitioner Margin="0,2,0,0" />
    </DataTemplate>
    </UserControl.Resources>
    <Grid>
    <HeaderedContentControl>
    <HeaderedContentControl.Header>
    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
    <TextBlock Margin="2">
    <Hyperlink Command="{Binding Path=AddPetitionerCommand}">Add Petitioner</Hyperlink>
    | <Hyperlink Command="{Binding Path=DeletePetitionerCommand}">Delete</Hyperlink>
    </TextBlock>
    </StackPanel>
    </HeaderedContentControl.Header>
    <ListBox BorderThickness="0" SelectedItem="{Binding Path=CurrentPetitioner, Mode=TwoWay}" ItemsSource="{Binding Path=tblParties}" />
    </HeaderedContentControl>
    </Grid>
    </UserControl>
    This part is working fine as it loads another view that is vPetioner perfectly in the manner I want it to be.
    Here is the code of vmPetitioner, a ViewModel:
    Imports Microsoft.VisualBasic
    Imports System.Collections.ObjectModel
    Imports System
    Imports CCIS.Model.Party
    Namespace CCIS.ViewModel.Case
    ''' <summary>
    ''' ViewModel of an individual Email
    ''' </summary>
    Public Class vmPetitioner
    Inherits vmParty
    ''' <summary>
    ''' The Email object backing this ViewModel
    ''' </summary>
    Private petitioner As tblParty
    ''' <summary>
    ''' Initializes a new instance of the EmailViewModel class.
    ''' </summary>
    ''' <param name="detail">The underlying Email this ViewModel is to be based on</param>
    Public Sub New(ByVal detail As tblParty)
    If detail Is Nothing Then
    Throw New ArgumentNullException("detail")
    End If
    Me.petitioner = detail
    End Sub
    ''' <summary>
    ''' Gets the underlying Email this ViewModel is based on
    ''' </summary>
    Public Overrides ReadOnly Property Model() As tblParty
    Get
    Return Me.petitioner
    End Get
    End Property
    ''' <summary>
    ''' Gets or sets the actual email address
    ''' </summary>
    Public Property fldPartyId() As String
    Get
    Return Me.petitioner.fldPartyId
    End Get
    Set(ByVal value As String)
    Me.petitioner.fldPartyId = value
    Me.OnPropertyChanged("fldPartyId")
    End Set
    End Property
    End Class
    End Namespace
    And below is the ViewMode vmParty which vmPetitioner Inherits:
    Imports Microsoft.VisualBasic
    Imports System
    Imports System.Collections.Generic
    Imports CCIS.Model.Case
    Imports CCIS.Model.Party
    Imports CCIS.ViewModel.Helpers
    Namespace CCIS.ViewModel.Case
    ''' <summary>
    ''' Common functionality for ViewModels of an individual ContactDetail
    ''' </summary>
    Public MustInherit Class vmParty
    Inherits ViewModelBase
    ''' <summary>
    ''' Gets the underlying ContactDetail this ViewModel is based on
    ''' </summary>
    Public MustOverride ReadOnly Property Model() As tblParty
    '''' <summary>
    '''' Gets the underlying ContactDetail this ViewModel is based on
    '''' </summary>
    'Public MustOverride ReadOnly Property Model() As tblAdvocate
    ''' <summary>
    ''' Gets or sets the name of this department
    ''' </summary>
    Public Property fldName() As String
    Get
    Return Me.Model.fldName
    End Get
    Set(ByVal value As String)
    Me.Model.fldName = value
    Me.OnPropertyChanged("fldName")
    End Set
    End Property
    ''' <summary>
    ''' Constructs a view model to represent the supplied ContactDetail
    ''' </summary>
    ''' <param name="detail">The detail to build a ViewModel for</param>
    ''' <returns>The constructed ViewModel, null if one can't be built</returns>
    Public Shared Function BuildViewModel(ByVal detail As tblParty) As vmParty
    If detail Is Nothing Then
    Throw New ArgumentNullException("detail")
    End If
    Dim e As tblParty = TryCast(detail, tblParty)
    If e IsNot Nothing Then
    Return New vmPetitioner(e)
    End If
    Return Nothing
    End Function
    End Class
    End Namespace
    And final the code behind of the view vPetitioner:
    <UserControl x:Class="CCIS.View.Case.vPetitioner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:vm="clr-namespace:CCIS.ViewModel.Case"
    mc:Ignorable="d"
    Width="300">
    <UserControl.Resources>
    <ResourceDictionary Source=".\CompactFormStyles.xaml" />
    </UserControl.Resources>
    <Grid>
    <Border Style="{StaticResource DetailBorder}">
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto" />
    <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <TextBlock Grid.Column="0" Text="Petitioner:" />
    <ComboBox Grid.Column="1" Width="240" SelectedValuePath="." SelectedItem="{Binding Path=tblParty}" ItemsSource="{Binding Path=PetitionerLookup}" DisplayMemberPath="fldName" />
    </Grid>
    </Border>
    </Grid>
    </UserControl>
    The problem, presumably, seems to be is that the binding path "PetitionerLookup" of the ItemSource of the Combo box in the view vPetitioner exists in a different ViewModel vmCase which serves as an ObservableCollection for MainViewModel. Therefore,
    what I need to Know is how to route the binding path if it exists in a different ViewModel?
    Sir, I look forward to your early reply bringing a workable solution to the problem I face. 
    Warm Regards,
    Arun

Maybe you are looking for

  • Payment Term default to Purchase Order

    Dear SAP guru, We have problem that payment term is not defaulted to Purchase Order if the Purchase Order is converted from Purchase Requisition. If purchase order is directly created in ME21N, the payment term will be defaulted from vendor master. H

  • How to Send Idoc Acknowledgements back to Http sender (Http to Idoc)

    Hi I have scenario: Http To Idoc first requirment: i need to map xml file come from HTTP Sender to Idoc (SAP system), and need to send Idoc acknowledgements/status back to Http sender. second requirment: while mapping COM Xml file come from Http to C

  • HOW DO I TURN VIDEO UPRIGHT

    I HAVE A PAVILLIAN G 7 SERIES AND WOULD LIKE TO KNOW HOW I CAN TURN THE VIDEO AROUND

  • 1300 suddenly stops printing multiple copies

    My Laserjet 1300 suddenly stopped printing multiple copies. I am using the driver supplied with win7 and it has been working for the last year. I have tried installing PCL6 driver instead of PCL5 and I can print multiple copies for one job only and t

  • .WAR FILE

    HI, I am completely new to the weblogic environment - these are the set of questions that i have - ANY HELPIS GREATLY APPRECIATED i am using weblogic version 5.1 running on windows NT 4.0 1.Do we need to create .WAR file for development( documentatio