cancel
Showing results for 
Search instead for 
Did you mean: 

How to set the selected row in table highlited?

Former Member
0 Kudos

Hi Experts,

I need some help on how to keep the selected row of a table steady unless user selects another row. I have developed a WD program to data based on the selected row of a table which uses NodaA.The retrived data is from another table which use NodeB and maintain in a result table node Drilldown.

Here is the code:

-


for (int i=0; i<wdContext.nodeB().size(); i++)

{

wdContext.nodeB().setLeadSelection(i);

IPrivatePortalVsSQL.IDrillDownElement Drilldown_elem = wdContext.createDrillDownElement();

Drilldown_elem.setAttributeValue("sapsystem",sap_sys);

Drilldown_elem.setAttributeValue("saprole",sap_role);

drilldown_al.add(Drilldown_elem);

Drilldown.bind(drilldown_al);

}

But because I am using wdContext.nodeB().setLeadSelection(i) method in loop iteration, the selected row in tableB is not beeing stable and the cursor is scrolling down to the last record of the table. Its not looking good for presentation purpose.

So I request you to suggest how to stop the cursor scroll-down but stay allways on the selected row of the table untill user selects different row.

I promise to award complete points to the appropriate solution/suggestion.

Thank you

Regards

Maruti

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Maruti,

Instead of using setleadselection use getnodeBElementAt() method..

code may look like this..

wdContext.nodeB().getnodeBElementAt(i).getName();

get every element and copy it to the target node... This will not change the lead selection.

Regards,

Prabhakar.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

In your <b>for</b> loop you are setting the lead selection to each row of the table associated with NodeB. So at the end of your loop the statement,

wdContext.wdContext.nodeB().setLeadSelection(i); will set the leadselection to the last record and exit the loop.

If you want to maintin the selected value untill user selects another value then dont write any code for setting the lead selection.

From your post what i feel is that you are getting some value from table(NodeB) based on the value selected from table(NodeA) and storing that in the tbale(Node Drilldown).

please confirm if i am right else explain your requirement a bit elobarately, so that we can help you correctly.

former_member187990
Participant
0 Kudos

Hi Maruti,

The wdContext.nodeB().setLeadSelection(i) will move the lead selection to the row which you added recently.Remove wdContext.nodeB().setLeadSelection(i) this from the loop.If you are not mentioning the lead selction to a row it will show the first row as lead selected.

If the user selects any other row the lead selection will be set to that row.

Satish kumar SV

Former Member
0 Kudos

Maruti,

Just remove the statement wdContext.nodeB().setLeadSelection(i); from the for loop

Set the leadselection outside the loop.

Anilkumar