Skip to Content
author's profile photo Former Member
Former Member

Working with Table Check Box's

Hi Guru's

I want to implement following scenario

1-->in a table i have two columns with check boxes and N no of rows, these should be enabled depends on the web service.

2 --> and i have to implement "Select/Deselect all" check boxes for this

3 --> and i can able to select/deselect check boxes as i want in a table

4--> when i click on save button all the checked data should be stored in a data base as a flag.

So would you please help me in this scenario how do i need to capture the checkbox value in a table?

Thanks in advance

Anu

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 19, 2011 at 05:45 AM

    Hi,

    Your Question,

    1-->in a table i have two columns with check boxes and N no of rows, these should be enabled depends on the web service.

    Answer,

    Add CheckBox UI element to the column of the table and bind its Checked property to an attribute of type boolean, added in the table node. While populating this node with the data from web service set this boolean attribute with true or false as needed.

    Your Question,

    2 --> and i have to implement "Select/Deselect all" check boxes for this

    3 --> and i can able to select/deselect check boxes as i want in a table

    Answer,

    Remove the Header UI from each column of the table. Add a FixedTopCell to each column as follows. In the context menu of each column select Insert --> FixedTopCell --> TableStandardCell.

    Add a CheckBox UI to this FixedTopCell, in the columns having checkbox and add a Textview UI for the remaining columns. Create a context attribute say Va_CheckUnCheckAll, of type boolean and bind it to Checked property of the checkbox added in the fixedtopcell and also create an actionhandler and bind it to OnToggle event of this checkbox. In this action handler, if the value of the attribute Va_CheckUnCheckAll is true then loop through the table node and set boolean attribute in the table node bound to that column as true, else if the value of the attribute Va_CheckUnCheckAll is false set the boolean attribute in the table node to false.

    Your Question,

    4--> when i click on save button all the checked data should be stored in a data base as a flag.

    Answer,

    Loop thourgh the table node and based on whether the boolean attriubte in the table node bound to the checkbox UI, is true or false, set the flag appropriatly.

    Regards,

    Vishweshwara P.K.M.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Anusha,

      I guess, you have missed out something. If you had followed my earlier replay, you should not have faced this problem, as there is no event bound to the check box added in the table column and lead selection has no role to play in this approch. As explained earlier the check box should be bound to an attribute of type boolean created under the table node. So if the table has 20 rows, then there will be 20 elements in the table node and in each element, the instance of the boolean attribute will be true if selected else will be false. So as mentioned in 4th point in my previous replay, check for the value in that variable by looping through the table node and you should be able to resolve the problem. Below is the example assuming Va_CheckBoxValue is the name of boolean attribute.

      int noOfRows = wdContext.node<TableNode>.size();
      IPrivate<ViewName>.I<TableNodeElement> element = null;
      for (int loopIndex = 0; loopIndex < noOfRows; loopIndex++) {
      element = wdContext.node<TableNode>().<TableNodeElement>At(loopIndex);
      if(element.getVa_CheckBoxValue()){
      //Check box is selected in this row, Update the flag of webservice.
      }
      else{
      //check box not selected in this row
      }
      

      Revert back If still not resolved.

      Regards,

      Vishweshwara P.K.M.

  • author's profile photo Former Member
    Former Member
    Posted on Dec 14, 2011 at 05:23 PM

    s

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.