cancel
Showing results for 
Search instead for 
Did you mean: 

How can i add multiple UI elements in a table.

Former Member
0 Kudos

Hi all,

How can i add multiple UI elements in a table cell as we seen in Forums of SAP list. Like "Reply" and "E-mail this post" . And a header to each Table Cell.

thanku

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

With the NW04 Table this is not possible.

You could create the layout programmatically. Assume you have the forum posts stored in a context node "ForumPosts" with attributes "Title", "Date" etc.

Then you can create such a layout with code in wdDoModifyView() like;

    
if (rebuildForumContainer)
{
      /* assume "ForumContainer" was created at designtime with a RowLayout */
      IWDUIElementContainer forumContainer = (IWDUIElementContainer) view.getElement("ForumContainer");
      forumContainer.destroyAllChildren();
      
      for (int i = 0, n = wdContext.nodeForumPosts().size(); i < n; ++i)
      {
        IForumPostsElement post = wdContext.nodeForumPosts().getForumPostsElementAt(i);
        
        IWDLinkToAction authorLink = (IWDLinkToAction) view.createElement(IWDLinkToAction.class, null);
        authorLink.setText(post.getAuthor());
        authorLink.setOnAction(wdThis.wdGetShowBusinessCardAction());
        authorLink.mappingOfOnAction().addParameter("user", post.getAuthor());
        
        IWDCaption title = (IWDCaption) view.createElement(IWDCaption.class, null);
        title.setText(post.getTitle());
        
        IWDTextView date = (IWDTextView) view.createElement(IWDTextView.class, null);
        date.setText("Posted" + post.getDate());
        
        IWDTextView text = (IWDTextView) view.createElement(IWDTextView.class, null);
        text.setText(post.getText());

        /* create function buttons */
        IWDLinkToAction edit = (IWDLinkToAction) view.createElement(IWDLinkToAction.class, null);
        edit.setImageSource("https://forums.sdn.sap.com/images/edit-16x16.gif");
        edit.setOnAction(wdThis.wdGetEditAction());
        edit.mappingOfOnAction().addParameter("MessageID", post.getMessageID());
        
        IWDLinkToURL emailLink = (IWDLinkToURL) view.createElement(IWDLinkToURL.class, null);
        emailLink.setText("E-mail author!!");
        emailLink.setImageSource("https://forums.sdn.sap.com/images/eauthor.gif");
        emailLink.setReference("https://forums.sdn.sap.com/feedback.jspa"
          + "?forumID=" + post.getForumID()
          + "&threadID=" + post.getThreadID()
          + "&messageID=" + post.getMessageID()
        );
        
        /* and so on... */
        
        
        IWDTransparentContainer cell = (IWDTransparentContainer) view.createElement(IWDTransparentContainer.class, null);
        /* let cell start a new row */
        cell.createLayoutData(IWDRowHeadData.class);
        /* arrange children in a MatrixLayout */
        cell.createLayout(IWDMatrixLayout.class);
        
        /* fill cell */
        cell.addChild(authorLink);
        cell.addChild(title);
        cell.addChild(date);
        cell.addChild(edit);
        cell.addChild(emailLink);
        cell.addChild(text);
        
        /* Exercise to the reader: set suitable layout data for children */
        
        /* add cell to container */
        forumContainer.addChild(cell);
      }
  }

Armin

Former Member
0 Kudos

Hi,

In Webdynpro u cannot put more than one UIE in one TableCell. U have to use combination of other UIEs to get that. Try something with Toolbar UIE. With JSPs u can achieve that.

Regards,

Piyush.

Former Member
0 Kudos

Hi Sunil,

you can do loads of things with table ui elements, see http://help.sap.com/saphelp_nw04s/helpdata/en/b5/ac884118aa1709e10000000a155106/frameset.htm

With the aggregation Toolbar you can include a ToolbarButton, for example, there's the Header aggregation, etc (see the link above).

Regards, Heidi