on 12-19-2008 2:59 AM
Hi,
I have one requirement that is i have 2 input fields called fristname and lastname actually to display a error message we need to use message editor but the message will be shown at end of the view but my requirement is i need to display message beside of input field can any body tell how to do this with clear steps.
Regards,
Kemp
Hi,
You can use the below mentioned code to get the required result
wdComponentAPI.getMessageManager().reportContextAttributeMessage(wdContext.currentContextElement(),wdContext.getNodeInfo().getAttribute("Va_FirstName"),IMessageTestComp.SEARCH,new Object[]{"Va_FirstName"},false);
this will be helpfull in ur case.
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 Kemp,
I got ur point.. u need to use Message editor wid message pool
this doc fits in ur requirement go through this :[doc|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f4d79e59-0601-0010-0689-89670315bc6b]
for a refrence u cn chk this too:[Ref|http://www.vogella.de/articles/SAPWebDynpro/article.html]
hope it hlps u
Regards
Khushboo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this
IWDNodeElement element = wdContext.nodeTest().getCurrentElement();
IWDAttributeInfo attribute = wdContext.nodeTest().getNodeInfo().getAttribute( "name_value");
wdComponentAPI.getMessageManager()
.reportInvalidContextAttributeException( element, attribute, "Error", false);
For details use this java doc.
Hope this is what you asked for.
Regards
Vinod
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Plz see the MessageArea UI element.
For your requirement, as I understood, try IWDMessageManager. raiseInvalidContextAttributeException(IWDNodeElement element, IWDAttributeInfo attribute, String message, boolean cancelNavigation)
see [IWDMessageManager API|http://help.sap.com/javadocs/NW04/current/wd/com/sap/tc/webdynpro/progmodel/api/IWDMessageManager.html]
nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can refer the code by Vinod
As I understood the problem, An error message, if any, would be point to the InputField where the user enters at runtime.
sol:
Context:
Input (node, 1..1)
-Name(attr, String)
I<Comp_Name>.IInputElement element = wdContext.currentInputElement();
IWDAttributeInfo atrinfo = wdContext.nodeInput().getNodeInfo().getAttribute( "Name");
if( wdContext.currentInputElement().getName()== null) {
wdComponentAPI
.getMessageManager
.reportInvalidContextException( element, atrinfo, "This field can't be empty", false);
} else{
....
}
if this is not what you looking for, plz feel free to put question clearly.
nikhil
HI nikh,
I have one requirement that is i have 2 input fields called fristname and lastname actually to display a error message we need to use message editor but the message will be shown at end of the view. But my requirement is i need to display message beside of input field can any body tell how to do this with clear steps. Where i need to write code in inputfield action or some where
Regards,
Kemp
Hi Kemp,
Assuming that you are trying to validate user input, I would suggest the following -
Use Matrix Layout. Make the layoutdata property of both input fields as 'Matrix head data'. After each input field insert one 'Label' element with layoutdata property as 'Matrix Data'.
Bind the 'visible' property of the two labels to context attributes say visibility1 and visibility2 of type 'com.sap.ide.webdynpro.uielementdefinitions.Visibility' and 'text' property of the labels to context attributes say error1 and error2 of type string.
Whenever your input criteria for any inputfield is not met, you should set the Label's text property by changing the context attribute it is mapped to (error1 or error2), and also make it visible by changing the visibility context attribute.
The message area UI element is not useful for you here as you can not have two message area elements. The MessageArea UI element represents a placeholder that specifies where all the webdynpro error messages or warnings, should appear in the view.
Hope this helps.
Regards,
Anagha
Hi Jawalekar,
Thank you for your reply,I need to show error message at run time by using msgpool and also i need to show if entered text in input is wrong then i need to show error message and input field must be in red color.can you tell me how to do this with clear steps.
Regards,
Kemp
Edited by: kemp sath on Dec 24, 2008 8:08 AM
This might help you
https://wiki.sdn.sap.com/wiki/display/WDJava/ValidatingWebDynproJavaapplications
Regards,
Jawed Ali
you can give invisible label fields next to the inputfields make them visible and invisible dynamically and also populate the error message on that label.
Thanks and Regards
shanto aloor
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 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.