cancel
Showing results for 
Search instead for 
Did you mean: 

Selection inside table

Former Member
0 Kudos

Hi,

I have a table with a single column which lists 'Company names'. I have links A,B...Z on top, when i click on these links i want the 1st element in the table to be the Company with the clicked letter and the rest of the companies will follow. How do i do this? Is there any other better way to obtain such a display where the user sorts the company by the letter he clicks? Can i use the property 'firstvisisblerow'in some way?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Helo Sunil

are u populting these values from database? if yes u can query the DB with the selected letter(sort using the selected letter). now populate the table with the resulting ResultSet.

Else u can set the index for a perticular element (node().moveElement(int from, int to)). eg: if u are selecting "P", u have to traverse the whole node and when u encounter any company starting with "P" set its index to 0,1,2... accordingly.

Regards,

Piyush.

Former Member
0 Kudos

Hi,

If i have 24 links representing all the alphabets, can I have a single action associated. If yes, how do I get the value of the text clicked i.e the different letters. Suppose I click 'A' then I need to get this so that I can compare it with the 1st letter of the Table elements. How do I do this?

thanks

Former Member
0 Kudos

Define an action parameter "letter" of type string.

In wdDoModifyView():

Let A = { a_0, ..., a_n-1 } be your alphabet, and let your links have the ID's L_0,...,L_n-1:

if (firstTime)
{
  for (int i = 0; i < n; ++i)
  {
    IWDLinkToAction link = (IWDLinkToAction)
      view.getElement("L_" + i);
    link.mappingOfOnAction().addParameter("letter", a_i);
  } 
}

Then the action (event handler) parameter "letter" will contain the letter corresponding to the clicked link.

Armin

Former Member
0 Kudos

Hi Armin,

Thanks a lot for the solution. I had one small doubt though :

<b>Let A = { a_0, ..., a_n-1 } be your alphabet</b>

where do I specify this, and what is it exactly?

<b>Further more</b> : When I get the clicked letter in the action paramater, I need to then compare this string (alphabet)with the 1st letter of every element in a table (which I get from the backend). Then depending on the element that matches the letter I need to bring those to the top of the table. Any idea how can I go abt doing this?

Thanks..

Former Member
0 Kudos

This was only a more abstract way for describing an alphabet, simply take A = {"A", ... "Z"} or whatever.

To rearrange the table rows: Rearrange the element list in the table's data source node. Or filter the node elements list by those elements that match the selection.

Armin

Former Member
0 Kudos

Hi:

try:

/people/peter.vignet/blog/2007/01/03/generic-web-dynpro-java-table-filter

regards

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sunil,

Go to this link .It deals with sorting in tables

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tu... on creating tables in web dynpro - 11_0_.htm

Regards

Rohit