on 07-22-2008 12:54 PM
Hi everyone,
I have created an input form with drop downs and different actions in it.
When I input a wrong date format and then select an item from a drop down the error message "Enter the value in the format 25/11/1987" occurs. I want this error message only to be displayed after I pressed the button "Save" at the end of the form. In between no validations should be made. All actions except the "Save" Action are defined "without validation". But still the error message occurs after some action was called. (e.g. Selection of a drop down element)
Can anybody help me with this problem?
Best regards,
Olaf
Hi ,
This Error is thrown by WD Framework, so it cannot be handled. Non validating event will also not work because these error are thrown before the event occurs.
Regards,
Sunitha Hari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I solved the problem.
context
I have taken three context variables.
Firstname-->string
Name-->Enumerated simpletype
Stratdate-->date
Layout and data binding
inputfield-->startdate
dropdowmbykey-->Name
TextView-->Firstname
button
MessagePool
MessageKey-->DateIsInPast
MessageType-->error
MessageText-->you have entered ,which is in past.
Please enter valid .
Methods
checkdate with one String parameter
Implementation
public void onActionselectaction(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionselectaction(ServerEvent)
String name=wdContext.currentContextElement().getName();
wdContext.currentContextElement().setFirstname(name);
//@@end
}
public void onActionsaveaction(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionsaveaction(ServerEvent)
this.CheckDate("startdate");
wdComponentAPI.getMessageManager().raisePendingException();
wdThis.wdFirePlugOut1();
//@@end
}
public void CheckDate( java.lang.String dateparam )
{
//@@begin CheckDate()
IWDMessageManager msgmgr=wdComponentAPI.getMessageManager();
Date usrdate=(Date)wdContext.currentContextElement().getAttributeValue(dateparam);
IWDAttributeInfo attinfo=wdContext.getNodeInfo().getAttribute(dateparam);
if((System.currentTimeMillis()-usrdate.getTime())>=0)
{
msgmgr.reportContextAttributeMessage(wdContext.currentContextElement(),
attinfo,
IMessageMainComp.DATE_IS_IN_PAST,
new Object[]{ dateparam,usrdate },
true);
}
//@@end
}
and you will do the appropriate context mapping b/w second view and compController and Databinding for SecondView.
Regards
sowmya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Check data type of value attribute bound to UI Element. Is it Date?. If data type is date then it will give u help for choosing a date by date picker
Mandeep Virk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Where you are giving the date? is it input field bound to date type attribute? which UI you are using to input a DATE?
I am working with the same, (input field bind to date type value attribute) which will show a input filed and a date picker beside it. I am not getting any error messages if i type wrong date format.
PradeeP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.