cancel
Showing results for 
Search instead for 
Did you mean: 

Change Lead Selction in Table on click of any element in row?

Former Member
0 Kudos

Hi @,

In My application I am using Table to display some data now the requiremnt is to change the row selection by selecting any thing in that row rather than changing row selection manually.

Is it possible to change row selection whenevr user clicks on any of the row in the table.?

Regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Amit,

Your Question: "It is possible to change it when LinkToAction is clicked."

Yes it is possible to change, you need to get the row number of the LinkToAction Ui element which has been clicked; call the method setLeadSelection() on the node binded to table in the action of LinkToAction UI element and pass the row number to the method setLeadSelection().

Former Member
0 Kudos

I remember that stuff working in earlier versions of Web Dynpro. But with 7.10 CE it seems to be broken?

With reading further on this I found a solution (regards to Armin reichert) working in 7.10:

1. Create a Parameter on your ACTION you want to call by the LinkToAction element of type IWDNodeElement

2. Rightclick the LinkToAction Element an select "Parameter Mapping" from menue.

3. Map your Parameter with nodeElement on the left

4. Program in your action something like:


  public void onActionLinkToAction(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.sap.tc.webdynpro.progmodel.api.IWDNodeElement myNode )
  {
    //@@begin onActionSelectService(ServerEvent)
   wdContext.node<yourNode>().setLeadSelection(myNode.index());
    //@@end
  }

That will set the Lead selection to the row of the selected LinkToAction

Answers (9)

Answers (9)

Former Member
0 Kudos

Hi Frank, Bertram,

Thanks a lot, this helped me.

Rgds,

Atul.

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hallo Amit,

have a look at my article on [New Web Dynpro Sample available - Enhancing Table Performance|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2343] [original link is broken] [original link is broken] [original link is broken];. You find more details on lead selection change behavior and table action eventing there.

Regards, Bertram

Former Member
0 Kudos

Hi,

I am not sure what is your problem, but i think you can solve your problem by inserting table columns individually and not table has a whole. Such that you can bind to the attribute you needed.

Regards

Raghu

Former Member
0 Kudos

Hi Amit,

The default properties are as follows:

Table Property: selectionMode --> auto

selectionChangeBehaviour --> auto

rowSelectable ---> true

Context Property: initializeLeadSelection --> true

Former Member
0 Kudos

Hi Aishwarya,

In My Application I have all these properties as you have mentioned.

Now the issue is LinkToAction doesn't change the LeadSelection.

Also the DropDownByIndex element has changed to textview.

REgards

Former Member
0 Kudos

Hi Amit,

Yes, it is true that lead select action works only on the row and not a single cell. But whenever you click on any cell of the row the whole row comes as selected if you havent changed the selectionMode, selection change behaviour or initiallize lead select property.

There is no such action in web dynpro as cell select.

That's why for your cell select I gave you a work around of using link to action instead of text view to display your cell data.

Former Member
0 Kudos

hi ,

Can you please tell me the valeu of these properties you have mentioned so tht I can verify once again though I ddnt chaneg any of the defautl properties.

Regards

Former Member
0 Kudos

Hi @,

Any help in this how to go abt.

My Table is having LinkToAction UI in one of the columns. When click on the cells other than the Linktoaction LeadSelction changes but the same doesn't work when I click on the LinkToAction element.

It is possible to change it when LinkToAction is clicked.

Regards

Edited by: Amit on Oct 20, 2008 7:03 AM

Former Member
0 Kudos

Hi Amit,

As per the default property of a table in web dynpro if a user selects any element (cell) of a row the complete row is selected. And if you are using text view in all the elements of the row you don't need to worry about setting lead selection action...

just write a method for onLeadSelect to capture the data of the current selected row and rest will be taken care of by WDF.

OnLeadSelect is the action that checks which row is currently selected.

Former Member
0 Kudos

Hi ,

Thanks for yr response I will try your example but my understanding was that LeadSelection changes only when row is selected and not any cell.

Is it that LeadSelct action gets triggered when I select any cell but when I select row the lead selection automatically goes to tht row but this is not the case of cell.

I will try this.

Regards

Former Member
0 Kudos

Hi Aishwarya,

Lead Select only gets triggered for row select and not for cell select as I mentioned.

Regards

Former Member
0 Kudos

Hi Amit,

To check which element is selected you need to iterate over the node and check which element of the node is selected, you can use isSelected() method for it. now you will get the count and element that is selected, pass the count to method setLeadSelection(int) on the node that is binded with your table.

In your table rather then using a text view to dispaly data use Link to action Table Cell Editor, you can change the desing of the link and you will get an action associated with each element in the table.

Former Member
0 Kudos

Hi ,

Thanks for your reply but i have one question I am not using link to action first and all the elements of row are textview then to iterate ove the nodes is fine but what will be the action that will trigger this operation .

As I know there is no action which will trigger this.

Regards

Former Member
0 Kudos

Hi Amit,

Whenever a user selects a row in the table the lead selection changes unless you

haven't set the initializeLeadSelection Property of the node mapped to table to false.

If you wish to capture the data of the row selected; you have to define an action and

map it to onLeadSelect event (in table property you will find an Event call onLeadSelect)

and write the code to get the data in that action.

Former Member
0 Kudos

Hi Murtuza/Aishwarya,

My requirement is to change lead Selection when User clicks on any field in any row to corresponding row whose element has been clicked.

I hope now I am clear as it was slightly ambigous before in explanation.

I can set the leadselection not issue but what will be the event associated when user clicks on any element in the row and how to determine the row element clicked will be issue.

As per my knowledge this is not possible need your help on this.

Regards,

Amit

Former Member
0 Kudos

Hi Amit,

There would be an event called onLeadSelect, create an action for this and just write this line make the lead selection to 0.

wdContext.node<nodename>().setLeadSelection(0);

Regards,

Murtuza