Dynamic rows in TableView Iterator

Hello All,
I am developing an application in which there would be a TableView with last column as a button. OnClick event on the button should add the row below the current row (the facility should be like an Excel spreadsheet where we can insert the rows below). Can it be acheived by re-populating the internal table which his attached with TableView Control.
Is it Ok to use TableView in such a condition or we have to go with pure HTML tables or some kind of ActiveX controls?
Thanks in advance.
Thanks And Regards
Rajeev Patkie

Hallo Rajeev,
> Is it Ok to use TableView in such a condition...
It is OK to use the tableView as long as it works for you! Once we run into problems, then of course one has to see if the functionality is "working as designed" and whether it was designed to handle your specific request.
However, what you want to achieve sounds relatively harmless. Just use onclick on the button to trigger a server round trip. (Nice idea: write the row index directly into the onclick string!). Then add a new empty row into your at the correct index (see ABAP documentation), and just render table new.
All of this should be relatively easy. Why don't you try, and let us see what you achieve.

Similar Messages

  • Radiobuttons in tableView/iterator environment

    Hi,
    I'd like to build and display a matrix of radiobuttons with a name/title for each row and also for each column. Every row of the matrix should form a radiobutton group, i.e. per line one and only one radiobutton should be selectable.
    Both dimensions of the matrix are dynamic so I thought I could use a <htmlb:tableView> with a column-definitions table defining the number and names of the columns, the 'actual' table containing the names of the rows and an iterator which just renders these names in the first (i.e. 'zeroth'-) column and radiobuttons in all other columns.
    The code in <i>if_htmlb_tableview_iterator~render_cell_start</i> pretty much contains only the lines
    rowindex_as_id  = p_row_index.
    colindex_as_key = p_column_index.
    p_replacement_bee = cl_htmlb_radiobutton=>factory( id  = rowindex_as_id key = colindex_as_key ).
    Unfortunately the radiobuttons don't get rendered, the resulting page contains the desired table with the row and column titles but empty cells. The html sources contains the comments
    <!-- *** Unidentified control NOT rendered *** -->
    Now, this might be due to a missing radiobutton group that would contain the radionbuttons of one line.
    I don't understand however how a <i>cl_htmlb_radiobutton</i> object gets to know its radiobutton group container. Neither the factory used above nor the constructor nor any other method allows to set a reference to a radiobutton group object. It does contain an attribute <i>radiobuttongroup</i> though, but this is protected!?!
    Does anybody have an idea/experience with this?
    Regards,
    Sebastian

    Hallo Sebastian,
    First let me address your questions concerning the "parent" of a tag. In principle it is only possible to process a tag in context of a BSP page. In this context "process" means either writing the tag on a BSP page, or dynamically processing the tag. When the tag is processed, it is placed on a stack. The opening sequence puts the tag on the stack, the close sequence removes the tag from the stack. Each tag can query the stack of previous tags to find a specific type or parent. Typical code would be:
      DATA: rbg TYPE REF TO CL_HTMLB_RADIOBUTTONGROUP.
      rbg ?= m_page_context->GET_CLASS_NAMED_PARENT(
              class_name = 'CL_HTMLB_RADIOBUTTONGROUP' ).
    <b><u>OR</b></u>
      DATA: rbg TYPE REF TO CL_HTMLB_RADIOBUTTONGROUP.
      rbg ?= m_page_context->GET_ELEMENT_NAMED_PARENT(
              extension = 'HTMLB'
              name = 'RADIOBUTTONGROUP' ).
    <b><u>OR</b></u>
      DATA: rbg TYPE REF TO CL_HTMLB_RADIOBUTTONGROUP.
      rbg ?= m_page_context->GET_DIRECT_PARENT( ).
    Next aspect is the error message "Unidentified control NOT rendered". What this means is that deep down in the code we get a reference onto a control which we can not render anymore. It is suddenly not known. Hmmm... let us dig.
    What I then checked is with the use of the <htmlb:radioButton>. This control insist that it can only be used inside a <htmlb:radioButtonGroup>. Which actually makes sense. So if no group, then raise error.
    Which brings us to your message above. While deep in the rendering, these types of unknown problems are caught and dropped. This is when you get this generic message. It is actually the exception about the missing radioButtonGroup on the stack.
    What we usually do, is place the <htmlb:radioButtonGroup> around the <htmlb:tableView>. But this only works when you are using one column of radioButtons. Which you are not.
    Current feeling would be to look at some executive programming: consider to use a <phtmlb:matrix> and just roll your own. For an idea of where the journey can go, look at the examples of <phtmlb:formLayout>.
    brian

  • TableView Iterator in WebDynpro as in BSP

    Hi all,
    i'm planning to move from BSP to WebDynpro ABAP and have a question:
    Does WD ABAP provide the same kind of <htmlb:tableView> as BSP? Especially, does it support the concept of an tableview iterator?
    Thx & Regards,
    Daniel

    Yes you'll find everything.
    You'll find also the ALV extension of a table.
    I was familiar with iterator and I like it so much; in WDA you can reach the same result but in a different way.
    Basically you have to prepare, in advance, all the data in the table rows and then in the table configuration you'll describe the rules for each column (even with variants per row).
    You have to study the Table UI object with table cell variant and then ALV features.
    Sergio

  • Attributes in tableview iterator

    how to retrive my inputField value in tableview iterator ?
    I have a page with inputField : eno
                    & tableview (and onclicking the cellvalue in the column it goes to other page)
    <i>
    <b> here i want to get the value of my inpufield </b>
    concatenate 'preview.htm?ref_no=' wf_text into wf_url.
          call method cl_htmlb_link=>factory
            exporting
              id        = p_cell_id
              reference = wf_url
              target    = '_self'
              text      = wf_text
            receiving
              element   = p_replacement_bee.
    </i>
    Pts Assured.
    Thanks,
    JBP.
    I have added the field also in the row iterator and now able to get its value.
    Message was edited by: P24101990

    Hi Mark,
    Thanks for your reply. I tried that in DO_INIT and in DO_REQUEST as well. I started of this application well with the values selecting from Dropdown and then rendering the table columns. But now I have commented everything and just trying to render one column of the table....
    I have one concern.
    I have declared like this
    tv_iterator type ref to ZITERATOR.
    and in DO_INIT I have instantiated. Create Object tv_iterator.
    If you have any suggestions please let me know....
    Thanks

  • Passing Parameters to tableview iterator class

    Hi all,
    I have a tableview with 2 fields say A and B.
    When i click any of the field(row) i want to open a new page with the parameters A and B.
    I have used iterator and able to get the value for either  field-A or field-B..How to get both field values in
    IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START
    This my code,
    *Oncreate*
    create object tv_iterator type ycl_salary_review.
    method if_htmlb_tableview_iterator~render_cell_start .
        data: wf_text type string,
            wf_url type string,
            test type char1.
      data: htmlstring type string ,
      rono type string .
      field-symbols: <fs> type any ,
                       <l_a> type any,
                     <l_b> type any.
      assign p_row_data_ref->* to <fs>.
      case p_column_key.
        when 'A'.
          assign component p_column_key of structure <fs> to <l_a>.
          wf_text = <l_a> .
        concatenate 'page2.htm?field_a=' wf_text into
          wf_url.
          call method cl_htmlb_link=>factory
            exporting
              id        = p_cell_id
              reference = wf_url
              target    = '_self'
              text      = wf_text
            receiving
              element   = p_replacement_bee.
      endcase.
    Rgds,
    Venkonk

    Hi Ven,
    pls Go thro this step-by-step creation of Tableview with iterator...
    /people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator
    Look at the Standard BSP Application BSP_MODEL --> Page Name:- table.htm
    *pls assign points,if link is useful*
    Regards
    CSM reddy

  • Link inside tableview iterator

    Hi Experts,
    I kept a link inside tableview iterator it is working fine, when i click the link it shows error, i cant understand it.
    The error is
    The following error text was processed in the system:
    BSP Exception: Das Objekt targetbspapplication/page.htm in der URL /sap(bD1lbiZjPTgwMA==)/bc/bsp/sap/ztableview1/targetbspapplication/page.htm?link=WWW.SDN.SAP.COM ist nicht gültig.
    please help me to solve it.
    Thanks & Regards,
    Arun

    Hi Arun,
    You can try the method mentioned below:
    RENDER_CELL_START
    when 'ACTION'.
            if p_edit_mode is not initial.
              data: bee_table  type ref to cl_bsp_bee_table,
                       link       type ref to cl_htmlb_link.
              data: cell_id_del(20).
              cell_id_del = p_cell_id.
              create object bee_table.
              link ?= cl_htmlb_link=>factory( id = p_cell_id
                                               text = 'Modify Entries'
                                               on cli ck = 'modify').
              bee_table->add( element = link level = 1 ).
              p_replacement_bee ?= bee_table.
            endif.
    OnInputprocessing of BSP page:
    when 'modify'.
          gv_flg_tv_popup = 'X' .
          gv_matcode = gs_materials-matnr.
    In Layout:
    <%
      if gv_flg_tv_popup is not initial.
            %>
            <s cript type='te xt/ jav ascript'>
            var m atcode="<%= gv_matcode %>";
            windo w.open('tv_popup.htm?ma tcode='+ma tcode+'&end','my window','width=450,height=230,res izable=no');
            </s cript>
            <%
      clear gv_flg_tv_popup.
            %>
            <%
      endif.
            %>
    In the above code , I have a tableView in which last  column is a link.On Click of this link a new window is opened in whicn details of one material is displayed in tableview.on click of link OnInputprocessing is trigered and I read the row no for which link is clicked and the material numnber for that row.Now in OnCreate of popup window I fetch the data for that material and display it in the tableView.
    Regards,
    Anubhav

  • Dynamic row in STRUTS2

    dear java,
    Help needed for updating an list in jsp with values added as dynamic row in STRUTS2.
    I have a table displaying data from list (<s:iterator>). It displays 2 rows. I have a button which on clicks added one more row.. blank row (consists, textfields).. in which data is added. now on submit, i need to update list.
    Any help would be much appreciated!

    tnx friend.,
    anyway i got the result.
    instead of using <s:textfield name="textFields[0]" />, i have replaced for (within JS method)
    <input type='text' name='locationId[" + num + "]' value='' id='dyamicRowAction_locationId_" + num + "_'/>
    (its actual replacement html tag for S2 tag - get it from view source ).

  • Dynamic Rows in Report Painter

    Hello everyone,
    I'm new to report painter and m using the SAP Library help  material to understand report painter. I've one query though i.e
    Is it possible to create a report hrough report painter with dynamic rows ? if yes then pls let me know how.
    Regards
    Anik

    Thank you.
    See I have the below Rows
    Total Revenue
    Cost2
    Cost3
    Direct Cost
    Gross = Total revenue - Direct Cost
    Gross % = (Gross/Total revenue ) * 100
    I have Columns as with basic Key figures and Formulas
    Year(basic key Figure)
    Year+1(basic key Figure)
    Total = Year + (Year+1)
    Its giving me correct values in case of Basic Key figures and not in the formula case.
    It giving error when there is formula both in Row and Column.
    In the above case last row and last colum. Only Column formula is getting implemented.
    Here for example I have mentioned 4 rows and 4 columns.. But I have 15 Rows and 30 columns .. out of which 15 rows and columns have formulas...
    % Rows are problem.. which gives me errors... I tried using Special cells, but I am not 100% sure how to use them.
    I would be very thankful if you can help me out.. Please

  • How do I set the value of a dynamic row text field

    I have a repeated row form which contains a button and multiple text fields.  There is a text field (Input Data Field) further up with some information I want to place in the table and multiple buttons that I want to read the value of and set to the table.  I apologize there are multiple questions I have and I am using pseudocode to describe it.
    Top form looks like
    InputField
    | ButtonX1 | ButtonY1 | DescriptionX1 (read only Text Field)
    | ButtonXn | ButtonY1 | DescriptionXn
    OutputRow looks like
    | ButtonOutput | OutputField1 | OutputField2 | OutputField3 |
    So I would like it to do
    ButtonX1.click
    OutputTable.OutputRow.addInstance(true)  //this works - everything else I have questions on
    OutputTable.OutputRow.OutputField1.rawValue = DescriptionX1.rawValue
    Question 1
    How do I address the location in each table to set a value
    Question 2
    How do I get the value of the description field in the same table and row as the button
    I would like to say something to the effect of  OutputTable.OutputRow[??].OutputField1.rawValue = this.parent.DescriptionX
    OutputTable.OutputRow.OutputField2 = InputField.rawValue
      Same question as above - how do I specify a dynamic row - is this the proper syntax for getting the value from the input field?
    OutputTable.OutputRow.OutputField3 = this.ButtonLabel
    Question 3
      How can I get the value of the button's label to set in the field
      There should be very many of these buttons and buttons will be added - I would prefer to set the value based on the button's label to make the value easier - not requiring changing the code
    Question 4 - unrelated to those above.
    Is it possible to build the first table
    | ButtonX | ButtonY | Description |
    from an XML File.  I have seen examples of how to build if it is just data, but can the XML be pushed into a form with code to do the above actions?

    Each object in a form must have a unique name. I doing so it is not neccessarily the name but the path or SomExpression associated with that object that must be unique. In your case you have a Table.Row.object configuration. The Row is the part that is repeating so to give each object a unique name an instance number is placed on the repeating part. So objects in the 1st row woudl be Table.Row[0].object...objects in the second row woudl be Table.Row[1].object etc .....You can see this by adding a debug instruction on the Enter event of the description field. Put the code app.alert(this.somExpression) and when you enter the field you will see what the somExpression is. Do this for a few rows and you will see the pattern (don't forget to remove the debug code from the enter event). Now you know what you have to use to address the fields. If no instance is given it is assumed to be 0 ..that is why only the 1st row is being affected.
    So now to answer your questions:
    Question1: The square bracket notation is an issue for javascript (this is the notation for an array) so we have to use a different means of addressing the field to include the instance number. So to address the Description in the 3rd row we woudl use:
    xfa.resolveNode("Table.Row[2].Description").rawValue = "This is my new description";
    Note that the instance number is 2 for the 3rd row because the instance numbers are 0 based.
    Question2. The resolveNode notation allows you to pass a string so you can also concatinate expressions to make the string. If you are writing code on a button in the same row you can get the instance that you are on by using the expression this.parent.index. The "this" portion refers to the current object (the button) and the parent.index gets you th eindex of the Buttons parent. If the button is embedded deeper in a hierarchy then you can continue to add parent indicators until you get back to the node that you want. So rewriting your expression from Q1 it woudl be:
    xfa.resolveNode("Table.Row[" + this.parent.index + "].Description").rawValue = "This is my new description";
    Question3: The buttons caption can be retrieved by using ButtonName.caption.value.text.value
    Question4: When you say build from an XML file. What are you expecting to come from the XML file? The caption that goes on the button? Typically the XML file carries data (not to say that it cannot carry other things). Just need a bit of clarification on this one first.
    Hope that helps
    Paul

  • Error while saving dynamic row values of datagrid with record.

    hi friends,
    i am trying to add dynamic row in datagrid and save that value with record.i succeeded in first part while i am saving the record the error show like this.
    errro:Property fromAmount not found on com.ci.view.Task and there is no default value.
    how i resolve this error.
    any suggession welcom
    thanks in advance.
    B.venkatesan
    code:
    package:
    package com.ci.view
        [Bindable]
        public class Task
            public function Task(frmAmount:String,toAmount:String,commissionPercentage:String)
                this.frmAmount=frmAmount;
                this.toAmount=toAmount;
                this.commissionPercentage=commissionPercentage;
            public var frmAmount:String;
            public var toAmount:String;
            public var commissionPercentage:String;
    main mxml:
    [Bindable]
                private var tasks:ArrayCollection;
                private static const ADD_TASK:String= "";
                private function init():void
                    tasks = new ArrayCollection();
                    tasks.addItem(new Task("0","1000","0"));
                    tasks.addItem({frmAmount:ADD_TASK});
                private function checkEdit(e:DataGridEvent):void
                    // Do not allow editing of Add Task row except for
                    // "Click to Add" column
                    if(e.rowIndex == tasks.length - 1 && e.columnIndex != 0)
                        e.preventDefault();
                private function editEnd(e:DataGridEvent):void
                    // Adding a new task
                    if(e.rowIndex == tasks.length - 1)
                        var txtIn:TextInput =TextInput(e.currentTarget.itemEditorInstance);
                        var txtIn1:TextInput =TextInput(e.currentTarget.itemEditorInstance);
                        var txtIn2:TextInput =TextInput(e.currentTarget.itemEditorInstance);
                        var dt:Object = e.itemRenderer.data;
                        // Add new task
                        if((txtIn.text) != ADD_TASK)
                            var x:String=String(txtIn.text);
                            tasks.addItemAt(new Task("", "", ""), e.rowIndex);
                        // Destroy item editor
                        commPlanDetGrid.destroyItemEditor();
                        // Stop default behavior
                        e.preventDefault();

    Venktesan,
    You are trying compare String and int..! which is not possible try to case the txtIn.text to int using parseInt(txtIn.text).
    ORIGINAL:
    if(txtIn.text != ADD_TASK).---->error : Comparison between a value with static type String and a possibly unrelated type int
                        tasks.addItemAt(new Task(txtIn.text, 0, ""), e.rowIndex);----> error:Implicit coercion of a value of type String to an unrelated type int.
    EDITED:
    if(parseInt(txtIn.text) != ADD_TASK).---->error : Comparison between a value with static type String and a possibly unrelated type int
                        tasks.addItemAt(new Task(parseInt(txtIn.text), 0, ""), e.rowIndex);----> error:Implicit coercion of a value of type String to an unrelated type int.
    Thanks
    Pradeep

  • Dynamic rows in Table Control

    Hi Experts,
    My Requirement is create a table control with 5 coloumns. The rows have to be displayed dynamically...
    I created a screen , and placed a table control.
    For eg :
       if my internal table having 2 entries , then the table control should only have two rows....(no disable/greyout)
       if internal table having say 40 entries , then the table control should have 40 rows...
    Thanks,
    Lakshmiraj.A

    Hi,
    Refer
    table control dynamic rows
    Dynamic rows increment according to user input in Table Control Module Pool
    Hope this helps
    Sumana

  • How can I change the style of a row in tableview?

    Hi,
    How can I change the style of a row in tableview, for example ,I have 10 items in table view, and I'd like to change row 1,4,10 background-color:red; font-family:Arial ,Font-Weight:BOLD.
    Any suggestion?

    Yes, I knew how can I change the style using cell factory. there is a lot of work to do if it has so many columns in table view. we need to implement every cell factory, Do we have a simple way to change the whole row style , just like fabsav said, I 'd like to set the special row like this line:
    tableview.getItems().get(i).setStyle("myRowstyle"); And I found a bug if I implement my functionality with cell factory way, I can't change the cell style after rendering cell.
    protected void updateItem(Object object, boolean empty) {
          super.updateItem(object, empty);
    }updateItem() was only triggered while cell is being rendering, there is no way if I'd like to change the cell style after rendering event.
    Hi fabsav, How can I apply a CSS class to a specific row? Can you please provide a short example?
    Edited by: imtoocute on Aug 28, 2012 10:31 AM

  • Problem with tableview iterator

    Dear friends.
    I try to adopt tableview iterator in my customer's BSP pages. So, I programmed test page.
    METHOD if_htmlb_tableview_iterator~render_row_start .
      m_row_ref ?= p_row_data_ref.
    ENDMETHOD.
    M_ROW_REF is "Static Attribute" and "Public" and "Type Ref To Z3TYDISP"
    z3tydisp has structure as below
    REQNO          NUMC     12
    VGUBUN          CHAR     1
    DSCOFVGUBUN     STRING     0
    REQDT          DATS     8
    RNAME          CHAR     10
    VCOMP          CHAR     30
    VNAME          CHAR     10
    VPLACE          CHAR     5
    VPLACEDSC     CHAR     20
    APPROVAL     CHAR     1
    DSCOFAPPROVAL     STRING     0
    AND... p_row_data_ref has structure below
    REQNO     N     12
    VGUBUN     C     1
    DSCOFVGUBUN     g     0
    REQDT     D     8
    RNAME     C     10
    VCOMP     C     30
    VNAME     C     10
    VPLACE     C     5
    VPLACEDSC     C     20
    APPROVAL     C     1
    DSCOFAPPROVAL     g     0
    In my option, p_row_data_ref has same structure compared with z3tydisp. But there is "CX_SY_MOVE_CAST_ERROR". How I have to define "z3tydisp"????

    >><b>M_ROW_REF is "Static Attribute" and "Public" and "Type Ref To Z3TYDISP"</b>
    instead of this make your M_ROW_REF a instantaneous attribute. since static attribute are intantiated only once when object created and are shared by all other intances. m_row_ref contains data about the table you are going to render using tableview. so it should be public, so that get different data for different iterator objects.
    your p_row_data_ref must be of type ref to data which is superior class of data types.
    and if you have defined iterator "IF_HTMLB_TABLEVIEW_ITERATOR" in your interfaces. then you need not to define structure for p_row_data_ref, its already there in interface.
    hope this will solve your problem,
    regards,
    hemendra

  • How to set boundry value in dynamic rows in datagrid

    hi friends,
    I am new to flex.i want to add dynamic rows to datagrid that means.once i enter the first record i want to press tab button then it will automatically  go to the second row.and update the record continuously.once it reach the maximum value means the next row will not be edit.
    mxkimum value =10000
    from value            to value        percentage
    0.01                        2000             10
    2000                         8000           20
    8000                        10000               30
    after it reach 10000 next row will not edit,this is i want how i do this please help.
    If any suggession tel
    thanks
    B.venkatesan

    Hi,
    As Armin said use the following:
    wdContext.nodeXXX().currentXXXElement().setAttributeValue("attributeName", value)
    Here you give the value as value of simpleType and not its description.
    thanks & regards,
    Manoj

  • I need to add the Dynamic rows in the Jform

    {color:#800000}*I have used Jform in the net beans... when the submit button i clicked then the dynamic rows should be inserted.. how can do that... i have used DefaulttableModel but in netbeasns it is not supporting i dont know how to add please tell me where i have to add the changes*{color}

    vidhyaprakash wrote:
    I have used Jform in the net beans... What is a Jform?
    when the submit button i clicked then the dynamic rows should be inserted.. Is this Swing coding? When I think of submit buttons, I usually think of Java Server Pages.
    In other words, if possible, please clarify your question as details matter here. Also, showing the code you've tried would help too.
    Good luck.

Maybe you are looking for

  • How to connect 2nd audio to KT4V

    Hi all, I have just purchased a KT4V board,  I can only find 1 cd (CD1) audio input on the board, I want to install a DVD rom as well as my current burner, how do I get audio to the board?

  • Lion thinks docx file is an alias -- it's not.

    In the past week (since 10.7.1), Mac users at my office have occasionally run into a bug where files on a Windows smb share have an orange label and are seen as broken aliases, and so cannot be opened. The files were created and edited on Macs. Copyi

  • Missing points for buy 3 games 25$ reward points

    Need help with my account...I am missing points for the buy 3 and receive 25 ...i have sent mike a pm with all my account information... thank you for your help.... Solved! Go to Solution.

  • LIV posting with reference of delivery note

    Hi all,    I have a requirement to create LIV with reference of delivery note. Can you please guide me which BAPI function module that I can use and the detailed steps. regards, kumar Moderator message: please work yourself first on your requirement.

  • How to rename stored procedure on existing report

    I've got several reports that are based on stored procedures starting with the prefix qRpw.  I needed to change the name only of these stored procedures. The actual code within and all the data that the report is bound to stays the same. so say the s