cancel
Showing results for 
Search instead for 
Did you mean: 

check box + table

Former Member
0 Kudos

Hello,

I have a table , which is displaying values from backend RFC... totally 8 columns r there in that two colums r checkbox.. . if the value is X then im making the checkbos as true to Enable... but my problem is it's not enabling dynamically...

Now my question is how would I do it?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

For example your RFC node is "DataNode" and it is having 8 attributes (columns).

Out of these 8 attributes 2 attributes are used to display the check boxes.

For example they are Attr1, Attr2.

Now create two more attributes CheckboxAttr1, ChexkboxAttr2 ( type :boolean , calculated :true) in that node.

As you selected calcualted true, So in the code getter & setter methods will be generated for these attributes.

Now add the below code in the two getter methods as below.

getChexkboxAttr1(IPrivateTestView.IModelNodeElement element)
{
  if("X".equalsIgnorecase(element.getAttr1))
  {
    return true;
  }
  
   return false;
}

getChexkboxAttr2(IPrivateTestView.IModelNodeElement element)
{
  if("X".equalsIgnorecase(element.getAttr2))
  {
    return true;
  }
  
   return false;
}

Now bind the "DataNode" to the table and while binding dont seelct Attr1 and Attr2 attributes.

Now create two seperate columns and add "Checkbox" UI lelements as column cell editors for these two columns.

And bind CheckboxAttr1, ChexkboxAttr2 attributes to checked property of the Checkbox UI elements.

Regards,

Charan

0 Kudos

Hello, I have the same problem, and when I try to add the context attribute to the model node as you say, web dynpro tells me that this operation is not supported...

Adding a context node to the model node is supported, but on this way the checkboxs on the table are disabled and always unchecked and yo must select a row to enable them and see if they are checked or no.

¿Any solution?

Former Member
0 Kudos

Hi,

I don't know where exactly you are facing the problem.

But as you know checkbox "checked" property work for boolean values.

if("X".equalsIgnoreCase(wdContext.currentNodeXXXElement().getContextAtt1())){
wdContext.currentContextElement().setFlag(true);
}else
{
wdContext.currentContextElement().setFlag(false);
}

Regards,

Saleem

Former Member
0 Kudos

Hi Muraly,

Checkboxs works only with boolean values, in your case you need to create a calculated attribute for translate the X in a true value. Please read calculated attributes for webdynpro java http://help.sap.com/saphelp_sm32/helpdata/de/7f/a0384162316532e10000000a1550b0/content.htm

Regards,

David Faustini

Former Member
0 Kudos

Hi ,

Refer the below Thread

Regards,

Manivannan P