Skip to Content
avatar image
Former Member

How to make textview table field as Inputfield dynamically

hi experts,

I am new to the web dynpro and i am facing 1 problem. i have to create 1 table in this table i have to make some fields inputted and some fields textile, and the 1 textile i have to change dynamically to Inputted during runtime of program based on the input of other field.

I am not able to achieve this. Please can someone give me the detail input so that i can solve this problem.

Thanks and Regards,

Vicky

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Sep 21, 2010 at 05:49 AM

    HI,

    Create 2 cell variants for that column. In one cell variant put input fields as cell editor and text view as the cell editor for other cell varinat.

    BInd the text view and input field to the same attribute.

    For cell varinat of text view view give the varinat name as T and for Input filed give the name as I.

    I have trribute in the same node which is binded to the able to contain the selected cell variant value.

    Bind this attribute to the SELECTEDCELLVARIANT Property of the table column.

    At runtime populate this selected cell varinat attribute value with T ot I based on the requitrement.

    You can also refer the below forum:

    [Cell editor change dynamically|Dynamically change the cell editor in the table control;

    Regards,

    Madhu

    Edited by: madhu reddy on Sep 21, 2010 11:23 AM

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      >

      > Thanks Madhu for your quick reply. Now i can make that column Input and text. but i want that based on that row. now when i am

      > giving this conditioins whole column is getting change. how to do it only for perticular row.

      >

      > Thanks and Regards,

      > Vicky

      Have an attribute in the context NODE which is binded to the table.bind this attribute to the SELECTEDCELLVARIIANT.Poplate the value as I when you need input filed and T when you need text view.

      Regards,

      Madhu

  • Sep 21, 2010 at 06:48 AM

    Hi Vicky,

    Here is more more approach:

    Make all the columns as input field. Create a boolean attribute and bind it with the Read only property of the column's input field. Now according to the logic in ur code, just set this attribute accordingly.

    Also refer editing-a-single-selected-row-of-the-table

    I hope it helps.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 21, 2010 at 07:09 AM

    Hi Vicky,

    Go to Layout, there Right click on Table Properties->create Binding. Here you can find the context you have bound the table to, now you can find Cell Editor of Table Column. Choose Input Field from drop down for columns which you need to be edited.

    Now drill down table column, here you bind the read_only property of input_field to seperate attribute in context read_only( need to create this attribute in context which table is bound to).

    Now if user selects the row and clicks edit/update button, get the row selected through get_lead_selection method and set the read_only attribute for this row to abap_false. This makes the row editable.

    With Regards,

    Shridhar

    Edited by: shridhar narasimhan on Sep 21, 2010 9:10 AM

    Add comment
    10|10000 characters needed characters exceeded