on 06-28-2006 9:06 AM
Hi ,
I would like to know , how can I pass the name of the string used in Link to Action UI Element in the event handler method for the link .
Say , I am using a table UI Element with one of the column or table cell editor as a link to action .
Now , when I click the column , I want the value of the column to be passed in the event handler method .
Best Regards
Sid
Armin
you are right
"SelctedUsers" is typo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Armin
I already tried it, but i get a Null Pointer Exception
In my init() method i set the following
selUserElement.setSelectedusers(entry.getPrincipal().getDisplayName());
selUserElement.setUserID(entry.getPrincipal().getId());
selUserElement.setUMEID(entry.getPrincipal().getUMEId());
and when i retrieve any of these values in action method
strUID = row.getUMEID+ ".usr";
strUID = row.getSelectedusers()+".usr";
strUID = row.getUserID()+".usr";
all these values return me null.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You told that your URL after clicking a link was
This means that
- the parameter "row" contained indeed a node element
- the node is in the view controller "ResourcePermissionView"
- the node is named "SelctedUsers" (is this a typo?)
- the link was at row with index 0
Armin
Armin
now my URL looks like this:
but the expected URL is:
"USER.CORP_LDAP.pdave" value is already stored in my context of "SelctedUsers".
So how can i get that value so that my URL is properly built ???
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
public void
onActionOpenUserDetails
(
com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent,
com.nvidia.ep.km.wdp.IPrivateResourcePermissionView.ISelctedUsersElement row)
{
String strUID = "";
String strURL = "";
IWDWindow window = null;
/* This is wrong: */
strUID = row+".usr";
/* Use something like this: */
strUID = row.getSelectedUseUMEID() + ".usr";
strURL = "http://sape7s:50000/irj/servlet/prt/portal/prtroot/com.sap.netweaver.kmc.people.PeopleDetails?Uri=/ume/users/"+strUID;
window =wdComponentAPI.getWindowManager().createExternalWindow(strURL,"User Details",false);
window.open();
}
Armin
Armin
Following is my code for doModify() and my action methods.
Am getting the user(row value) as null in my action method.
public static void wdDoModifyView(IPrivateResourcePermissionView wdThis, IPrivateResourcePermissionView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
IWDLinkToAction link = (IWDLinkToAction) view.getElement("selectedLink");
IPrivateResourcePermissionView.ISelctedUsersElement element = wdContext.createSelctedUsersElement();
if(view.getElement("selectedLink") != null)
{
link.mappingOfOnAction().addSourceMapping("nodeElement","row");
}
}
public void onActionOpenUserDetails(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.nvidia.ep.km.wdp.IPrivateResourcePermissionView.ISelctedUsersElement row)
{
String strUID = "";
String strURL = "";
IWDWindow window = null;
strUID = row+".usr";
strURL = "http://sape7s:50000/irj/servlet/prt/portal/prtroot/com.sap.netweaver.kmc.people.PeopleDetails?Uri=/ume/users/"+strUID;
window = wdComponentAPI.getWindowManager().createExternalWindow(strURL,"User Details",false);
window.open();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
public static void wdDoModifyView
(
IPrivateResourcePermissionView wdThis,
IPrivateResourcePermissionView.IContextNode wdContext,
com.sap.tc.webdynpro.progmodel.api.IWDView view,
boolean firstTime
)
{
if (firstTime)
{
IWDLinkToAction link = (IWDLinkToAction)
view.getElement("selectedLink");
link.mappingOfOnAction().addSourceMapping
(
"nodeElement",
"row"
);
}
}
}
Please verify that the ID of the LinkToAction (table cell editor) is really "selectedLink". Case matters here!
Armin
Armin
My Scenario is this.
I have a link to Action as table cell editor.When i click on the link (which is a user id frm UME) i need to pass that clicked user id to a URL and open it in a new window.
I couldn't understand the parameters "nodeElement" and "row" in your code.
editor.mappingOfOnAction().addSourceMapping
(
"nodeElement", /* name of (implicit) event parameter */
"row" /* name of action parameter */
);
Also my Context for the tables is as follows:
-SelectedUsers (value node)
--selectedUserName (value attribute)
--selectedUseUMEID (value attribute)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have assigned some action A to the LinkToAction element.
Create an action parameter "row" of type ISelectedUsersElement.
Then the parameter mapping statement will map the implicit event parameter named "nodeElement" to the action parameter "row". This means that when the link is clicked, the action handler is called and the parameter "row" contains the node element (table row) where the link has been clicked.
The name of the action parameter can be freely chosen, but the event parameter name "nodeElement" is predefined and must be used exactly like this.
Armin
How can i excatly check whether the view element is created or not ??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have created the view element at designtime (with the view design tool), it is created if method wdDoModifyView() is entered for the first time.
Generally, you can check inside wdDoModifyView() with a statement like
if (view.getElement("ID-of-view-element") != null)
{
/* view element exists */
}
Armin
Armin
In your code it is mentioned
if(firsttime){
}
I tried implementing your solution without including the if(firsttime) condition and am getting a null pointer. can u pl explain how can i check for the " firts time" condition
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
I would lile to know the text assigned to that particular UI element - Link to action , want to access it in the event handler method .
Which parameter is the text in the WDEVENT !!
Best Regards
Sid
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the impression that you really want to determine the <b>row</b> where the link has been clicked. Is that the case?
To do this, add a parameter "row" of type IWDNodeElement to your action, and implement a parameter mapping:
wdDoModifyView(...)
{
if (firstTime)
{
IWDLinkToAction editor = (IWDLinkToAction) view.getElement("ID-of-editor");
editor.mappingOfOnAction().addSourceMapping
(
"nodeElement", /* name of (implicit) event parameter */
"row" /* name of action parameter */
);
}
}
Then you get the node element corresponding to the table row where the link has been clicked as action parameter "row".
The text of the link may then be taken from the attribute (of the passed node element) to which the "text" property of the link is bound.
Armin
I want to pass the value of the table column with the action .
Will it be possible .
Best Regards
Sid
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In principle, you can pass fixed values using the IWDLinkToAction.mappingOfOnAction().addParameter() methods.
But in the case of a table, this is not necessary, because there is exactly one table cell editor per column (in NW04).
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 |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.