Combo in Grid

Hi Dear;
how can I fill data in a combo(as gridcolumn) in a grid?
thank you Dear;

Hi
i am not sure why you are getting error
your Code is absolutely fine
But try the same thing like this
oQuery = "select DocNum, slpcode, CardName,docentry from OINV where docstatus='O' order by docnum"
oForm.DataSources.DataTables.Item(0).ExecuteQuery(oQuery)
oGrid.DataTable = oForm.DataSources.DataTables.Item("TB_OSLP")
' Set columns size
oGrid.Columns.Item(0).Width = 50
oGrid.Columns.Item(0).Editable = False
oGrid.Columns.Item(1).Type = SAPbouiCOM.BoGridColumnType.gct_ComboBox
oGrid.Columns.Item(1).Width = 150
oGrid.Columns.Item(2).Width = 400
oGrid.Columns.Item(2).Editable = False
oGrid.Columns.Item(3).Visible = False
Regards
Vishnu
Regards
Vishnu

Similar Messages

  • Dynamic Combo In Grid

    Is is possible to change the Values of a combobox based on a value in another field on that row on the grid.
    For example if field 1 = true then validvalues of the CB are 1,2,3
    if it is False  then the valid values are 4,5,6
    I have tried the ItemPressed but the combo opens before that event (yes I am using the Befor event)

    william you would need to remove the existing and add new values.
    but this is problematic. I would suggest using a formatted search.

  • 3.2; BC4J; Grid: attached Combo with two columns?

    Hi,
    I anybody could attach a combo to grid with two or more Columns? Or any idea to attach an LOV to grid cells?
    Thanks
    null

    package com.npevolution.util;
    import java.awt.Component;
    import javax.swing.JTable;
    import javax.swing.table.TableCellRenderer;
    import oracle.dacf.control.swing.ComboBoxControl;
    import javax.infobus.*;
    import oracle.dacf.dataset.*;
    public class ComboBoxControlRenderer extends javax.swing.JComboBox
    implements javax.swing.table.TableCellRenderer {
    private RowSetInfo rowSetInfo;
    private String colGuardar;
    private Object comboCod[];
    //@colMostrar is "Name"
    //@colGuardar is "Cod"
    public ComboBoxControlRenderer(RowSetInfo rsi, String colMostrar, String colGuardar) {
    super();
    rowSetInfo = rsi;
    this.colGuardar = colGuardar;
    try{
    ScrollableRowsetAccess m_Rs = (ScrollableRowsetAccess)rsi.getRowsetAccess();
    int rowCount = m_Rs.getRowCount();
    for (int iRow=0; iRow<rowCount; iRow++){
    m_Rs.absolute(iRow+1);
    ImmediateAccess ia = (ImmediateAccess)m_Rs.getColumnItem(colMostrar);
    String str = ia.getValueAsString();
    addItem(str);
    }catch(Exception e){
    e.printStackTrace();
    public Component getTableCellRendererComponent(JTable table,
    Object value, boolean isSelected, boolean hasFocus,
    int row, int column) {
    ScrollableRowsetAccess rs = rowSetInfo.getRowsetAccess();
    int index = 0;
    try {
    boolean moreRows = rs.first();
    while (moreRows) {
    if (value.equals(((ImmediateAccess)rs.getColumnItem(colGuardar)).getValueAsString())) {
    break;
    } else {
    index++;
    moreRows = rs.next();
    } catch (Exception ex) {
    System.out.println("Error al buscar el indice en el Renderer: " + ex.getMessage());
    if (index < rs.getRowCount()){
    setSelectedIndex(index);
    return this;
    import java.awt.Component;
    import java.util.EventObject;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    import oracle.dacf.control.swing.ComboBoxControl;
    import javax.infobus.*;
    import oracle.dacf.dataset.*;
    public class ComboBoxControlEditor extends JComboBox
    implements javax.swing.table.TableCellEditor{
    protected EventListenerList listenerList = new EventListenerList();
    protected ChangeEvent changeEvent = new ChangeEvent(this);
    private RowSetInfo rowSetInfo;
    private String colMostrar;
    private String colGuardar;
    private Object comboCod[];
    * Constructor
    *@param rsi RowSetInfo que se utiliza para cargar el JComboBox
    *@param colMostrar nombre del AttributeInfo del RowSetInfo que muestra el combo
    *@param colGuardar nombre del AttributeInfo del RowSetInfo que se tiene que asignar a la celda del editor
    public ComboBoxControlEditor(RowSetInfo rsi, String colMostrar, String colGuardar) {
    super();
    rowSetInfo = rsi;
    this.colGuardar = colGuardar;
    this.colMostrar = colMostrar;
    addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent event) {
    fireEditingStopped();
    try{
    ScrollableRowsetAccess m_Rs = (ScrollableRowsetAccess)rsi.getRowsetAccess();
    int rowCount = m_Rs.getRowCount();
    comboCod = new Object[rowCount];
    for (int iRow=0; iRow<rowCount; iRow++){
    m_Rs.absolute(iRow+1);
    ImmediateAccess ia = (ImmediateAccess)m_Rs.getColumnItem(colMostrar);
    String str = ia.getValueAsString();
    addItem(str);
    ia = (ImmediateAccess)m_Rs.getColumnItem(colGuardar);
    str = ia.getValueAsString();
    comboCod[iRow] = str;
    }catch(Exception e){
    e.printStackTrace();
    * Mitodo que devuelve el atributo rowSetInfo del ComboBoxControlRenderer.
    * @return RowSetInfo
    public RowSetInfo getRowSetInfo() {
    return rowSetInfo;
    * Mitodo que establece el valor del atributo rowSetInfo del ComboBoxControlRenderer.
    * @param rs RowSetInfo que se asocia
    public void setRowSetInfo(RowSetInfo rsi) {
    rowSetInfo = rsi;
    * Mitodo del interfaz TableCellEditor.
    public void addCellEditorListener(CellEditorListener listener) {
    listenerList.add(CellEditorListener.class,listener);
    * Mitodo del interfaz TableCellEditor.
    public void removeCellEditorListener(CellEditorListener listener) {
    liste nerList.remove(CellEditorListener.class,listener);
    protected void fireEditingStopped() {
    CellEditorListener listener;
    Object[] listeners = listenerList.getListenerList();
    for (int i=0; i<listeners.length; i++) {
    if (listeners[i] == CellEditorListener.class) {
    listener = (CellEditorListener) listeners[i+1];
    listener.editingStopped(changeEvent);
    protected void fireEditingCanceled() {
    CellEditorListener listener;
    Object[] listeners = listenerList.getListenerList();
    for (int i=0; i<listeners.length; i++) {
    if (listeners[i] == CellEditorListener.class) {
    listener = (CellEditorListener) listeners[i+1];
    listener.editingCanceled(changeEvent);
    * Mitodo del interfaz TableCellEditor.
    public void cancelCellEditing() {
    fireEditingCanceled();
    * Mitodo del interfaz TableCellEditor.
    public boolean stopCellEditing() {
    fireEditingStopped();
    return true;
    * Mitodo del interfaz TableCellEditor.
    public boolean isCellEditable (EventObject event) {
    return true;
    * Mitodo del interfaz TableCellEditor.
    public boolean shouldSelectCell(EventObject event) {
    return true;
    * Mitodo del interfaz TableCellEditor.
    * Devuelve un objeto con el valor contenido en el editor.
    public Object getCellEditorValue() {
    String seleccionado = (String)this.getSelectedItem();
    ScrollableRowsetAccess rs = rowSetInfo.getRowsetAccess();
    String codigo = "";
    try {
    boolean moreRows = rs.first();
    while (moreRows) {
    if (seleccionado.equals(((ImmediateAccess)rs.getColumnItem(colMostrar)).getValueAsString())) {
    codigo = ((ImmediateAccess)rs.getColumnItem(colGuardar)).getValueAsString();
    break;
    moreRows = rs.next();
    } catch (Exception ex) {
    System.out.println("Error al buscar: " + ex.getMessage());
    return codigo;
    * Mitodo del interfaz TableCellEditor.
    * Establece un valor inicial para el editor.
    * Devuelve el componente para editar.
    public Component getTableCellEditorComponent(JTable table,
    Object value, boolean isSelected, int row, int column) {
    ScrollableRowsetAccess rs = rowSetInfo.getRowsetAccess();
    int index = 0;
    try {
    boolean moreRows = rs.first();
    while (moreRows) {
    if (value.equals(((ImmediateAccess)rs.getColumnItem(colGuardar)).getValueAsString())) {
    break;
    } else {
    index++;
    moreRows = rs.next();
    } catch (Exception ex) {
    System.out.println("Error al buscar: " + ex.getMessage());
    if (index < rs.getRowCount()){
    setSelectedIndex(index);
    return this;
    null

  • Dynamically change the contents of one combo box based on the other

    Hi Forum,
    I have a question which might have a possibly simple answer. Well anyway help me out since i could not find the simple answer.
    I am building an application using Swing and binding with BC4J using JClient. My GUI has combo boxes, grids, editboxes. My requirement is that i should be able to dynamically change the contents of one combo box based on the selected item in trhe previous combo box. For example, when i choose a country in the "country combo box", the "states combo box" should show the list of the states of the selected country.
    Now how do i do this using binding. If not, how do i write custom querirs in BC4J layer and return a resultset to the remote application so theat i can populate the dependent combo boxes.
    I will appreciate if anyone can help me out in this regard.
    Thank You
    Sumit

    there could be quite a few number of ways of solving this problem.
    One way is through event handlers.
    taking your example as a model when user selects a country you could fire an action with a flag set to ture. A method will return the states from the DB or your temporary files or what ever and then the true flag will be used in the states combo box rendering.
    other way: javascript
    this might be a bit clumsy as you will need the states information in a property file and you can get the info as the user selects a country.
    regards,
    raj

  • Which is better? single jsp or inc or diff jsp

    hi,
    I have 3 modes as a combo in the top of my form say new, enquiry and amend. If the user selects, new, a new screen should appear.The user can enter values and submit, so that it can be updated into the databse.
    If the user selects Enquiry, getting some key fields from the user, the form should get submitted and display the result in the screen fields taking from the database.If it is amend, the user can do select and change and update the database..
    In this scenaio, which one is advisable? having three different Jsps or having three different includes or working with single jsp(with bean).currently iam working with single jsp(code comes around 4000 lines + bean code comes around 1500 lines), debugging is bit tedious.
    The screen has many dynamic combos, growing grids, popups generated from the grids.
    Suggest me a solution.
    Thanks in Advance,
    Shyam

    Hi , If i understood properly , u r stuck with design problems. so u follow the MVC controller technique to solve this problem. split all jsp in 4 parts or more than that if posibble. just pass the controll to the MVC object with the parameter based upon the selection of combobox. this MVC will analyse the objects parameter and based upon that will redirect to jsp's
    u have to now seperate the business logic as well as the presentation logic. use Jsp's for presentation logic and for dynamic popup of the message boxes or loading combo boxes. Use JSP for business objects and use the usebean tags in the jsp's.
    This will solve u r problem . try to break evry thing as simple objects as posibble. let it be even a chain of objects . it will be easy for u to debug as well as for the session management.
    Good Luck.
    if u need any more please feel free to mail me at [email protected]

  • Web Analysis Alias Issues

    We changed some cost center naming conventions within the Essbase cube and moved the old alias to a new alias table called OLD so reports relying on this alias would not be comprimised. The problem is that the reports already developed will not show the new alias description. I tried everything I can think of including removing the old alias directly in Essbase. Any ways around this or do I have to recreate the reports?
    With the excel add-in, it is as easy as changing the alias table reference in options, but I can't find a similar function in Web Analysis.

    Good news...Bad news...
    The good news is that there is a way to manage this in Analyzer/Web Analysis. The bad news is that it is a really poor implementation of this feature. To date, this is the only way I know of to control this.
    If you open your report in the Java client (Studio) and switch to Report Designer mode, you will see on the menu bar the different types of subscriptions you can drag onto your report. Things like combo boxes, grids, radio buttons, etc. There is one that is often overlooked, called "Alias Controller". Drag the alias controller onto your report and switch back to Analyze View. You now have a drop down box on your report that allows you to choose which alias table you want to utilize.
    Of course you'll have to touch each report to do this.
    Another issue is that you now have an Alias controller on each report. That might be a benefit to you if it makes sense for your users to toggle back and forth, however if it doesn't and you don't want the drop down box on your report, there are some options. One options is to hide it behind another object or under a panel. The other option, and I have not tested this extensively, is to add the controller, change the alias table to the one you want, save the report, go back and delete the controller, save the report again, and it should continue to use the new alias table. I don't know if at some point it will revert back to the default alias table, but my basic testing showed it will hold the last table prior to removing the controller from the report. To be safe, you might just want to hide it.
    HTH

  • How to display data in a grid after selecting topic from combo box?

    could someone help me out? i'm displaying a combo box (about
    20 items) vertically. when user selects one of these items, i'd
    like for information regarding that choice to be displayed in my
    data grid. thanks - Karl from Kansas

    If you have the following:
    <mx:ComboBox id="combo_box" dataProvider="{users}"
    labelField="user_name" change="show_details(event)"
    ></mx:ComboBox>
    <mx:DataGrid id="data_grid" >
    <mx:columns>
    <mx:DataGridColumn headerText="Name"
    dataField="user_name"/>
    <mx:DataGridColumn headerText="email"
    dataField="email"/>
    </mx:columns>
    </mx:DataGrid>
    private function show_details(evt:Event):void {
    data_grid.dataProvider = evt.currentTarget.selectedItem
    This assumes that your combo box data has a user_name and
    email property value. Substitute your property values where needed.
    Vygo

  • Combo in a grid column

    Hi, I need to place a combo in a grid column but this code does not work...
    SAPbouiCOM.GridColumn grdc = this.grdRoom.Columns.Item("Id_CST");
    grdc.Type = BoGridColumnType.gct_ComboBox;     
    SAPbouiCOM.ComboBoxColumn clmcbo = (SAPbouiCOM.ComboBoxColumn)grdc;
    for( int i = 0; i < 5; i++)
    clmcbo.ValidValues.Add( i.ToString(), i.ToString() );
    ....does anyone see the problem¿?
    Thanks

    Hello,
    this is a code in VB, but it works
    Dim dsa_ComboBoxColumn As SAPbouiCOM.ComboBoxColumn
    msa_Grid.Columns.Item(i).Type = SAPbouiCOM.BoGridColumnType.gct_ComboBox
    dsa_ComboBoxColumn = msa_Grid.Columns.Item(i)
    dsa_ComboBoxColumn.ValidValues.Add("1","1")

  • Adding Combo box in Grid

    Hi all,
    How to add a combo box in a grid (2005 B)
    Regards,
    Aravindhan.R

    Hi,
    Have a look at the SBO FAQ wiki:
    https://wiki.sdn.sap.com/wiki/display/HOME/BusinessOneFAQ#BusinessOneFAQ-UIItems
    Regards,
    Ibai Peñ

  • Problem rendering a combo box in the data grid

    Hi,
    I am rendering a combo box in the data grid control using an
    item renderer. When I click on it to select a value from the drop
    down, the combo box immediately closes giving no time to even click
    on the dropdown. This doesn’t happen every time the combo is
    clicked, although it happens frequently. What I think is that the
    problem arises because the data grid tries to refresh the renderers
    and during this process, the existing combo is removed, thereby
    getting closed automatically. Please let me know of a work around.
    Thanks,
    Cheree

    hi hiwa,
    i have to add combo box in datagrid dynamically.
    it should append as and when i add the data in the above text boxes.
    thanks in advance.

  • Grid control with combo cell

    Does Anybody have some information about grid
    control/oracleSpreadTable with combo list instead of text cell.
    Please help!!
    null

    As curious as I always am, I was able to discover my XE database from the GC 10.1.0.4 last month. I did this because I asked myself the same question. When there is time, I normally will try everything that says "Not supported" or "Not compartible" to prove it right or wrong. So give it a go, but don't post errors from it here :-). I have not tried it for GC 10.2.0.2, but it worked on 10.1.0.4 (hopefully 10.1.0.3).
    Remember, XE has all the features of EE, but a cutdown version. It has an Oracle Service and a Listener on a port, so the agent will pick them up. I have tried all possible things and tools (Forms, Reports, Designer Repository, Jdeveloper, SQL Developer, ODBC, JDBC etc) on XE to break it, but it works like EE. The only difference is when you hit the max allowed 4GB (excluding 1GB system) and I proved the limit right by kicking of a data load into a table using a cursor until it hit the maximum 4GB limit error.

  • Grid Combo Box

    I took the code for creating a combo box inside the grid but I have a problem when I change the label of the column that attached to the combo box. It gave me error about identifier not found.
    The setDataItemName method I didn't touch it.
    any idea ,.. appreciated.
    DT
    public class myGridComboBox1 extends ComboBoxControl {
    public myGridComboBox1(ScrollableRowsetAccess m_Rs, JTable m_Table, String
    grid_columnName, String combo_columnName ) {
    int rowCount = m_Rs.getRowCount();
    Object comboData[] = new Object[rowCount];
    try{
    for (int iRow=0; iRow<rowCount; iRow++){
    m_Rs.absolute(iRow+1);
    ImmediateAccess ia =
    (ImmediateAccess)m_Rs.getColumnItem(combo_columnName);
    String str = ia.getValueAsString();
    comboData[iRow] = str;
    }catch(Exception e){
    e.printStackTrace();
    // get reference to a column
    TableColumn customColumn = m_Table.getColumn(grid_columnName);
    // custom TableCellRenderer
    TableCellRenderer myTCR = new ListCellRenderer(comboData, rowCount);
    // forces this column to use the custom Cell Renderer
    customColumn.setCellRenderer(myTCR);
    TableCellEditor myTCE = new DefaultCellEditor(new JComboBox(comboData));
    customColumn.setCellEditor(myTCE);
    // inner class for custom CellRenderer (ComboBox)
    class ListCellRenderer extends ComboBoxControl implements
    TableCellRenderer{
    public ListCellRenderer(Object cData[], int iRow)
    super();
    for (int i=0; i<iRow; i++)
    addItem(cData.toString());
    public Component getTableCellRendererComponent(JTable table, Object value,
    boolean isSelected,
    boolean hasFocus, int row, int column)
    setBackground(isSelected && hasFocus ? table.getSelectionBackground() :
    table.getBackground());
    setForeground(isSelected && hasFocus ? table.getSelectionForeground() :
    table.getForeground());
    setFont(table.getFont());
    setSelectedItem(value);
    return this;
    null

    You should pass the name of the attribute,
    not the label to the "MyGridComboBox"
    constructor.(As grid_ColumnName).
    Hope helps.

  • Issues with Data Grid Combo Boxes

    Hi,
    I am trying to implement, 3 combo boxes for each row in extended data grid but unable to find the solution. Can someone please help?
    Problem in detail:
    The issue is after populating the data grid i want to give users 3 options  using 3 combo boxes(i.e each row in data grid will now have 3 options , which is basically converting 1 row into 3 rows with 3 options),so that they are able to do their computations.
    This is reallly urgent, any help would be highly appreciated.
    Thanks & Regards
    Pankaj

    "In this new release of SQL Dev, when I execute a SQL in the SQL Worksheet and click in the Data Grid in the Results tab and try to navigate within a record using arrow keys, the grid cell enters into edit mode by default and so I cannot use the Left or Right arrow keys to navigate the grid. I am forced to use tab key to navigate. This is counter intuitive in my opinion."
    In the "Results" tab, Click Ctrl & Tab keys (at the same time) or with mouse click on any cell other than the first column (a sequence or rownum), you will be able to navigate using the arrow keys.
    "Another issue that I have come across is with SQL syntax checking. In some cases, when I press F9 to execute a SQL, it shows the SQL as executed i.e. shows something like 0.0134 seconds in the toolbar and no results displayed. In reality, the SQL had some syntax error which were NOT reported. This can be frustrating since now I have to fall back to SQL*Plus or TOAD just for syntax check."
    The 0.0134 seconds could be the result of the most recently executed successful statement. Check the Script Output tab for errors. Use F5 (Run Script option) instead of F9.
    "I like the fact that SQLDev highlights the current SQL but it would be more useful if it just indicated the first line of the current sql instead of highlighting the whole sql."
    On the SQL statement (or code), Right Click -> Format SQL (or press Ctrl & B), proper formatting would help.
    I use version 1.0.0.15.57 and seems to be working allright.
    - Babu Rangasamy

  • Data grid combo box

    how can i add a combo box in to the Data grid when i click the add button.
    when i add  the second row what i have selected before is refreshed.
    please help me

    The data property of the item renderer corresponds to the
    item the item renderer renders (a lot of repetitions here... :-).
    But when your application starts, the data property of your
    item renderer is null. Still, the code is executed. So you get a
    null pointer exception.
    How to solve this problem ?
    Use databinding within the item renderer in order to detect
    the data value change from null to an object value:
    <mx:Binding source="{this.data}"
    destination="onDataChanged" />
    private function set onDataChanged(value:Object):void
    if(value)
    // Do something if value is non-null
    Voila !
    No more errors.
    Since the item has a type in the dataprovider of my datagrids
    in my projects, I cast the data property to an explicit type before
    accessing the item properties:
    E.g
    (this.data as Product).ISBN

  • Combo Box in a Grid Control

    I know, this is not a new topic but... I didn't find a definitive solution.
    The problem is very simple, but the solution is very hard : put in a grid a combobox showing a value (the "description") and recording another value.
    I tried the Mr. Timpone solution and also the JDeveloper Help solution but they don't work : if You have more than 1 row the when You move from first line to the second the system have an incorrect behaviour.
    Does anyone know a complete and working solution ?
    If Yes couls him/her explain it to us ?
    TIA
    Tullio
    null

    Uh, never mind. Dumb question. Use an item rendere/editor.
    thanks anyway.

Maybe you are looking for

  • Loading an external image (from file system) to fla library as MovieClip symbol.

    Hi everyone, I am new to actionscript and Flash. I have been working on code updation project wherein initially we had an image and text as movieclips in fla library. The image and the text are read by the actionscript program which then creates an a

  • Creating an Image from an Icon

    I need to use an Icon retrieved from UIManager#getIcon(Object) as a JFrame's icon. Is there a way to convert the Icon to an Image object?

  • Cursor movement in Sales Order

    Dear Members, I have a user on SAP B1, who has trouble with processing sales orders. After she has entered customer number, date et and gets to down to enter an item, the system behaves erratically. As soon as she hits the tab key after entering the

  • I want to delete my adobe reader account which i bought through apple store

    I want to delete my "adobe reader" which i bought through apple store. i tried to do it through adobe.com but they told me that i have to go to apple because that is where i bought this application.please help me

  • How to modify a value...

    Hello guys, I am currently modifying a BDC program where in I want to change a value from one screen to another. Please see my code below. for example, I typed in the value 100 in screen 110 but I want to change it to 0 in screen 285. Is there a way