How to bind dynamic checkbox to a table

Hi,
I have a table that holds many fields. I put these fields on the screen dynamically.
I would like to bind a checkbox to select a field row.
I tried to bind the checkbox to the table but with no success. I keep getting the binding to the first element.
Does anyone has an example?
Thanks,
Itay

Hi P,
here is my code:
  LOOP AT lt_available_items ASSIGNING <item>.
    ADD 1 TO lv_col.
    IF lv_col > lv_cell_per_col.
      lv_col = 1.
      ADD 1 TO lv_row.
      lv_new_line = 'X'.
    ENDIF.
*   Add dynamic group
    CONCATENATE 'GROUP_' lv_col '_' lv_row INTO lv_str.
    lr_new_group = cl_wd_group=>new_group( id = lv_str view = view design = '02' ).
    IF lv_new_line = 'X'.
      CLEAR lv_new_line.
      cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_new_group ).
    ELSE.
      cl_wd_matrix_data=>new_matrix_data( element = lr_new_group ).
    ENDIF.
    lr_new_group->set_width( '230' ).
    cl_wd_matrix_layout=>new_matrix_layout( container = lr_new_group ).
    lr_group->add_child( lr_new_group ).
*   Left side container
    CONCATENATE 'CONT_L_' lv_col '_' lv_row INTO lv_str.
    lr_new_container = cl_wd_transparent_container=>new_transparent_container(
          id = lv_str view = view ).
    cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_new_container ).
    cl_wd_matrix_layout=>new_matrix_layout( container = lr_new_container ).
    lr_new_group->add_child( lr_new_container ).
*   Add checkbox
    CONCATENATE 'CHK_' lv_col '_' lv_row INTO lv_str.
    lr_checkbox = cl_wd_checkbox=>new_checkbox( view   = view
                                                id     = lv_str ).
    lr_matrix_head = cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_checkbox ).
    lr_checkbox->set_layout_data( lr_matrix_head ).
    lr_checkbox->bind_checked( 'AVAILBLE_ITEMS.SELECTED' ).
    lr_new_container->add_child( lr_checkbox ).
endloop.
my node is AVAILABLE_ITEMS and it has the attributes: SELECTED, MATNR, MAKTX...
thanks,
Itay

