on 04-27-2005 2:50 PM
Hi,
I am looking for a solution to the following problem.
In my WD application I have a recursive tree.
On OnSlect:
=============================================
public void onActionSelect(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.sap.csn.wdp.IPrivateComponentTree.ITreeNodeElement selectedElement )
{
//@@begin onActionSelect(ServerEvent)
select(selectedElement);
//@@end
}
=============================================
Where the select method definition is:
=============================================
private void select(com.sap.csn.wdp.IPrivateComponentTree.ITreeNodeElement selectedElement)
=============================================
The selectedElement is previously mapped in the wdDoModifyView:
=============================================
treeNode.mappingOfOnAction().addSourceMapping("path","selectedElement");
=============================================
This works perfectly. Now, I would like to extend it, so that every time when a node is selected (OnSelect action), a popup to appear with a confirmation dialog. The dialog will have 2 options ok or cancel. In case of ok the select method will be called, nothing should change otherwise.
I modified the onActionSelect:
=============================================
//@@begin onActionSelect(ServerEvent)
IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow(
"You will loose the entered data. Are you sure you want to load the new template?",
wdControllerAPI.getControllerInfo().findInEventHandlers("Select"),
"Yes");
dialog.addChoice(wdControllerAPI.getControllerInfo().findInEventHandlers("Cancel"), "No");
dialog.open();
=============================================
I added a new Event Select that is called with OK.
=============================================
public void Select(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.sap.csn.wdp.IPrivateComponentTree.ITreeNodeElement selectedElement )
{
//@@begin Select(ServerEvent)
IWDWindow window = wdContext.currentContextElement().getConfirmationWindow();
if(window != null){
window.close();
}
select(selectedElement);
//@@end
}
=============================================
The problem is that I dont know how to keep the value of the selectedElement and pass it from onActionSelect to the Select event? When I create the confirmation window, I can specify the name of the event but not its parameters:
wdControllerAPI.getControllerInfo().findInEventHandlers("Select")
Hi Albena,
In private section of controller (between //@@begin others -- //@@end at the very bottom of source code) create a field to hold a node element. In onSelect action handler store current element in this variable, in event handler for OK button use this variable.
VS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Albena,
Let me know the solution
Regards, VIP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Valery,
It works now!
Thanks for your help,
Alabena
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
See this:
https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm
/people/mark.finnern/blog/2004/08/10/spread-the-love
VS
Hi,
i have created a recursive tree
Now i want to do the following things
1. Provide a checkbox to every node
2. if a node is checked then all its subnodes should be checked
(This is like context mapping in web dynpro i.e. if the root node is checked then all the nodes under it also gets checked.)
I read your problem....it seems somewhat similar to mine. But i coudnt understand ur code.
Can you please help me in solving this.
Hi,
i have created a recursive tree
Now i want to do the following things
1. Provide a checkbox to every node
2. if a node is checked then all its subnodes should be checked
(This is like context mapping in web dynpro i.e. if the root node is checked then all the nodes under it also gets checked.)
I read your problem....it seems somewhat similar to mine. But i coudnt understand ur code.
Can you please help me in solving this.
Thanks n Regards
Akshay
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
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.