on 02-20-2008 5:33 PM
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,
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
😎 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");
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Julia:
Works like a champ! Full points will be awarded. One final question: Is there a way that, if I activate Popin in row 3, then activate Popin in row 6, that row 6 would open and row 3 would close automatically? (Right now, each row that is clicked opens and we have a table were we would only like 1 popin at a time opened.)
-Bob
Hi Bob,
For popin to work as you want I did the following steps in your last message:
Suppose there is a node say Node1 with attribute as Att1. Also i added two more attributes to Node1 which are as follows:
popin: Type boolean
popintext: Type string
Step 1: Create a table by applying template on Node Node1
Step2 : Right click on Table and chose "Insert Popin"
Step3: Right Click on PopIn1, choose "Insert Content". Choose type as TextView and click finish.
In this TextView UIElement under PopIn1 bind property text to Node1.Att1
Step3: In property selectedPopin of table choose attribute Node1.popintext
Step4: Right clicked TableGroupedColumn Att1 and choose "Insert Cell Variant" and choose type TablePopinToggleCell
Step5: Created a new Action named "popAction" and wrote following code in OnActionPopAction:
if(wdContext.currentNode1Element().getPopin()){
wdContext.currentNode1Element().setPopin(false);
wdContext.currentNode1Element().setPopinText("false");
}
else{
wdContext.currentNode1Element().setPopin(true);
wdContext.currentNode1Element().setPopinText("true");
}
Step6: Choose popAction in property OnAction of TableGroupedColumn Att1
Regards,
Gopal
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
Armin:
No. I've already been there
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maybe the WD ABAP documentation helps:
http://help.sap.com/saphelp_nw70/helpdata/en/f4/546c42eed40e53e10000000a155106/frameset.htm
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.