Similar Messages

  • How to bind dynamic columns in ADF table to view object

    In the below piece of code i am trying to bind a dynamically added column to my newly added attribute in view object, but the value expression does not set the value of this attibute in the view object please help on what is wrong in this code ??
    <af:table value="#{bindings.ViewObj1.collectionModel}" var="row"
    rows="#{bindings.ViewObj1.rangeSize}"
    emptyText="#{bindings.ViewObj1.viewable ? 'No rows yet.' : 'Access Denied.'}"
    fetchSize="#{bindings.ViewObj1.rangeSize}"
    filterModel="#{bindings.ViewObj1Query.queryDescriptor}"
    queryListener="#{bindings.ViewObj1Query.processQuery}" varStatus="vs"
    selectedRowKeys="#{bindings.ViewObj1.collectionModel.selectedRow}"
    rowSelection="single"
    binding="#{backingBeanScope.backing_createDTpg1.table1}"
    id="table1"
    columnSelection="single"
    partialTriggers="::addCol ::addColAfter ::addColBefore ::removeCol ::addRow ::addRowAfter ::addRowBefore ::removeRow ::addAction ::addActionAfter ::addActionBefore ::deleteAction :::dialog1 :::d1"
    allDetailsEnabled="true" verticalGridVisible="false"
    horizontalGridVisible="true" width="100%" disableColumnReordering="true"
    selectionListener="#{bindings.ViewObj1.collectionModel.makeCurrent}"
    immediate="true" contentDelivery="immediate"
    editingMode="clickToEdit" autoHeightRows="-1">
    <af:column sortProperty="Sno" filterable="false" sortable="false"
    headerText="Sno"
    align="center" width="28" rowHeader="true"
    inlineStyle="font-style:italic;" frozen="true"
    id="sno" selected="true" headerNoWrap="true"
    displayIndex="0">
    <af:outputText id="ot0" value="#{vs.index+1}"/>
    </af:column>
    <af:column id="separatorColumn" align="center"
    width="15" frozen="true" displayIndex="1"
    rowHeader="unstyled" sortable="false"
    filterable="false" selected="false"
    inlineStyle='background-image:url("jheadstart/images/jsp_forward.png"); background-repeat:no-repeat; outline-color:InactiveCaption; outline-style:solid; outline-width:thin;'
    headerText=""/>
    </af:table>
    DCBindingContainer dcBindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding iterBind =
    (DCIteratorBinding)dcBindings.get("ViewObj1Iterator");
    ViewObject decisionTableView1 = iterBind.getViewObject();
    System.out.println("before getAttributeCount :"+decisionTableView1.getAttributeCount());
    int counter = decisionTableView1.getAttributeCount() + 1;
    AttributeDef attribute =
    decisionTableView1.addDynamicAttribute("condition_" + counter);
    RichColumn column = new RichColumn();
    column.setId("condition_" + counter);
    column.setHeaderText("condition_" + counter);
    column.setNoWrap(true);
    RichInputText inputtext = new RichInputText();
    inputtext.setId("condition_"+counter);
    inputtext.setAutoSubmit(true);
    inputtext.setValueExpression("condition_"+counter,
    getValueBinding("#{row.bindings.condition_" +
    counter +
    ".inputValue}"));
    column.getChildren().add(inputtext);
    RichCommandImageLink headerLink = new RichCommandImageLink();
    headerLink.setText("<<Select Fact>>");
    headerLink.setId("conditionLink_" + counter);
    column.setHeader(headerLink);
    List columnList = this.table1.getChildren();
    int separatorColumnIndex =
    findColumnIndex(columnList, "separatorColumn");
    if (columnIndex == -1 || columnIndex > separatorColumnIndex) {
    columnIndex = separatorColumnIndex;
    System.out.println("Column Index :" + columnIndex);
    column.setDisplayIndex(columnIndex);
    this.table1.getChildren().add(columnIndex, column);

    Sorry Frank i could not figure out what u rtrying to say.
    In my case i have ADF table with two predefined coulmns :
    1 : a serial number read only column
    2 : a separator coumn
    I need help to bind the newly created dynamic attribute in the VO with my newly created column in the ADF table which has a input text as child.
    My problem is binding the is not working properly as values entered in the Table are not reflected in the VO.
    And when i insert a new column in between two columns which has already filled values the data in the rows does not shift coreespondingly..
    Edited by: user10281080 on Jul 27, 2009 12:22 AM

  • How to bind JtextFields in Swing to Table fields in the database

    Can some one give the code of how to bind JtextFields in Swing to Table fields in the database
    Am really new to java programming and have interest in learning

    The standard JDK doesn't do this for you. If you search on Google, you may find some 3rd party packages that will do this.
    You need to create your own form add execute the appropriate SQL yourself. Read the tutorial on [url http://java.sun.com/docs/books/tutorial/]JDBC Database Access to get started.

  • How to Controll Dynamic Checkbox Groups

    i want to create checkbox groups dynamically. Each group will have at least one child checkbox. if i select parent check box all child checkboxes should be checked.if i uncheck parent checkbox all child checkboxes should be unchecked.
    that check box group name also coming dynamically. i am trying to pass group name dynamically but it's not recognizing that name in javascript.
    pls help me on this how to controll dynamic checkbox groups.

    recognizing that name in javascript.Are you dynamically creating checkboxes with JSP?

  • How to bind dynamic row data to submit it by HTTP submit (PHP) - addInstance and Data Binding

    Hi,
    i have got a problem with submit HTTP all data (variables) from PDF to submit.php.
    I have got table with dynamic add/remove Table Row button. When i add it their names are Table.Row[0] , Table.Row[1], Table.Row[2] etc. Only Table.Row is real, and every other row is create dynamically by addInstance script command.
    When i fill "Data Binding" box like this: "Use name(Row)" then after submiting it do PHP i will see only last Table.Row data. For example if last would be Table.Row[3] then i will see only this on my submit.php and the others will be replaced by this value. This is happen becouse of replacing value by value with the same name (data binding is seeing only one Table.Row without instance name:"[1]", "[2]", "[3]" etc.).
    I guess that if i would change something to get addInstance command with Row names like Row1, Row2, Row3 then all will be ok.
    Another way it`s to change something in the "Data Binding" box (Object > Binding Tab) to get relative name like Row[*] instead of "Use name(Row)".
    I don`t know how to solve it and i need your help

    Create a binding for your dataTable.
    In the binding create a UIData element with gettters and setters.
    You can manipulate rows and columns from it.

  • How to bind dynamic data to JNet

    Develop tools: NWDS 7.1
    Server: Windows2000
    Does anyone have experiences with using JNET within Webdynpro Project ?
    In our case, we use JNet to generate a hierachical network diagram in the Webdypro's GUI. The data source is from the tables in a DB. However, till now, we only know how to let JNet generate the network diagram from a static XML file.
    Since the data in the DB changes all the time, how to let the network diagram reflect the newest data status automatically? That is, how to bind JNet to a dynamic data source then?

    Hi,
    Network UI element is related with Jnet. What you need to start up working with this is you need to create a context structure mentioned below.
    Node:Source
    Element--- xml -> this should be of type binary.
    Place the following code in the init.
    ISimpleTypeModifiable mod = wdContext.nodeSource().getNodeInfo().getAttribute("xml").getModifiableSimpleType();
    IWDModifiableBinaryType bin = (IWDModifiableBinaryType)mod;
    bin.setMimeType(new WDWebResourceType("xml", "application/octet-stream", false));
    ISourceElement element =wdContext.nodeSource().createSourceElement();
    wdContext.nodeSource().addElement(element);
    try
    fileName = WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(), "jnettest.xml");
    element.setXml(readFile(fileName));
    catch (WDAliasResolvingException e)
    You have to place the Jnet test.xml under the mimes folder of your application.
    Place the network element in the view and in the data source specify the context attribute source.xml
    if your xml file complies with the jnet schema your application will render it.
    Pl go through this
    Using the "Network" UI Element
    Regards
    Ayyapparaj

  • How to bind a checkbox to an item

    I started a small program to add a feature to the item master data. I just add a checkbox to the form but I don't know how to link that checkbox to the Item master data. What would be the best solution considering my source code:
    If pVal.EventType = et_FORM_LOAD And pVal.Before_Action = False And pVal.FormType = 150 Then
            Set oForm = SBO_Application.Forms(FormUID)
            Set oItem = oForm.Items.Add("EVOSS_Cut", it_STATIC)
            oItem.Top = 68
            oItem.Width = 80
            oItem.Left = 448
            Dim oTextField As SAPbouiCOM.StaticText
            Set oTextField = oItem.Specific
            oTextField.Caption = "Cut Item"
            Set oItem = oForm.Items.Add("EVOSS_Cut2", it_CHECK_BOX)
            oItem.Top = 68
            oItem.Left = 430
            oItem.Width = 20
            Dim oCheckbox As SAPbouiCOM.CheckBox
            Set oCheckbox = oItem.Specific
        End If
    Thanks a lot

    Vicent,
    add a userdatasource to the userdatasources collection of the form. Then bind your checkbox to the userdatasource.
    Generally, you might consider not creating controls via code (unless necessary for dynamic control creation). Use srf files in order to update an existing form. This way is much faster. It also is a lot easier to adapt to changes - no need to touch the source code.
    See the SAP samples or the TechDemo AddOn (/people/lutz.morrien3/blog/2004/09/21/sap-business-one-techdemo-addon-beta-out-now-and-it-is-free) for sample code.
    HTH Lutz Morrien

  • How to bind the data from user table into user report

    Hi All,
      Please assist me to bind the data from user table into user report. I did create an user table with data and create a user report template (using Query Print Layout). How can I display my data into report format which I created before? Any sample program or document I can refer?
    Platform: SAPB1 2005A
    Add On Language: VB.Net 2003
    Thanks.
    rgds
    ERIC

    Hi Ibai,
      Thanks for your feed back. I give you an example.
    Let say now i wanna print employee list, so i will go
    1. Main Menu -> Reports -> HR -> Employee List
    2. Choose the Selection Criteria -> OK
    3. Matrix will display (Employee List)
    4. I can print the report click on print button
    5. Printing report
    My target
    1. Main Menu -> Eric_SubMenu -> Employee List
    2. Matrix will display (Employee List)
    3. Print button
    4. Print report
    My problem
    Now I would like to use my own report format. My own report format means I wanna add on my logo or do some customization within the employee report. So how I am going to do? I only able to display the employee list in matrix. How do I create a new report format and display it.
    Thanks.
    rgds
    ERIC

  • How to work with checkbox in a table

    hi im working with a table than shows SQL result and i put a column with checkboxes in the table
    how can i handle the rows with the checkbox in true ? i want to do it with a button
    thanks

    Here are more resources. By the way, I don't understand what you mean by "how can i handle the rows with the checkbox in true ? i want to do it with a button "
    http://blogs.sun.com/roller/page/divas?entry=using_checkboxes_in_a_table
    http://blogs.sun.com/roller/page/divas?entry=table_component_sample_project

  • How to bind dynamically created attributes

    Hi all,
    i hv created an appl where all the attributes hv been created dynamically..
    wdContext.getNodeInfo().addAttribute("From","ddic:com.sap.dictionary.string");
        wdContext.getNodeInfo().addAttribute("To","ddic:com.sap.dictionary.string");
        wdContext.getNodeInfo().addAttribute("Subject","ddic:com.sap.dictionary.string");
        wdContext.getNodeInfo().addAttribute("Message","ddic:com.sap.dictionary.string");
    bt nw i am nt able to retrieve those.
    For ex: if i hv to set the from field to null ,hw to do so?
    (   As we used  to get it:
      wdcontext.currentContextElement().setFrom(" ");
    Plz help.
    Thanks and Regards,
    Ankita
    Edited by: Ankita Padhi on Jul 14, 2008 8:48 AM

    Hi,
    here i m giving code for your reference of a dynamic checkbox:
    IWDCheckBox checkBox =
    (IWDCheckBox) view.createElement(IWDCheckBox.class,
                                  "checkBox" + count);
    IWDMatrixHeadData checkHeadData =
    (IWDMatrixHeadData) checkBox.createLayoutData(
                                  IWDMatrixHeadData.class);
    IWDAttributeInfo attrInfo;
    info=               wdContext.nodeCheckBox().getNodeInfo().addAttribute(
         "Check" + count,          "ddic:com.sap.dictionary.boolean");
                        checkHeadData.setVAlign(WDCellVAlign.TOP);
    checkHeadData.setWidth("6%");
    checkHeadData.setColSpan(1);
    this line used to bind the context to the element:-
    checkBox.bindChecked(info);
    checkBox.setEnabled(true);
    TitleRow.addChild(checkBox);
    Hope this may help you.
    Regards,
    Deepak
    Edited by: Deepak Arora on Jul 14, 2008 9:09 AM

  • How to bind a icon in the table column

    Hi All
        I have to bind a icon in a table column.

    Choose a table cell editor for that column that is able to display an icon, e.g. Caption, Image, LinkToAction
    Create a context attribute "iconURL" under the data source node of the table.
    Bind the corresponding property of the table cell editor, e.g. Image.source, to this attribute.
    At runtime, the data source node will have elements. Element at index i will be displayed in table row i.
    Set the "iconURL" attribute of each node element to the icon URL to be displayed in the table row.
    You can use the predefined icons by using an URL of the form "~sapicons/<icon_filename>", or you can put your icons inside folder src/mimes/components/<componentName> and use the filename as URL.
    Armin

  • How to bind data for a UDO table..on to MATRIX

    hi
    i have created a Master Data Table(Video) and also created UDO object...
    i designed a form with 2 controls as text boxes and a matrix with some coloums.........
    the functioality of the form is ..when i enter some values in those controls...it should get data from DB table and should be displayed in matrix on my form. based on condition what i have entered on form controls...
    i have done the same scenario successfully when i'm dealing with other controls like textboxes...by binding data to the controls from DB..
    But i dont know how to deal this scenario where i'm populating data to matrix from DB

    i have used DataTables as u said...but still i'm getting an Exception called " Public MEmber 'Data Table" on type IMatrix not found"
    this is following code i have written in my program...
    plz give me the solution.....and code...
    Try
                oitem = oform.Items.Item("7")
                omatrix = oitem.Specific
                ocolumns = omatrix.Columns
                oform.DataSources.DataTables.Add("[@VIDS]")
                '    odbdatasource = oform.DataSources.DBDataSources.Add("[@VIDS]")
                omatrix.DataTable = oform.DataSources.DataTables.Item("[@VIDS]")
                '// Ready Matrix to populate data
                omatrix.Clear()
                omatrix.AutoResizeColumns()
                '// Querying the DB Data source
                odbdatasource.Query()
                '// setting the user data source data
                omatrix.LoadFromDataSource()
                ocolumn = ocolumns.Item("V_5")
                ocolumn.DataBind.SetBound(True, "[@VIDS]", "Code")
                ocolumn = ocolumns.Item("V_4")
                ocolumn.DataBind.SetBound(True, "[@VIDS]", "Name")
                ocolumn = ocolumns.Item("V_3")
                ocolumn.DataBind.SetBound(True, "[@VIDS]", "U_CardCode")
                ocolumn = ocolumns.Item("V_2")
                ocolumn.DataBind.SetBound(True, "[@VIDS]", "U_ShelfNumber")
                ocolumn = ocolumns.Item("V_1")
                ocolumn.DataBind.SetBound(True, "[@VIDS]", "U_SPACENumber")
                ocolumn = ocolumns.Item("V_0")
                ocolumn.DataBind.SetBound(True, "[@VIDS]", "U_RentedAvailable")
            Catch ex As Exception
                SBO_Application.MessageBox(ErrorToString)
            End Try

  • How to use dynamic query for Result table

    Hello Experts,
    I want to use dynamic query and then display the result in the assignment block.
    Using dynamic query BTQAct and BTQRAct and base on some search criteria i want tofilter and then append the result in the result table of that custom context node, and then it should display the result in the view in UI.
    SO can you please provide me the samplle code on how to use the dynamic query and append in the result table.
    Regards.

    Hi,
    Please find below sample code:
    data:  query         TYPE REF TO cl_crm_bol_dquery_service,
               result        TYPE REF TO if_bol_bo_col.
    DATA: lt_params       TYPE crmt_name_value_pair_tab,        
               lwa_params      TYPE crmt_name_value_pair.             
    query = cl_crm_bol_dquery_service=>get_instance( 'BTQAct' ). " Get instance of dynamic query
    Set general query parameter for maximum number of hits
          lwa_params-name = 'MAX_HITS' .
          lwa_params-value = '50'.
          APPEND lwa_params TO lt_params.
          query->set_query_parameters( it_parameters = lt_params ).
          query->add_selection_param( iv_attr_name = 'OBJECT_ID'
                                                    iv_sign      = 'I'
                                                    iv_option    = 'EQ'
                                                    iv_low       = <lv_objectid>
                                                    iv_high      = '' ). " Set your search criteria. Repeat this code if you have multiple parameters
    "You can find possible search options for a query object in  GENIL_BOL_BROWSER
    result ?= query->get_query_result(  ).   " Get result from your search query
    me->typed_context-> <your result context node>->set_collection( result ). 
    Here you will have to create a context node in your view which would refer to query result object like for BTQAct its BTQRAct                      
    Hope this helps.
    e Regards,
    Bhushan

  • How to bind simple type to a table column

    Hi All,
    I have created a simple type in Dictionary. With some Key and value pair. I want to bind this simple type to a table column.
    Does any body have suggestion how can I do that?
    Regards,
    Maya.

    Hi Maya,
    There is another solution for ur Prblm.
    Plz let me know if ur table is having any key,Value(desc) for that perticular dropdown.If it is ther means u can populate the dropdown By using this code.
    1.ISimpleTypeModifiable objXX = null;
    2.IModifiableSimpleValueSet objYYY = null;
    objXX =      wdThis.wdGetAPI().getContext().getModifiableTypeOf("ctx_ConveyanceType");
    objYYY =                objSimpleTypeConveyanceTypeData.getSVServices().getModifiableSimpleValueSet();
    3.Get the size of that Table and get the Key and Value Descriptions.
    4.Finally set it to DropDown
    ex:objYYY .put(key,ValueDesc);
    One more thing u need to create one string attribute for that Dropdown lik:ctx_strXX,type is string.
    Populate this dropdown using above Code.
    This method is applicable only for table coontains Key,Value for that Dropdown.
    Let me know if u hav any doubts,
    Regards,
    Lavanya.G

  • How to create dynamic rows in a table

    Hi All,
    in my application i want to create rows dynamically by pressing enter button or else i can use button,once i click the button new row should come,that row should allow to enter values,like input field.
    please can any one help me in this.
    regards,
    sush

    Hi Sushma,
    If i'm right ,u want to add a new row on button...
    for(int i=0; i<1;i++)
    IPrivateContractOverView.I<table Node>Element elem=wdContext.create<table node>Element();
      elem.set<table value attrbute1>("");
    elem.set<table value attrbute2>("");
    wdContext.node<table Node>.addElement(elem);
    Here you  can set any default values in place of "".
    hope it hlps u..
    Regards
    Khushboo

Maybe you are looking for

  • Why it takes a long time for my MacBook Air to turn on?

    I brought my MacBook Air at a Power Mac Center to fix vertical lines on the screen. The vertical lines were removed. But since then, when I turn on my laptop, it takes a long time before it actually turns on. Sometimes, after pressing the power butto

  • Advise on complex scenario. Correlation based on file name

    I need to process all *.xml files in a folder, but I should only process a specific .xml file if I find another one .ctl with the same name. That is. I may have 3 .xml files in a folder (a.xml, b.xml and c.xml), but as I have only one .ctl in the sam

  • Airport Extreme Configuration

    Hi all. I'm new to using airports and would like some advice on configuration methods. I'm bringing in a new fibre connection to our office and will be connecting an airport to the network. It will be supplying internet uisng dhcp both on the LAN and

  • Custom Window Decorations: Adding qmark icon for online help

    Hi, All - Is it possible to customize a window's decoration (terminology?) to add a Help icon to a dialog's frame, so that it sits beside the Close (X) button in the upper right corner? Can't find any doc on how to do this in the SDK manuals or tutor

  • Illustrator blurred edges ?

    above image clears what is the problem ! when u draws rectangle in illustrator, it's edges doesen't looks same at all times ? look first rectangle (bad) . . . The problem isn't appears in photoshop but in illustrator it does. In photoshop, edges look