on 01-06-2009 6:11 AM
Hiii,
Iam creating portal users in the web dynpro.I had taken Grid layout.I written code like this.
public void onActionCreateUser(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionCreateUser(ServerEvent)
String user = wdContext.currentContextElement().getUser();
String lastName = wdContext.currentContextElement().getLastName();
String firstName = wdContext.currentContextElement().getFirstName();
String email = wdContext.currentContextElement().getEmail();
IUserFactory userFact = UMFactory.getUserFactory();
try {
IUserMaint userMaint = userFact.newUser(user);
userMaint.setLastName(lastName);
userMaint.setFirstName(firstName);
userMaint.setEmail(email);
userMaint.commit();
wdComponentAPI.getMessageManager().reportSuccess("User Created "+user);
} catch (UMException e) {
wdComponentAPI.getMessageManager().reportException(e.getMessage(),false);
e.printStackTrace();
}
//@@end
}
In the output iam getting
-
: Vijay
-
: Vijay
-
:Tivari
-
: email address giving
Label is not displaying in the output (.that is the left part).But iam able to create the users.
Name
First Name
Last Name
These things have to be shown in the output.
Please provide the solution for this.
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Also check if in the property of the label you have replaced the <> of Text property with your label text.
Regards,
Rajat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sushma,
Since you are getting :Vijay (only colon)not the name of the label.
Then the Visible and enabled properties are alright. the only thing that you might have missed is providing the value for Text property of Label.
please check it once as this is the only problem i can see.
regards
Narendra Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sushma,
I missed out few important things in my earlier response:
1) The display of label has nothing to do with the code.
2) The code is working fine if the user is getting created.
3) The enabled property is to be set true for both the individual labels and top level.
Regards.
Rajat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sushma,
First of all check in the layout that the property ColSpan is 2.
Then enabled property of the label should be set true.
Hope it helps.
Regards.
Rajat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Enable the label property.
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sushma,
just check whether the Proper binding of context with UI Element is done or not.and also Check the Cardinality is 0..n and selected is 0..n or not.
regards
vishal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Iam creating portal users in the web dynpro. Iam getting error in the code
_Error : The method setPassword(String) is undefined for the type IUserMaint*_ *
Will anyone help me to sort this issue.
Please reply the necessary code.
public void onActionCreateUser(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionCreateUser(ServerEvent)
String user = wdContext.currentUserDataElement().getUser();
String password = wdContext.currentUserDataElement().getPassword();
String lastName = wdContext.currentUserDataElement().getLastName();
String firstName = wdContext.currentUserDataElement().getFirstName();
String email = wdContext.currentUserDataElement().getEmail();
IUserFactory userFact = UMFactory.getUserFactory();
try
{
IUserMaint userMaint = userFact.newUser(user);
{code}userMaint.setPassword(password);
userMaint.setLastName(lastName);
userMaint.setFirstName(firstName);
userMaint.setEmail(email);
userMaint.commit();
wdComponentAPI.getMessageManager().reportSuccess("User Created "+user);
}
catch (UMException e)
{
wdComponentAPI.getMessageManager().reportException(e.getMessage(),false);
e.printStackTrace();
}
//@@end
}
Regards
Sushma
Hi,
You need to use IUserAccount Interface
IUserAccount: This interface is used to get and set user account data for instances passwords, roles and group membership.
Below is sample code try to edit it as per your requirement
IUserAccount userAcc = null;
try {
userAcc = UMFactory.getUserAccountFactory().newUserAccount( u201Cmiltongu201D,
epUser.getUniqueID());
userAcc.setPassword( u201Cmilton@123u201D );
userAcc.save();
userAcc.commit();
} catch (Exception e)
{
System.out.println(e.toString());
return;
}
// In your above code just comment your setPassword line and paste the above code after your code line
userMaint.commit();
Regards
Raghu
Hi Sushma,
Please go through this Blog. It gives you the step-by-step procedure to create a portal user using Web Dynpro for Java,
Regards
Kishan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Your code is nothing to do with your label visibility. Check Enable property of the label, cardinality of node etc.,
Regards
Raghu
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.