cancel
Showing results for 
Search instead for 
Did you mean: 

Search result like Google search list

Former Member
0 Kudos

Hallo SDN

I would like to create custom search functionality . We have created a ABAP function module which would return the search results.

Which UI element should i use to display it like google results.

PS: Every search list should have the format of

Description, hit percentage (100% ..10%) and 3 [operations/actions/link] namely Disply,Update and Delete .

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If available in your Web Dynpro version, use a RowRepeater.

Armin

Former Member
0 Kudos

Hallo Armin,

We are still working with Netweaver 7.01. So i cannot use the row repeater.

Edited by: Baskaran Senthivel on Nov 30, 2009 2:34 PM

Former Member
0 Kudos

Then you can create the UI programmatically.

Armin

Former Member
0 Kudos

Hallo Armin,

Do have some suggestion for me like which UI Element (Table with our headers/ Tree ..etc )?.

Some code snipet would also help me.

Thanks in advance

Regards

Senthivel

Former Member
0 Kudos

Create a TransparentContainer "SearchResults" with a RowLayout at designtime. After executing the search, set a boolean context attribute "newSearchResults" to TRUE. In wdDoModifyView() check this attribute. If it is TRUE, clear the container, loop over the result list and call a method that adds the UI for a single search result to the container. Reset the flag afterwards.


static void wdDoModifyView()
{
  if ( wdContext.currentContextElement().getNewSearchResults() )
  {
    IWDTransparentContainer container = (IWDTransparentContainer) view.getElement("SearchResults");
    container.destroyAllChildren();
    foreach (result : searchResults)
    {
      addResultUI(container, result);
    }
    wdContext.currentContextElement().setNewSearchResults(false);
  }
}

static void addResultUI(IWDTransparentContainer container, SearchResult result)
{
   IWDLinkToURL link = (IWDLinkToURL) view.createElement(IWDLinkToURL.class, null);
   link.createLayoutData(IWDRowHeadData.class);
   link.setTarget(result.getUrl());  
   link.setText(result.getUrl());
   container.addChild(link);
   /* etc */
}

Armin

Former Member
0 Kudos

Hallo Armin,

Thanks to your Code snippet. I have build my solution based upon your suggestion.

Regards

Senthivel

Answers (0)