Skip to Content
avatar image
Former Member

Table Popin with TablePopinToggleCell variant

I am trying to utilize a Table Popin for Web Dynpro Java. I have previously added a Popin to a specific column and added a LinkToAction in that column's TableCellEditor which successfully opens and closes the Popin (by way of the "selectedPopin" property of the overall Table).

I'd like to move the Popin so that it is at the Table level rather than the Column. This is from the Web Dynpro UI Programming guide:

You can use the cell variant TablePopinToggleCell, which you insert in the first column of the table, to implement opening and closing of a TablePopin. When the user clicks the TablePopinToggleButton, the TablePopin opens underneath the row; when the user clicks again, it closes.

(That's about all they say on the topic. No real specifics on how to make it work.)

Based on that limited diection here's what I do. (I have already removed any Column Popins at this point.):

1) On the Table I right-click and select "Insert Popin"

2) On the new Popin ("Popin1"), I right-click and select "Insert Textbar". I link the "Textbar" text property to a context value in my table's source node.

3) On the Table (which already has 3 data columns), I select "Insert Column"

4) I rename this column to "Toggle" and move it to the top of the column list.

5) In the "Toggle" column I right-click, choose "Insert CellVariant" and select "TablePopinToggleCell"

6) In the "Toggle" column I "Insert TableCellEditor" (since it forces me to) and just add a TextView linked to an empty Context value.

7) The Table's selectedPopin value is set to a blank value attribute in my Context. (I have tried setting this to the Popin name "Popin1" and the toggle column ("Toggle") with no success)

I do not know what the "variantKey" on the TablePopinToggleCell variant is for, but I've tried fiddling with that too.

When I run the page, I do not get the TablePopinToggleButton (small triangle allowing open/close of Popin) in the first column of my table. Intuitively, I know there probably needs to be a connection made between the Popin and the Toggle, but I do not know where that is.

I am running this on SAP NetWeaver Portal 7.0 SP13.

If responding, please do NOT link to other SDN threads (I've seen them all), the help.sap.com pages (the popin topics there that people reference in these SDN threads appear to be related to Web Dynpro - ABAP), or the Web Dynpro UI Programming Guide (I already have). Feel free to link to any specific tutorials on the topic as I have not found any of use yet,

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 03, 2008 at 09:43 PM

    I have added in green the steps needed to complete the task:

    0) Create 2 string attributes in the table source node (let's call it "Items") - one for the Selected popin - "SelectedPopin1", another for selected cell variant - "SelectedCellVariant1".

    1) On the Table I right-click and select "Insert Popin"

    Remember id of the popin, you will need it. Let's call it "Popin1".

    2) On the new Popin ("Popin1"), I right-click and select "Insert Textbar". I link the "Textbar" text property to a context value in my table's source node.

    3) On the Table (which already has 3 data columns), I select "Insert Column"

    4) I rename this column to "Toggle" and move it to the top of the column list. Bind selectedCellVariant property of the column to Items.SelectedCellVariant1

    5) In the "Toggle" column I right-click, choose "Insert CellVariant" and select "TablePopinToggleCell"

    Assign to the variantKey of the TablePopinToggleCell some value, for example - "variant1"

    6) In the "Toggle" column I "Insert TableCellEditor" (since it forces me to) and just add a TextView linked to an empty Context value.

    Instead of Text View insert LinkToAction cell editor. Add action ShowPopin in the onAction event

    7) The Table's selectedPopin value is set to a blank value attribute in my Context. (I have tried setting this to the Popin name "Popin1" and the toggle column ("Toggle") with no success)

    Instead bind selectedPopin property of the table to "Items.SelectedPopin1" attribute

    8) Add the following code to the action onActionShowPopin

    	
    for (int i =0; i < wdContext.nodeItems().size(); i++) {
       IItemsElement element =   (IItemsElement)wdContext.nodeItems().getElementAt(i);
    	if(wdContext.nodeItems().getLeadSelection()==i) {
    	   element.setSelectedPopin1("Popin1");
    	} else {
    	   element.setSelectedPopin1("");			
    	}
    }
    

    9) Add the following code to the wdDoInit function

      for (int i =0; i < wdContext.nodeItems().size(); i++) {
        IItemsElement element =   (IItemsElement) wdContext.nodeItems().getElementAt(i);
        element.setSelectedCellVariant1("variant1");
     }
    
    

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Here you go:

      Remove the reference to "onActionShowPopin" in the onAction event of LinkToAction cell editor. It does not matter what cell editor you have in the "Toggle" column, it can be a Text editor - it is not used.

      Add the following code to the wdDoInit function inside the for loop

      element.setSelectedPopin1("");

      Add the following code to the wdDoModifyView function:

      if (firstTime)
      	{
      	  IWDTablePopinToggleCell myTablePopinToggleCell = (IWDTablePopinToggleCell) view.getElement("TablePopinToggleCell1");
      	  myTablePopinToggleCell.mappingOfOnToggle().addSourceMapping("nodeElement", "element");
      	}
      

      "TablePopinToggleCell1" is the ID of the TablePopinToggleCell.

      The parameter nodeElement of the type IWDNodeElement can be used for all events. The parameter nodeElement references to the corresponding node element in the context to

      which the UI element is assigned. - this is from SAP WebDynpro documentation.

      Add parameter "element" of type IPrivate<viewName>.I<nodeName>Element to the onActionShowPopin action

      For example for the veiw "IPrivateTablePopinView" with the context node "Items" the parameter "element" should be of type IPrivateTablePopinView.IItemsElement

      Modify the code of the onActionShowPopin

      	for (int i =0; i < wdContext.nodeItems().size(); i++){
      		IItemsElement itemElement = (IItemsElement)wdContext.nodeItems().getElementAt(i);
      		if(itemElement.equals(element)) {
      			itemElement.setSelectedPopin1("Popin1");
      		} else {			
      			itemElement.setSelectedPopin1("");
      		}
      	}
      
      

      Assign onActionShowPopin action to the event "onToggle" of the TablePopinToggleCell.

      Julia

      Edited by: Julia Shapiro on Apr 7, 2008 2:46 PM

  • avatar image
    Former Member
    Feb 20, 2008 at 06:54 PM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 20, 2008 at 07:07 PM

    Armin:

    No. I've already been there

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      It's really a shame that such using useful features fails because of insufficient documentation. I suggest opening an OSS message (BC-WD-JAV-RUN).

      Armin