cancel
Showing results for 
Search instead for 
Did you mean: 

table column needs to display check mark

Former Member
0 Kudos

Hello,

I have a table in which one of the column will have only two types of values, one is X and other is empty (nothing). While displaying the table I want to display check mark in place of X .

Now my question is how would I do it? I appreciate your help.

Thank you,

Balaji

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Context
+ Rows (node, c=0:n)
   + checked (boolean, calculated=true)
   + checkMark (string)

boolean getRowsChecked(IRowsElement element)
{
  return "X".equalsIgnoreCase( element.getCheckMark() );
}

TableColumn.tableCellEditor = CheckBox1
CheckBox1.checked = Rows/@checked

Armin

Former Member
0 Kudos

Armin,

Thank for the response, I did not understand about what you replied. Could you please elobrate?

Thank you,

Balaji

Former Member
0 Kudos

Hi Balaji,


Context
+ Rows (node, c=0:n)
   + checked (boolean, calculated=true)
   + checkMark (string)

You should have node representing each row in the table. Have one addition attribute checked and set the calculated to "true". There will be also an attribute checkMark which stores the value of "X" or blank.

Since the checked is calculated attribute a method needs to be provided for the calculation for the value. Use the following code for it:


boolean getRowsChecked(IRowsElement element)
{
  return "X".equalsIgnoreCase( element.getCheckMark() );
}

And the remaining code is to add a checkbox to the table and bind it to the checked attribute.


TableColumn.tableCellEditor = CheckBox1
CheckBox1.checked = Rows/@checked

Hope that explains it.

Regards,

Kartikaye

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

For example your node is TableNode. Create one more calculated attribute checkMark (boolean type).

TableNode

-


> Value1(X)

-


> Value2

-


> checkMark(Calculated, boolean)

Now Create a table with two columns. In the fist column take "checkbox" as the column cell editor and in the second column take "textview" as the table cell editor.

Now bind the TableNode to the table. Bind checkMark attribute to column1(checkbox) and Value2 attribute to column2(textview).

As checkMark attribtue is calcualted it will generate the getter method for that in the code as below.

Now insert the below code into that method.

public boolean getCheckMark()
{
  if("X".equalsIgnorecase(element.getValue1))
  {
  return true
  }
  else
  {
  return false
  }
}

If you dont want user to edit that checkMark then change readOnly property of Column1's checkbox UI element to true.

Regards,

Charan