on 04-30-2008 4:51 PM
Hi all,
I need to show all the messages in popup window and\or write them to file (not log all of them but write only for present moment).
Is it possible to get list of all reported messages? Maybe like MessageArea do?
Edited by: ANTON HRYDZIN on Apr 30, 2008 5:52 PM
Anton,
Create a method in Component controller and call where ever you want to display the error or warning messages.
if( type.equals( "Error"))
{
wdComponentAPI.getMessageManager().reportException( message, true);
}else if( type.equals( "Warning"))
{
wdComponentAPI.getMessageManager().reportWarning( message);
}else
{
wdComponentAPI.getMessageManager().reportSuccess( message);
}
try
{
BufferedWriter bufferedwriter = new BufferedWriter( new FileWriter( <filepath>));
bufferedwriter.write( message);
bufferedwriter.close();
} catch (IOException e)
{
// TODO Auto-generated catch block
openMessage( e.getLocalizedMessage(), "Error");
e.printStackTrace();
}
In button press or any event triggering part put this code:
wdThis.wdGetTestComponentController().openMessage( "First button Pressed", "Success");
You can see the file in J2EE server in specified location.
Regards
Vinod V
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
Can anyone help here? i also have same problem. I have to get list all the enteries of message pool regardless of entry type. is it possible?
thanks
Reena
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Problem is not in showing the message, but in getting of all the messages. Can we somehow get all the messages from MessageManager or from any were else, just like MessageArea do? Without editing code, that sends all this messages.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For displaying window
IWDControllerInfo contInfo = wdControllerAPI.getViewInfo().getViewController();
IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow( "Your Message", contInfo.findInEventHandlers( "okMethod"), "OK");
dialog.show();
where okMethod is a predefined method where you can append those messages to write to file
e.g.
public void okMethod(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin ok(ServerEvent)
String log = wdContext.currentContextElement().getLogs();
log+= "new messages"
wdContext.currentContextElement().setLogs(log);
//@@end
}
you can use File class to write all logs to a file.
http://java.sun.com/j2se/1.3/docs/api/java/io/File.html
nikhiL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.