on 06-09-2006 11:01 PM
Hi,
Maybe somebody has already solved this kind of problem..
I have an input date field in the UI, and Webdynpro checks if the value entered is valid when any Action is started.
If it's a wrong date, like "abc", it shows a message like "please, give a value in format...". So far so good.
But my application is in Portuguese (Brazil), and
I need to translate this message!
Instead of this, I think I could lock the input by the keyboard, since there is a pick-applet to select the date, and thus there wouldn't be chance to errors.
Or even more, I could handle the wrong value entered to throw an appropriate message, BUT Webdynpro doesn't get this wrong value, and I can't receive it in my code (Controller View).
Anyway, I don't know how to implement any of the 3 above options.
Could anybody help me ?
Thanks,
Fabio
These messages come from the Java DDIC (data dictionary) layer. Search this forum for how to add additional resource bundles for DDIC messages.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Fabio,
if it is in English, validating a date is not a big deal. Is this what you want?. You can implement the first option, which is when you are taking the date and validating....this is the code snippet taken from the No.3 tutorial....
public void checkDateInPast(java.lang.String fieldName) {
//@@begin checkDateInPast()
IWDMessageManager msgMgr =
wdComponentAPI.getMessageManager();
Date theDate = (Date)
wdContext.currentContextElement().getAttributeValue(fieldName);
IWDAttributeInfo attributeInfo =
wdContext.getNodeInfo().getAttribute(fieldName);
if (theDate.after(new Date(System.currentTimeMillis()))) {
String fieldLabel =
wdContext.getNodeInfo().getAttribute(fieldName)
.getSimpleType().getFieldLabel();
msgMgr.reportContextAttributeMessage(
wdContext.currentContextElement(),
attributeInfo,
IMessageSimpleErrors.DATE_IS_IN_FUTURE,
newObject[] { fieldLabel, theDate },
true);
Thanks,
Raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raj,
not exactly...
My problems actually are:
1) I have to report the wrong entrance of a string instead of a valid date.
2) The language of the message. Unfortunately I can't leave it in English.
Concerning that the input field is already a date, and so webdynpro doesn't run my code without throwing a message in English before.
I don't know, but I'm thinking about treating it on the wdModifyView, in order to access the value of the input field before webdynpro throws the message.
Lets try.. rs
Thank you!!
Regards
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.