cancel
Showing results for 
Search instead for 
Did you mean: 

Add Table Column of type checkbox

Former Member
0 Kudos

Hi,

I defined a model node witch is filled with data that came from a database. The model node data is then bounded to a WebDynpro Table Object.

Now, i need to include a column of type checkbox in the table. To accomplish this, i have done the following steps:

- Created a new Table Column of type Checkbox;

- Created a new Attribute under the model of type Boolean;

- Mapped the new attribute model to the property checked of table checkbox;

When launch the application, all the checkboxes in the table are all disabled. (No, the checkbox property disable, doesn’t have the value true)

Already searched and found some threads on SDN, most of them say to create a new node under the model node (cardinality=1:1, selection=0..1, singleton=false) and inside the new node create the boolean attribute. I also tried this approach, but without success.

Please advice?

P.S.: I don’t want to use the standard table row selection, because not all the rows can be selected.

Regards

John

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

check this link and check if this helps

Regards

AM

Former Member
0 Kudos

Hi,

Thanks, but it doesn’t help.

My problem is different. The checkboxes appears correctly in the table, but it’s like if the property readonly is true.

Anyone has an example?

Regards

John

Former Member
0 Kudos

Hi,

Could it be you are mapping all table rows to one and the same attribute?

You need to create an element containing the boolean attribute for each table row.

Good luck,

Roelof

Former Member
0 Kudos

Hi,

I found what’s causing the problem, but the solution introduces a new problem.

I want the table design to be alternating (design table property = alternating), and to accomplish that (i would like that someone try to explain me why), the readonly table property should be false, otherwise, the alternating design will not work.

The problem is, if the readonly table property is set to false, the checkboxes will act like they are readonly. If change the readonly table property to true, I get the checkbox functionality, but lost the alternating design.

More curious, in the same table, I also have a table column of type button, and the button works in both cases: readonly table property equal to true or false.

Any hint?

Regards

John

Former Member
0 Kudos

John,

Unfortunately, this is "behavior by design": to use alternative/transparent table design you must make table read-only (otherwise "it confuses user" according to SAP usability specialists). And in read-only table mode all cell editor are read-only as well. So this is either-or options: standard design + editable table + clickable chackbox or alternative design + read-only table + non-working checkbox.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

John,

I'm having the same issue.

I am creating checkbox columns dynamically and at runtime it check boxes

are displaying but not enabled.

How did you resolve this issue?

Please help me to fix this issue.

Thanks

Sundar

Former Member
0 Kudos

Hi,

Unfortunately, it hasn't the wished solution, you must set readonly table property is to true and choose default design, not the alternating one.

Regards,

John

Former Member
0 Kudos

hi,

<b>lready searched and found some threads on SDN, most of them say to create a new node under the model node (cardinality=1:1, selection=0..1, singleton=false) and inside the new node create the boolean attribute. I also tried this approach, but without success.</b>

do the following for the above approach

Make the <b>selection mode</b> table property to none.

for the helper node provide a supply function and write this code in it.

This code will basically solve your problem of <b>all the checkboxes in the table are all disabled</b>

IPrivate<view>.I<helpernode>Element sele = parentElement.node<helpernode>.create<helpernode>Element();

sele.set<attribute>(false);

parentElement.node<nodename>.addElement(sele);

when user selects the check boxes onAction of method write the following.

loop at table

if(wdContext.node<nodename>.get<nodename>ElementAt(i).node<helpernode>.current<helpernode>.get<attribute>)

{

// code you want to handle.

}

endloop.

regards,

Gopi

Former Member
0 Kudos

Hi,

Bharathwaj R: Yes, the model has data.

gopi nidjelli:Selection Mode table property is already none. Should the selection mode of model also be specified as none?

Regards,

John

Former Member
0 Kudos

Is there data in the model node