cancel
Showing results for 
Search instead for 
Did you mean: 

cardinality and NW04

Former Member
0 Kudos

dear all,

do you know what's the relation between cardinality and NW04.

i have create a table and set compatibilitymode to NW04 , if i click any row in that table then i always get first row. do you know why?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

There is no relation b/w NW04 and Cardinality.

NW04PLUS property will disable the default rowchange behaviuor of table.For a table, each rowchange will hit the server every time. To avoid automatic rowchange behaviour of table, we r using this property. If u want to change the leadselection, u have to click in the leads manually for NW04Plus. So It is a property to improve the performance of the table.

Do u mean the Cardinality of Node? If yes, Cardinality implies how many elements a node can have at run time. If the node is bound to a table and can have zero to N elements, then we will make the cardinality of node as 0.N.

Similarly 1.1,1.N,0.1

Regards

Fahad Hamsa

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Oscar,

When a table's compatibility mode is set to nw04Plus, the lead selection will change only when you click first column(the column present by default for changing leadselection) of the table. So, obviously you will get first row(lead selected) when you click any row (other than in first column).

And also see

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c092333b-0601-0010-e7af-8c227fb6d052">Enhancing Tables Performance</a> for more information on compatibility mode of a Table.

Regards,

Prabhakar

Former Member
0 Kudos

i change compatibility because when i click checkbox (a field in the table) , it looks like laoding something or respond to something, so if NW04 , it won't do that, the problem is now i can't get any correct row. do you have solution for this?

Former Member
0 Kudos

If the compatibility mode is 'auto' and if you click on the check box, there will be two round trips to the server,

-> first for changing lead selection

-> second for the action of the tablecelleditor(Checkbox in this case)

So, it seems to be loading some thing as like you said...

If compatibility mode is nw04Plus, the roundtrip for leadselection change will not be there, and the roundtrip for check box action only will be there(If you have done any thing like that).

Now, If you want to get any data from the row, for which the check box is selected,

-> first, you have to find the rowindex, for which the checkbox is selected.

-> then using that rowindex, you can easily get the needed data from that particular row.

I hope you understand,

Regards,

Prabhakar.

Former Member
0 Kudos

Hi,

To get the index of the of the row, you can implement parameter mapping in WdDoModifyView() as given below,

if(firstTime)
    {
		IWDCheckBox chkBox = (IWDCheckBox)view.getElement("CheckBox");
		chkBox.mappingOfOnToggle().addSourceMapping("nodeElement","selectedRow");
    }

Here 'selectedRow' instance represents the selected row. Now, you can pass this instance 'selectedRow' to any method as parameter, and get the row index or any of that rows information.

int index = selectedRow.index();
String name = selectedRow.getName();

these are some sample codings...

Regards,

Prabhakar.

Former Member
0 Kudos

hi Prabhakaran,

so "selectedRow" is a method? what is getName then?

should i create ActionOnToggle in checkbox?

Former Member
0 Kudos

Hi,

'selectedRow'

is a reference to the row, in which the checkbox is clicked.

'Name'

may be a column in the table or attribute in the Node (Its for example, I used 'Name' here).

The action for checkbox toggle may be created depending on your need.

May I know, What for you are using checkbox in the table?

Prabhakar.

Former Member
0 Kudos

Hi,

i still don't understand with this statement

int index = selectedRow.index();

String name = selectedRow.getName();

i try this code and got an error message

Former Member
0 Kudos

Hi,

If you dont understand, leave it then.

I think its better to use compatibilitymode=auto* in the table property, for your application. There will be two round trips when you click on check box, and it seems like loading something... but no problem.Continue with it...

Thanks and Regards,

Prabhakar.