cancel
Showing results for 
Search instead for 
Did you mean: 

Select first row of a table

Former Member
0 Kudos

Hi to all,

I have a problem when selecting the first row of a table, this selection returns no datas in the next view, but if I go back and select again the same row, this selection returns the right datas. I use a "for" cicle to select a table and my java code is as the following:

int n_rows;

int k;

n_rows = wdContext.nodeTable().size();

for (k = 0; k < n_rows; ++k){

if (wdContext.nodeTable().getLeadSelection() == k){

wdThis.wdGetXXXControllerController().wdGetContext().currentYYYElement().setZZZ();

}

}

Have you some suggestions??

Thank you very much,

Antonio

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks to all,

I solved the problem,

Antonio

Former Member
0 Kudos

Antonio,

First, verify whether or not you have defined selection mapping for mapped context.

Second, here is shortcut for your code:


if ( null != wdContext.nodeTable().currentTableElement() )
  wdThis.wdGetXXXControllerController()
    .wdGetContext().currentYYYElement().setZZZ
    (
      wdContext.nodeTable().currentTableElement().getSomeAttr()
    )

Regards,

VS

uwe_reeder
Explorer
0 Kudos

Hi Antonio,

I didn't understand what you want to achieve with your code. You definitely do not select in the table, you just read the selection. Where does this code live? In an event handler, i suppose, but which one?

Regards, Uwe

Former Member
0 Kudos

How does your view context look like and how did you bind the table properties to the context?

Armin