Skip to Content
avatar image
Former Member

Create check boxes in table dynamically

Hi All,

i have a requirement in my webdynpro application.Using Funtion module i am displaing the data in a table format.

now the data displaing in the below format.

ProductId DESC Checked

___________________________________

Row1 111 XXXX

___________________________________

Row2 221 yyyyy

321 zzzz

___________________________________

SELECTtALL UNSELECTALL

In the above 3rd colmun i have to display check boxes for every productID. for example in first row i have only one productId

so one check box needs to display and in the second row two productID available,here two check boxes needs to display.

And those check boxes links to SELECTALL and UNSELECTALL buttons in the application.When user clicks on SELECTALL button

all the checkboxes sholud be checked or unchecked.

Can any one help me on this requirment.

Regards,

Suresh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jun 21, 2010 at 10:29 AM

    Hi,

    In the Node which u have created for displaying the table add one more attribute "SelectEntry" of type "boolean" and add Checkbox UI element in the new column.

    Bind the selected property to the Boolean attribute created.

    On click on "SELECTALL" write the following code:

    for(int i = 0; i<<node>.size(); i++)
    {
      wdContext().node<node>().get<node>ElementAt(i).setSelectEntry(true);
    }

    On click on "DESELECTALL" write the following code:

    for(int i = 0; i<<node>.size(); i++)
    {
      wdContext().node<node>().get<node>ElementAt(i).setSelectEntry(false);
    }

    Hope this helps.

    Regards,

    Poojith MV

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi PortalAD,

      Are you getting the same table with webdynpro as described in your post #2 ?

      As I understand, each table row will hold 1 record of (ID, desc & checkbox) and in this case, steps that Poojith described will work.

      Kindly give us more description of the requirement.

      cheers,

      Nikhil Bose

  • avatar image
    Former Member
    Jul 12, 2010 at 09:05 AM

    Hi All,

    Can anyone provide your suggestion for the below requirment.

    Actully i have a table with 3 columns ,it seems like in the below format.

    PATID is unique and for each PATID we have multiple ITEMS.Here i need to display checkboxes in third column .

    Based on the items we need to display checkboxes dynamically.Can anyone provide ur valuble inputs please.

    Based onthe itemns

    PATID ITEMS ACTIVATE

    -


    1 xxxxxx [ ]

    xxxxxx [ ]

    -


    2 XXXXXX [ ]

    XXXXXX [ ]

    XXXXXX [ ]

    -


    3 XXXXXXXX [ ]

    -


    Regards,

    portalAD

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      You can't do quite what you want. WDP Tables can only contain one control per cell.

      But why have you decided to structure the table as you have? Why don't you create one line (and therefore one checkbox) per item, and have another field to indicate the PATID? You could then sort by PATID by default, so your users could easily see which items belonged together.

  • avatar image
    Former Member
    Jul 12, 2010 at 07:09 PM

    Hi PORTALAD,

    Why don't you try the TableRowGrouping?

    By using the TableRowGrouping feature of the table, you can group the rows in your table by the PATID. The grouped rows will be expandable. When you expand these rows, you can display the Item ID and the Checkbox for each PATID.

    You can make your table display like this:

    ________________________________________________________

    Item-Id Check-Box

    _______________________________________________________

    PATID-1(Expanded)

    -


    Item-id-1 Check-Box-1

    -


    Item-id-2 Check-Box-2

    ________________________________________________________

    >PATID-2(collapsed)

    ________________________________________________________

    >PATID-3(Collapsed)

    ________________________________________________________

    Regards,

    Ajay

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      PORTALAD,

      In that case the only option you have is to have the table with the binding to the context node with the following structure and bind it to your table:

      DataNode

      |__PATID

      |

      |__ItemId

      |

      |__Activated(attribute of the type boolean for the checkbox)

      When you create and add the elements to this DataNode, you can set PATID,ItemID and Activated(true/false) for each item.

      Regards,

      Ajay